Skip to content

fix: matrix.config

fix: matrix.config #3

Workflow file for this run

name: Wheel Build
on:
workflow_dispatch:
push:
branches:
- ci
jobs:
build-wheel:
name: Build (torch${{ matrix.config.torch_version }}+${{ matrix.config.cuda_tag }}+py${{ matrix.python-version }})
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
config:
- torch_version: "2.10.0"
cuda_version: "13.0.0"
cuda_tag: "cu130"
- torch_version: "2.9.1"
cuda_version: "13.0.0"
cuda_tag: "cu130"
- torch_version: "2.9.1"
cuda_version: "12.8.1"
cuda_tag: "cu128"
- torch_version: "2.8.0"
cuda_version: "12.9.1"
cuda_tag: "cu129"
- torch_version: "2.8.0"
cuda_version: "12.8.1"
cuda_tag: "cu128"
- torch_version: "2.7.1"
cuda_version: "12.8.1"
cuda_tag: "cu128"
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: Install CUDA ${{ matrix.config.cuda_version }}
uses: Jimver/cuda-toolkit@v0.2.30
id: cuda-toolkit
with:
cuda: "${{ matrix.config.cuda_version }}"
linux-local-args: '["--toolkit"]'
method: "network"
- name: Install PyTorch & Build Dependencies
run: |
pip install --upgrade pip
pip install setuptools==68.1.0 ninja packaging wheel
pip install torch==${{ matrix.config.torch_version }} --index-url https://download.pytorch.org/whl/${{ matrix.config.cuda_tag }}
- name: Build Wheel
env:
MAX_JOBS: 2
TORCH_CUDA_ARCH_LIST: "7.0 7.5 8.0 8.6 8.9 9.0+PTX"
run: |
export PATH=/usr/local/cuda/bin:$PATH
LOCAL_TAG="+${{ matrix.config.cuda_tag }}torch${{ matrix.config.torch_version }}"
timeout 5h python setup.py egg_info --tag-build="$LOCAL_TAG" bdist_wheel --dist-dir=dist
ls -lh dist/
- name: Upload Wheel Artifact
uses: actions/upload-artifact@v4
with:
name: lrnnx-wheel-torch${{ matrix.config.torch_version }}-${{ matrix.config.cuda_tag }}-py${{ matrix.python-version }}
path: dist/*.whl
retention-days: 7
release-wheels:
name: Upload to Existing Release
runs-on: ubuntu-22.04
needs: build-wheel
if: always()
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Download all built wheels
uses: actions/download-artifact@v4
with:
pattern: lrnnx-wheel-*
path: dist
merge-multiple: true
- name: Publish to GitHub Release 1.0.0.post1
uses: softprops/action-gh-release@v2
with:
tag_name: "v1.0.0.post1"
files: dist/*.whl