|
1 | | -# LibAMM Build and Publish Workflow |
| 1 | +# LibAMM CI |
2 | 2 |
|
3 | | -## 架构说明 |
| 3 | +LibAMM is the DataSys benchmark suite for approximate matrix multiplication. |
| 4 | +Framework-neutral algorithm implementations and the compatibility Python package |
| 5 | +are maintained in [AMM-Algorithms](https://github.com/DataSysResearch/AMM-Algorithms). |
4 | 6 |
|
5 | | -LibAMM 是一个独立的 C++ 库,作为 SAGE 的 submodule。它有自己的构建、测试和发布流程。 |
| 7 | +`benchmark-validation.yml` checks the maintained dataset tool, shell setup script, |
| 8 | +required benchmark inventory, and CSV configuration readability on every pull |
| 9 | +request and push to `main`. |
6 | 10 |
|
7 | | -### 仓库关系 |
8 | | - |
9 | | -``` |
10 | | -intellistream/SAGE (主仓库) |
11 | | -└── packages/sage-libs/ |
12 | | - └── src/sage/libs/ |
13 | | - └── libamm/ (submodule -> intellistream/LibAMM) |
14 | | -``` |
15 | | - |
16 | | -### 发布流程 |
17 | | - |
18 | | -1. **LibAMM 仓库** (`intellistream/LibAMM`) |
19 | | - - 维护源代码和 C++ 测试 |
20 | | - - 构建预编译的 Python wheels |
21 | | - - 发布到 PyPI 作为 `isage-libamm` |
22 | | - |
23 | | -2. **SAGE 主仓库** (`intellistream/SAGE`) |
24 | | - - 将 `isage-libamm` 声明为可选依赖 |
25 | | - - 用户安装 `isage-libs[amm]` 时自动从 PyPI 获取 |
26 | | - |
27 | | -## Workflow 说明 |
28 | | - |
29 | | -### 触发条件 |
30 | | - |
31 | | -- **自动触发**: Push 到 `main` 或 `main-dev` 分支(源代码变更时) |
32 | | -- **PR 检查**: 每个 PR 都会运行构建和测试,但不发布 |
33 | | -- **手动触发**: 可选择目标仓库(PyPI/TestPyPI) |
34 | | - |
35 | | -### 工作流程 |
36 | | - |
37 | | -``` |
38 | | -1. check-version |
39 | | - ├─ 读取 setup.py 中的版本号 |
40 | | - ├─ 对比最新的 Git tag |
41 | | - └─ 决定是否需要发布 |
42 | | -
|
43 | | -2. cpp-build-test |
44 | | - ├─ 配置 CMake |
45 | | - ├─ 编译 C++ 库 |
46 | | - └─ 运行 6 个 C++ 测试套件 |
47 | | - ✅ 所有测试必须通过才继续 |
48 | | -
|
49 | | -3. build-wheels (parallel) |
50 | | - ├─ Python 3.9 |
51 | | - ├─ Python 3.10 |
52 | | - ├─ Python 3.11 |
53 | | - └─ Python 3.12 |
54 | | - 每个版本: |
55 | | - ├─ 构建 wheel |
56 | | - └─ 测试安装和 import |
57 | | -
|
58 | | -4. publish-to-pypi |
59 | | - ├─ 收集所有 wheels |
60 | | - ├─ 发布到 PyPI/TestPyPI |
61 | | - ├─ 创建 Git tag (vX.Y.Z) |
62 | | - └─ 创建 GitHub Release |
63 | | -
|
64 | | -5. summary |
65 | | - └─ 生成构建摘要 |
66 | | -``` |
67 | | - |
68 | | -### C++ 测试套件 |
69 | | - |
70 | | -必须全部通过的测试: |
71 | | -- `cpp_test` - 基础功能测试 |
72 | | -- `sketch_test` - Sketch 算法测试 |
73 | | -- `crs_test` - 稀疏矩阵测试 |
74 | | -- `weighted_cr_test` - 加权测试 |
75 | | -- `block_partition_test` - 分块测试 |
76 | | -- `streaming_test` - 流式处理测试 |
77 | | - |
78 | | -## 版本管理 |
79 | | - |
80 | | -### 手动更新版本 |
81 | | - |
82 | | -在 `setup.py` 中修改版本号: |
83 | | - |
84 | | -```python |
85 | | -setup( |
86 | | - name='PyAMM', # 会被 workflow 自动改为 isage-libamm |
87 | | - version='0.1.5', # 👈 修改这里 |
88 | | - ... |
89 | | -) |
90 | | -``` |
91 | | - |
92 | | -### 发布规则 |
93 | | - |
94 | | -- **版本变化 + Push** → 自动发布 |
95 | | -- **版本未变化** → 跳过发布(仅运行测试) |
96 | | -- **main 分支** → PyPI(生产环境) |
97 | | -- **main-dev 分支** → TestPyPI(测试环境) |
98 | | - |
99 | | -### 示例:发布新版本 |
100 | | - |
101 | | -1. 修改代码 |
102 | | -2. 更新 `setup.py` 中的版本号(如 `0.1.5` → `0.1.6`) |
103 | | -3. Commit 并 push 到 `main-dev` |
104 | | -4. Workflow 自动: |
105 | | - - ✅ 运行 C++ 测试 |
106 | | - - ✅ 构建 4 个 Python wheels |
107 | | - - ✅ 发布到 TestPyPI |
108 | | -5. 测试通过后,merge 到 `main` |
109 | | -6. 自动发布到生产 PyPI |
110 | | - |
111 | | -## 在 SAGE 中使用 |
112 | | - |
113 | | -### 安装 LibAMM |
114 | | - |
115 | | -```bash |
116 | | -# 安装 sage-libs with LibAMM |
117 | | -pip install isage-libs[amm] |
118 | | - |
119 | | -# 或单独安装 LibAMM |
120 | | -pip install isage-libamm |
121 | | -``` |
122 | | - |
123 | | -### 导入使用 |
124 | | - |
125 | | -```python |
126 | | -from sage.libs.libamm.python import PyAMM |
127 | | - |
128 | | -# LibAMM 功能... |
129 | | -``` |
130 | | - |
131 | | -## 配置要求 |
132 | | - |
133 | | -### GitHub Secrets (LibAMM 仓库) |
134 | | - |
135 | | -需要在 **LibAMM 仓库**中配置: |
136 | | - |
137 | | -1. **PYPI_API_TOKEN** - PyPI API token |
138 | | -2. **TEST_PYPI_API_TOKEN** - TestPyPI API token |
139 | | -3. **PAT_TOKEN** - Personal Access Token (用于创建 tags) |
140 | | - |
141 | | -### Self-hosted Runner |
142 | | - |
143 | | -- **标签**: `self-hosted`, `Linux`, `X64` |
144 | | -- **内存**: ≥16GB(推荐 32GB) |
145 | | -- **CPU**: 多核(推荐 8+ 核) |
146 | | - |
147 | | -## 故障排除 |
148 | | - |
149 | | -### C++ 测试失败 |
150 | | - |
151 | | -检查测试日志,定位失败的测试用例。所有测试必须通过才能发布。 |
152 | | - |
153 | | -### Wheel 构建失败(OOM) |
154 | | - |
155 | | -增加 runner 内存或降低并行度: |
156 | | -```yaml |
157 | | -CMAKE_BUILD_PARALLEL_LEVEL: '1' # 改为 1 |
158 | | -``` |
159 | | -
|
160 | | -### PyPI 发布失败 |
161 | | -
|
162 | | -1. 检查版本号是否已经存在(PyPI 不允许重复上传) |
163 | | -2. 验证 API token 权限 |
164 | | -3. 首次发布需要先在 PyPI 创建项目 |
165 | | -
|
166 | | -## 参考链接 |
167 | | -
|
168 | | -- **LibAMM 源码**: https://github.com/DataSysResearch/LibAMM |
169 | | -- **PyPI 包**: https://pypi.org/project/isage-libamm/ |
170 | | -- **SAGE 文档**: https://intellistream.github.io/SAGE-Pub/ |
| 11 | +This repository does not build or publish the `isage-amms` package. Package builds |
| 12 | +and releases belong to AMM-Algorithms. |
0 commit comments