From a648188cd8623c65a864ae4f019e8a6d815e9ef8 Mon Sep 17 00:00:00 2001 From: shuhao Date: Thu, 23 Jul 2026 20:53:38 +0800 Subject: [PATCH 1/2] ci: move builds to hosted runners --- .github/workflows/build-and-publish.yml | 12 ++++++------ .github/workflows/cmake.yml | 4 ++-- INSTALLATION.md | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build-and-publish.yml b/.github/workflows/build-and-publish.yml index 448eda40..dc11ae2a 100644 --- a/.github/workflows/build-and-publish.yml +++ b/.github/workflows/build-and-publish.yml @@ -44,7 +44,7 @@ jobs: # ============================================================================ check-version: name: Check version and changes - runs-on: [self-hosted, linux, x64] + runs-on: ubuntu-22.04 outputs: version: ${{ steps.get_version.outputs.version }} has_version_change: ${{ steps.check_version.outputs.has_change }} @@ -127,7 +127,7 @@ jobs: # ============================================================================ cpp-build-test: name: Build and test C++ (Ubuntu) - runs-on: [self-hosted, linux, x64] + runs-on: ubuntu-22.04 steps: - name: Checkout repository @@ -171,7 +171,7 @@ jobs: echo "✅ All C++ tests passed!" # ============================================================================ - # Job 3: Build Python wheels (multi-version, self-hosted) + # Job 3: Build Python wheels (multi-version) # ============================================================================ build-wheels: name: Build wheel (Python ${{ matrix.python-version }}) @@ -180,7 +180,7 @@ jobs: if: | github.event_name == 'pull_request' || needs.check-version.outputs.should_publish == 'true' - runs-on: [self-hosted, Linux, X64] + runs-on: ubuntu-22.04 strategy: fail-fast: false @@ -279,7 +279,7 @@ jobs: publish-to-pypi: name: Publish to PyPI needs: [check-version, build-wheels] - runs-on: [self-hosted, linux, x64] + runs-on: ubuntu-22.04 if: needs.check-version.outputs.should_publish == 'true' steps: @@ -382,7 +382,7 @@ jobs: summary: name: Build Summary needs: [check-version, cpp-build-test, build-wheels, publish-to-pypi] - runs-on: [self-hosted, linux, x64] + runs-on: ubuntu-22.04 if: always() steps: diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 9e5ebf54..cf68b052 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -16,10 +16,10 @@ jobs: # well on Windows or Mac. You can convert this to a matrix build if you need # cross-platform coverage. # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix - runs-on: [self-hosted, linux, x64] + runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Install toolchains run: | sudo apt-get update diff --git a/INSTALLATION.md b/INSTALLATION.md index 55021155..08305ac9 100644 --- a/INSTALLATION.md +++ b/INSTALLATION.md @@ -101,7 +101,7 @@ pip install isage-amms **Solution 2**: Install from SAGE source ```bash -git clone https://github.com/intellistream/SAGE.git +git clone https://github.com/SAGE-Research/SAGE.git cd SAGE pip install -e packages/sage-libs ``` From fed21804eafae062939c4e82f7e5df8bdc571fc8 Mon Sep 17 00:00:00 2001 From: shuhao Date: Thu, 23 Jul 2026 21:01:23 +0800 Subject: [PATCH 2/2] ci: validate the benchmark-only repository --- .github/workflows/README.md | 176 +-------- .github/workflows/auto-version-bump.yml | 107 ------ .github/workflows/benchmark-validation.yml | 53 +++ .github/workflows/build-and-publish.yml | 428 --------------------- .github/workflows/cmake.yml | 63 --- 5 files changed, 62 insertions(+), 765 deletions(-) delete mode 100644 .github/workflows/auto-version-bump.yml create mode 100644 .github/workflows/benchmark-validation.yml delete mode 100644 .github/workflows/build-and-publish.yml delete mode 100644 .github/workflows/cmake.yml diff --git a/.github/workflows/README.md b/.github/workflows/README.md index 658fea21..fc29b3d4 100644 --- a/.github/workflows/README.md +++ b/.github/workflows/README.md @@ -1,170 +1,12 @@ -# LibAMM Build and Publish Workflow +# LibAMM CI -## 架构说明 +LibAMM is the DataSys benchmark suite for approximate matrix multiplication. +Framework-neutral algorithm implementations and the compatibility Python package +are maintained in [AMM-Algorithms](https://github.com/DataSysResearch/AMM-Algorithms). -LibAMM 是一个独立的 C++ 库,作为 SAGE 的 submodule。它有自己的构建、测试和发布流程。 +`benchmark-validation.yml` checks the maintained dataset tool, shell setup script, +required benchmark inventory, and CSV configuration readability on every pull +request and push to `main`. -### 仓库关系 - -``` -intellistream/SAGE (主仓库) -└── packages/sage-libs/ - └── src/sage/libs/ - └── libamm/ (submodule -> intellistream/LibAMM) -``` - -### 发布流程 - -1. **LibAMM 仓库** (`intellistream/LibAMM`) - - 维护源代码和 C++ 测试 - - 构建预编译的 Python wheels - - 发布到 PyPI 作为 `isage-libamm` - -2. **SAGE 主仓库** (`intellistream/SAGE`) - - 将 `isage-libamm` 声明为可选依赖 - - 用户安装 `isage-libs[amm]` 时自动从 PyPI 获取 - -## Workflow 说明 - -### 触发条件 - -- **自动触发**: Push 到 `main` 或 `main-dev` 分支(源代码变更时) -- **PR 检查**: 每个 PR 都会运行构建和测试,但不发布 -- **手动触发**: 可选择目标仓库(PyPI/TestPyPI) - -### 工作流程 - -``` -1. check-version - ├─ 读取 setup.py 中的版本号 - ├─ 对比最新的 Git tag - └─ 决定是否需要发布 - -2. cpp-build-test - ├─ 配置 CMake - ├─ 编译 C++ 库 - └─ 运行 6 个 C++ 测试套件 - ✅ 所有测试必须通过才继续 - -3. build-wheels (parallel) - ├─ Python 3.9 - ├─ Python 3.10 - ├─ Python 3.11 - └─ Python 3.12 - 每个版本: - ├─ 构建 wheel - └─ 测试安装和 import - -4. publish-to-pypi - ├─ 收集所有 wheels - ├─ 发布到 PyPI/TestPyPI - ├─ 创建 Git tag (vX.Y.Z) - └─ 创建 GitHub Release - -5. summary - └─ 生成构建摘要 -``` - -### C++ 测试套件 - -必须全部通过的测试: -- `cpp_test` - 基础功能测试 -- `sketch_test` - Sketch 算法测试 -- `crs_test` - 稀疏矩阵测试 -- `weighted_cr_test` - 加权测试 -- `block_partition_test` - 分块测试 -- `streaming_test` - 流式处理测试 - -## 版本管理 - -### 手动更新版本 - -在 `setup.py` 中修改版本号: - -```python -setup( - name='PyAMM', # 会被 workflow 自动改为 isage-libamm - version='0.1.5', # 👈 修改这里 - ... -) -``` - -### 发布规则 - -- **版本变化 + Push** → 自动发布 -- **版本未变化** → 跳过发布(仅运行测试) -- **main 分支** → PyPI(生产环境) -- **main-dev 分支** → TestPyPI(测试环境) - -### 示例:发布新版本 - -1. 修改代码 -2. 更新 `setup.py` 中的版本号(如 `0.1.5` → `0.1.6`) -3. Commit 并 push 到 `main-dev` -4. Workflow 自动: - - ✅ 运行 C++ 测试 - - ✅ 构建 4 个 Python wheels - - ✅ 发布到 TestPyPI -5. 测试通过后,merge 到 `main` -6. 自动发布到生产 PyPI - -## 在 SAGE 中使用 - -### 安装 LibAMM - -```bash -# 安装 sage-libs with LibAMM -pip install isage-libs[amm] - -# 或单独安装 LibAMM -pip install isage-libamm -``` - -### 导入使用 - -```python -from sage.libs.libamm.python import PyAMM - -# LibAMM 功能... -``` - -## 配置要求 - -### GitHub Secrets (LibAMM 仓库) - -需要在 **LibAMM 仓库**中配置: - -1. **PYPI_API_TOKEN** - PyPI API token -2. **TEST_PYPI_API_TOKEN** - TestPyPI API token -3. **PAT_TOKEN** - Personal Access Token (用于创建 tags) - -### Self-hosted Runner - -- **标签**: `self-hosted`, `Linux`, `X64` -- **内存**: ≥16GB(推荐 32GB) -- **CPU**: 多核(推荐 8+ 核) - -## 故障排除 - -### C++ 测试失败 - -检查测试日志,定位失败的测试用例。所有测试必须通过才能发布。 - -### Wheel 构建失败(OOM) - -增加 runner 内存或降低并行度: -```yaml -CMAKE_BUILD_PARALLEL_LEVEL: '1' # 改为 1 -``` - -### PyPI 发布失败 - -1. 检查版本号是否已经存在(PyPI 不允许重复上传) -2. 验证 API token 权限 -3. 首次发布需要先在 PyPI 创建项目 - -## 参考链接 - -- **LibAMM 源码**: https://github.com/DataSysResearch/LibAMM -- **PyPI 包**: https://pypi.org/project/isage-libamm/ -- **SAGE 文档**: https://intellistream.github.io/SAGE-Pub/ +This repository does not build or publish the `isage-amms` package. Package builds +and releases belong to AMM-Algorithms. diff --git a/.github/workflows/auto-version-bump.yml b/.github/workflows/auto-version-bump.yml deleted file mode 100644 index a2dfed3b..00000000 --- a/.github/workflows/auto-version-bump.yml +++ /dev/null @@ -1,107 +0,0 @@ -name: Auto Version Bump - -on: - push: - branches: - - main - paths: - - 'src/**' - - 'include/**' - - 'test/**' - - 'CMakeLists.txt' - - 'setup.py' - -jobs: - bump-version: - name: Auto bump patch version - runs-on: ubuntu-latest - if: github.event_name == 'push' && github.ref == 'refs/heads/main' - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - fetch-depth: 0 - token: ${{ secrets.PAT_TOKEN || secrets.GITHUB_TOKEN }} - - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: '3.11' - - - name: Get current version and bump - id: bump - run: | - # Extract current version from setup.py - CURRENT_VERSION=$(python -c " - import re - with open('setup.py', 'r') as f: - content = f.read() - match = re.search(r\"version='([^']+)'\", content) - if match: - print(match.group(1)) - else: - print('0.1.0') - ") - - echo "Current version: $CURRENT_VERSION" - - # Parse version (support 0.1, 0.1.0, 0.1.2 formats) - if [[ $CURRENT_VERSION =~ ^([0-9]+)\.([0-9]+)\.([0-9]+)$ ]]; then - # Standard semver: 0.1.2 -> 0.1.3 - MAJOR="${BASH_REMATCH[1]}" - MINOR="${BASH_REMATCH[2]}" - PATCH="${BASH_REMATCH[3]}" - NEW_PATCH=$((PATCH + 1)) - elif [[ $CURRENT_VERSION =~ ^([0-9]+)\.([0-9]+)$ ]]; then - # Format: 0.1 -> 0.1.1 - MAJOR="${BASH_REMATCH[1]}" - MINOR="${BASH_REMATCH[2]}" - NEW_PATCH=1 - else - echo "Error: Unable to parse version: $CURRENT_VERSION" - exit 1 - fi - - NEW_VERSION="${MAJOR}.${MINOR}.${NEW_PATCH}" - echo "New version: $NEW_VERSION" - - echo "current_version=$CURRENT_VERSION" >> $GITHUB_OUTPUT - echo "new_version=$NEW_VERSION" >> $GITHUB_OUTPUT - - - name: Update setup.py version - run: | - python -c " - import re - with open('setup.py', 'r') as f: - content = f.read() - - # Replace version - content = re.sub( - r\"version='[^']+'\", - \"version='${{ steps.bump.outputs.new_version }}'\", - content - ) - - with open('setup.py', 'w') as f: - f.write(content) - - print('✅ Updated version to ${{ steps.bump.outputs.new_version }}') - " - - - name: Commit version bump - run: | - git config user.name "github-actions[bot]" - git config user.email "github-actions[bot]@users.noreply.github.com" - git add setup.py - git commit -m "chore: bump version to ${{ steps.bump.outputs.new_version }} [skip ci] - - Auto-incremented from ${{ steps.bump.outputs.current_version }} - Triggered by merge to main" - git push - - - name: Create git tag - run: | - git tag "v${{ steps.bump.outputs.new_version }}" - git push origin "v${{ steps.bump.outputs.new_version }}" - echo "✅ Created and pushed tag v${{ steps.bump.outputs.new_version }}" diff --git a/.github/workflows/benchmark-validation.yml b/.github/workflows/benchmark-validation.yml new file mode 100644 index 00000000..c2901e99 --- /dev/null +++ b/.github/workflows/benchmark-validation.yml @@ -0,0 +1,53 @@ +name: Benchmark validation + +on: + push: + branches: [main] + pull_request: + branches: [main] + workflow_dispatch: + +jobs: + validate: + runs-on: ubuntu-22.04 + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.11" + + - name: Validate maintained tools + run: | + python -m py_compile tools/data_manager.py + bash -n tools/setup_data.sh + + - name: Validate benchmark inventory + run: | + python - <<'PY' + import csv + from pathlib import Path + + required = [ + Path("README.md"), + Path("LICENSE"), + Path("benchmark/README.md"), + Path("benchmark/config.csv"), + Path("benchmark/perfLists"), + Path("benchmark/scripts"), + Path("tools/data_manager.py"), + ] + missing = [str(path) for path in required if not path.exists()] + if missing: + raise SystemExit(f"Missing benchmark assets: {', '.join(missing)}") + + csv_files = list(Path("benchmark").rglob("*.csv")) + if not csv_files: + raise SystemExit("No benchmark configuration CSV files found") + for path in csv_files: + with path.open(newline="", encoding="utf-8", errors="strict") as handle: + next(csv.reader(handle), None) + print(f"Validated {len(csv_files)} benchmark CSV files") + PY diff --git a/.github/workflows/build-and-publish.yml b/.github/workflows/build-and-publish.yml deleted file mode 100644 index dc11ae2a..00000000 --- a/.github/workflows/build-and-publish.yml +++ /dev/null @@ -1,428 +0,0 @@ -name: Build, Test and Publish LibAMM - -on: - push: - branches: - - main - - main-dev - paths: - - 'src/**' - - 'include/**' - - 'test/**' - - 'CMakeLists.txt' - - 'setup.py' - - '.github/workflows/build-and-publish.yml' - - pull_request: - branches: - - main - - main-dev - - workflow_dispatch: - inputs: - repository: - description: 'Target PyPI repository' - required: false - default: 'testpypi' - type: choice - options: - - testpypi - - pypi - force_publish: - description: 'Force publish even if no version change' - required: false - default: false - type: boolean - -env: - TORCH_VERSION: '2.5.0' - PACKAGE_NAME: 'isage-libamm' - -jobs: - # ============================================================================ - # Job 1: Check version and changes - # ============================================================================ - check-version: - name: Check version and changes - runs-on: ubuntu-22.04 - outputs: - version: ${{ steps.get_version.outputs.version }} - has_version_change: ${{ steps.check_version.outputs.has_change }} - should_publish: ${{ steps.decide.outputs.should_publish }} - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: '3.11' - - - name: Get current version - id: get_version - run: | - VERSION=$(python -c " - import re - with open('setup.py', 'r') as f: - content = f.read() - match = re.search(r\"version='([^']+)'\", content) - if match: - print(match.group(1)) - else: - print('0.1.0') - ") - echo "version=$VERSION" >> $GITHUB_OUTPUT - echo "Current version: $VERSION" - - - name: Check if version changed - id: check_version - run: | - LATEST_TAG=$(git tag -l "v*" --sort=-version:refname | head -n 1 || echo "") - - if [ -z "$LATEST_TAG" ]; then - echo "No previous tag found, treating as new release" - echo "has_change=true" >> $GITHUB_OUTPUT - else - LATEST_VERSION=$(echo "$LATEST_TAG" | sed 's/^v//') - CURRENT_VERSION="${{ steps.get_version.outputs.version }}" - - echo "Latest tag: $LATEST_TAG (version: $LATEST_VERSION)" - echo "Current version: $CURRENT_VERSION" - - if [ "$LATEST_VERSION" != "$CURRENT_VERSION" ]; then - echo "Version has changed: $LATEST_VERSION -> $CURRENT_VERSION" - echo "has_change=true" >> $GITHUB_OUTPUT - else - echo "Version unchanged: $CURRENT_VERSION" - echo "has_change=false" >> $GITHUB_OUTPUT - fi - fi - - - name: Decide whether to publish - id: decide - run: | - SHOULD_PUBLISH="false" - - # 发布条件: - # 1. push 到 main 分支(自动版本提升后会触发) - # 2. 或者手动触发且 force_publish=true - if [ "${{ github.ref }}" = "refs/heads/main" ] && [ "${{ github.event_name }}" = "push" ]; then - SHOULD_PUBLISH="true" - echo "✅ Publishing: Push to main branch" - elif [ "${{ github.event.inputs.force_publish }}" = "true" ]; then - SHOULD_PUBLISH="true" - echo "✅ Publishing: Force publish enabled" - else - echo "❌ Not publishing: ref=${{ github.ref }}, event=${{ github.event_name }}" - fi - - echo "should_publish=$SHOULD_PUBLISH" >> $GITHUB_OUTPUT - echo "Decision: should_publish=$SHOULD_PUBLISH" - - # ============================================================================ - # Job 2: Build and test C++ library - # ============================================================================ - cpp-build-test: - name: Build and test C++ (Ubuntu) - runs-on: ubuntu-22.04 - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - submodules: recursive - - - name: Install system dependencies - run: | - sudo apt-get update - sudo apt-get install -y gcc g++ cmake python3 python3-pip - - - name: Install PyTorch - run: | - pip3 install --no-cache-dir --default-timeout=100 --retries 5 torch==${{ env.TORCH_VERSION }} --index-url https://download.pytorch.org/whl/cpu - - - name: Configure CMake - run: | - cmake -B build \ - -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_PREFIX_PATH=$(python3 -c "import torch; print(torch.utils.cmake_prefix_path)") \ - -DLIBAMM_SKIP_DATASET_COPY=ON \ - -DENABLE_PYBIND=ON \ - -DENABLE_HDF5=ON \ - -DENABLE_UNIT_TESTS=ON - - - name: Build C++ library - run: | - cmake --build build --config Release -j$(nproc) - - - name: Run C++ tests - working-directory: build/test - run: | - echo "=== Running C++ Tests ===" - ./cpp_test "--success" || exit 1 - ./sketch_test "--success" || exit 1 - ./crs_test "--success" || exit 1 - ./weighted_cr_test "--success" || exit 1 - ./block_partition_test "--success" || exit 1 - ./streaming_test "--success" || exit 1 - echo "✅ All C++ tests passed!" - - # ============================================================================ - # Job 3: Build Python wheels (multi-version) - # ============================================================================ - build-wheels: - name: Build wheel (Python ${{ matrix.python-version }}) - needs: [check-version, cpp-build-test] - # Run on: PR (for testing) OR when should_publish is true (for publishing) - if: | - github.event_name == 'pull_request' || - needs.check-version.outputs.should_publish == 'true' - runs-on: ubuntu-22.04 - - strategy: - fail-fast: false - matrix: - python-version: ['3.9', '3.10', '3.11', '3.12'] - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - submodules: recursive - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - - - name: Check system resources - run: | - echo "=== System Resources ===" - free -h - echo "=== Available memory ===" - AVAILABLE_MEM=$(free -g | awk '/^Mem:/{print $7}') - echo "Available: ${AVAILABLE_MEM}GB" - if [ "$AVAILABLE_MEM" -lt 12 ]; then - echo "⚠️ Warning: Only ${AVAILABLE_MEM}GB available" - echo "LibAMM compilation requires at least 12GB free memory" - fi - - - name: Install build dependencies - run: | - python -m pip install --upgrade pip setuptools wheel - pip install build pybind11 numpy - pip install torch==${{ env.TORCH_VERSION }} --index-url https://download.pytorch.org/whl/cpu - - - name: Update package name in setup.py - run: | - python -c " - import re - with open('setup.py', 'r') as f: - content = f.read() - # Update package name to isage-libamm - content = re.sub(r\"name='PyAMM'\", \"name='${{ env.PACKAGE_NAME }}'\", content) - with open('setup.py', 'w') as f: - f.write(content) - print('✅ Updated package name to ${{ env.PACKAGE_NAME }}') - " - - - name: Build Python wheel - env: - CMAKE_BUILD_PARALLEL_LEVEL: '2' # Limit parallelism to avoid OOM - run: | - echo "=== Building Python wheel ===" - echo "Version: ${{ needs.check-version.outputs.version }}" - - python -m build --wheel --no-isolation - - echo "=== Generated wheel ===" - ls -lh dist/ - - - name: Test wheel installation and import - run: | - echo "=== Testing wheel installation ===" - - # Create test venv - python -m venv test_env - source test_env/bin/activate - - # Install dependencies - pip install torch==${{ env.TORCH_VERSION }} --index-url https://download.pytorch.org/whl/cpu - pip install numpy - - # Install the wheel - pip install dist/*.whl - - # Test import - python -c " - import PyAMM - print('✅ LibAMM (PyAMM module) successfully imported!') - print('✅ Wheel is functional for Python ${{ matrix.python-version }}') - " - - deactivate - rm -rf test_env - - - name: Upload wheel artifact - uses: actions/upload-artifact@v4 - with: - name: wheel-py${{ matrix.python-version }} - path: dist/*.whl - retention-days: 30 - - # ============================================================================ - # Job 4: Publish to PyPI - # ============================================================================ - publish-to-pypi: - name: Publish to PyPI - needs: [check-version, build-wheels] - runs-on: ubuntu-22.04 - if: needs.check-version.outputs.should_publish == 'true' - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - fetch-depth: 0 - token: ${{ secrets.PAT_TOKEN || secrets.GITHUB_TOKEN }} - - - name: Download all wheels - uses: actions/download-artifact@v4 - with: - pattern: wheel-* - path: dist/ - merge-multiple: true - - - name: List wheels - run: | - echo "=== Wheels to publish ===" - ls -lh dist/ - echo "" - echo "Total: $(ls -1 dist/*.whl | wc -l) wheels" - - - name: Determine target repository - id: repo - run: | - if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then - REPOSITORY="${{ github.event.inputs.repository }}" - elif [ "${{ github.ref_name }}" = "main" ]; then - REPOSITORY="pypi" - else - REPOSITORY="testpypi" - fi - - echo "repository=$REPOSITORY" >> $GITHUB_OUTPUT - echo "📦 Publishing to: $REPOSITORY" - - - name: Publish to PyPI - uses: pypa/gh-action-pypi-publish@release/v1 - with: - password: ${{ steps.repo.outputs.repository == 'pypi' && secrets.PYPI_API_TOKEN || secrets.TEST_PYPI_API_TOKEN }} - repository-url: ${{ steps.repo.outputs.repository == 'testpypi' && 'https://test.pypi.org/legacy/' || '' }} - packages-dir: dist/ - verbose: true - - - name: Create Git tag - if: steps.repo.outputs.repository == 'pypi' - run: | - git config user.name "github-actions[bot]" - git config user.email "github-actions[bot]@users.noreply.github.com" - - TAG_NAME="v${{ needs.check-version.outputs.version }}" - - if git rev-parse "$TAG_NAME" >/dev/null 2>&1; then - echo "Tag $TAG_NAME already exists, skipping" - else - git tag -a "$TAG_NAME" -m "Release ${{ needs.check-version.outputs.version }}" - git push origin "$TAG_NAME" - echo "✅ Created and pushed tag: $TAG_NAME" - fi - - - name: Create GitHub Release - if: steps.repo.outputs.repository == 'pypi' - uses: softprops/action-gh-release@v1 - with: - tag_name: v${{ needs.check-version.outputs.version }} - name: LibAMM v${{ needs.check-version.outputs.version }} - body: | - ## LibAMM v${{ needs.check-version.outputs.version }} - - High-performance Approximate Matrix Multiplication library with NumPy interface. - - ### 🚀 Installation - \`\`\`bash - pip install ${{ env.PACKAGE_NAME }}==${{ needs.check-version.outputs.version }} - \`\`\` - - ### 📦 Features - - Approximate matrix multiplication algorithms - - NumPy-based Python interface - - PyTorch backend for high performance - - Comprehensive C++ test suite - - Support for Python 3.9-3.12 - - ### 🔗 Links - - [PyPI Package](https://pypi.org/project/${{ env.PACKAGE_NAME }}/${{ needs.check-version.outputs.version }}/) - - [Documentation](https://github.com/DataSysResearch/LibAMM) - - **Branch**: `${{ github.ref_name }}` - **Commit**: `${{ github.sha }}` - files: dist/*.whl - draft: false - prerelease: ${{ github.ref_name != 'main' }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - # ============================================================================ - # Job 5: Summary - # ============================================================================ - summary: - name: Build Summary - needs: [check-version, cpp-build-test, build-wheels, publish-to-pypi] - runs-on: ubuntu-22.04 - if: always() - - steps: - - name: Generate summary - run: | - echo "## 🔧 LibAMM Build & Publish Summary" >> $GITHUB_STEP_SUMMARY - echo "" >> $GITHUB_STEP_SUMMARY - echo "- **Event**: ${{ github.event_name }}" >> $GITHUB_STEP_SUMMARY - echo "- **Branch**: ${{ github.ref_name }}" >> $GITHUB_STEP_SUMMARY - echo "- **Version**: ${{ needs.check-version.outputs.version }}" >> $GITHUB_STEP_SUMMARY - echo "- **Should Publish**: ${{ needs.check-version.outputs.should_publish }}" >> $GITHUB_STEP_SUMMARY - echo "" >> $GITHUB_STEP_SUMMARY - - echo "### Job Status" >> $GITHUB_STEP_SUMMARY - echo "- C++ Build & Test: ${{ needs.cpp-build-test.result }}" >> $GITHUB_STEP_SUMMARY - - if [ "${{ needs.check-version.outputs.should_publish }}" = "true" ]; then - echo "- Python Wheels: ${{ needs.build-wheels.result }}" >> $GITHUB_STEP_SUMMARY - echo "- PyPI Publish: ${{ needs.publish-to-pypi.result }}" >> $GITHUB_STEP_SUMMARY - - if [ "${{ needs.publish-to-pypi.result }}" = "success" ]; then - echo "" >> $GITHUB_STEP_SUMMARY - echo "### ✅ Published Successfully" >> $GITHUB_STEP_SUMMARY - echo "" >> $GITHUB_STEP_SUMMARY - echo "Install with:" >> $GITHUB_STEP_SUMMARY - echo '```bash' >> $GITHUB_STEP_SUMMARY - echo "pip install ${{ env.PACKAGE_NAME }}==${{ needs.check-version.outputs.version }}" >> $GITHUB_STEP_SUMMARY - echo '```' >> $GITHUB_STEP_SUMMARY - fi - else - echo "" >> $GITHUB_STEP_SUMMARY - echo "### ℹ️ No Publish Needed" >> $GITHUB_STEP_SUMMARY - echo "Version has not changed or conditions not met for publishing." >> $GITHUB_STEP_SUMMARY - fi - - # Check for failures - if [ "${{ needs.cpp-build-test.result }}" = "failure" ] || \ - [ "${{ needs.build-wheels.result }}" = "failure" ] || \ - [ "${{ needs.publish-to-pypi.result }}" = "failure" ]; then - echo "" >> $GITHUB_STEP_SUMMARY - echo "### ❌ Build or Publish Failed" >> $GITHUB_STEP_SUMMARY - exit 1 - fi diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml deleted file mode 100644 index cf68b052..00000000 --- a/.github/workflows/cmake.yml +++ /dev/null @@ -1,63 +0,0 @@ -name: CMake - -on: - push: - branches: [ main ] - pull_request: - branches: [ main ] - -env: - # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) - BUILD_TYPE: Release - -jobs: - build: - # The CMake configure and build commands are platform agnostic and should work equally - # well on Windows or Mac. You can convert this to a matrix build if you need - # cross-platform coverage. - # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix - runs-on: ubuntu-22.04 - - steps: - - uses: actions/checkout@v4 - - name: Install toolchains - run: | - sudo apt-get update - sudo apt-get install -y \ - gcc \ - g++ \ - cmake \ - python3-dev - - name: Upgrade pip - run: | - python3 -m pip install --upgrade pip - - name: Install dependencies - run: | - python3 -m pip install --no-cache-dir --user numpy pybind11 - - name: Install torch - run: | - python3 -m pip install --no-cache-dir --user --default-timeout=100 --retries 5 torch==2.2.0 --index-url https://download.pytorch.org/whl/cpu - - name: Configure CMake - # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. - # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type - # Note: Skip dataset copy as datasets are now in sageData repository - run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_PREFIX_PATH=$(python3 -c "import torch; print(torch.utils.cmake_prefix_path)") -DLIBAMM_SKIP_DATASET_COPY=ON -DENABLE_UNIT_TESTS=ON - - - name: Build - # Build your program with the given configuration - run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} - env: - CC: gcc - CXX: g++ - - - name: Test - working-directory: ${{github.workspace}}/build/test - # Execute tests defined by the CMake configuration. - # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail - run: | - ./cpp_test "--success" - ./sketch_test "--success" - ./crs_test "--success" - ./weighted_cr_test "--success" - ./block_partition_test "--success" - ./streaming_test "--success"