| |
| |
| |
| |
| |
| |
|
|
| name: Build wheels and deploy |
|
|
| on: |
| create: |
| tags: |
| - v* |
|
|
| jobs: |
| setup_release: |
| name: Create Release |
| runs-on: ubuntu-latest |
| outputs: |
| release-version: ${{ steps.extract_branch.outputs.branch }} |
| steps: |
| - name: Get the tag version |
| id: extract_branch |
| run: echo ::set-output name=branch::${GITHUB_REF#refs/tags/} |
| shell: bash |
| - name: Create Release |
| id: create_release |
| uses: actions/create-release@v1 |
| env: |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| with: |
| tag_name: ${{ steps.extract_branch.outputs.branch }} |
| release_name: ${{ steps.extract_branch.outputs.branch }} |
|
|
| build_wheels: |
| name: Build Wheel |
| needs: setup_release |
| strategy: |
| fail-fast: false |
| matrix: |
| |
| |
| os: [ubuntu-22.04] |
| python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] |
| torch-version: ["2.4.0", "2.5.1", "2.6.0", "2.7.1", "2.8.0"] |
| cuda-version: ["12.9.1"] |
| |
| |
| |
| |
| cxx11_abi: ["FALSE", "TRUE"] |
| exclude: |
| |
| |
| - torch-version: "2.4.0" |
| python-version: "3.13" |
| uses: ./.github/workflows/_build.yml |
| with: |
| runs-on: ${{ matrix.os }} |
| python-version: ${{ matrix.python-version }} |
| cuda-version: ${{ matrix.cuda-version }} |
| torch-version: ${{ matrix.torch-version }} |
| cxx11_abi: ${{ matrix.cxx11_abi }} |
| release-version: ${{ needs.setup_release.outputs.release-version }} |
| upload-to-release: true |
|
|
| publish_package: |
| name: Publish package |
| needs: [build_wheels] |
| runs-on: ubuntu-latest |
| steps: |
| - uses: actions/checkout@v4 |
| - uses: actions/setup-python@v5 |
| with: |
| python-version: "3.10" |
| - name: Install dependencies |
| run: | |
| pip install ninja packaging wheel twine |
| # Install latest setuptools with support for pypi metadata 2.2 (improved compat w/ uv) |
| pip install setuptools==75.8.0 |
| # We don't want to download anything CUDA-related here |
| pip install torch --index-url https://download.pytorch.org/whl/cpu |
| - name: Build core package |
| env: |
| FLASH_ATTENTION_SKIP_CUDA_BUILD: "TRUE" |
| run: | |
| python setup.py sdist --dist-dir=dist |
| - name: Deploy |
| env: |
| TWINE_USERNAME: "__token__" |
| TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} |
| run: | |
| python -m twine upload dist/* |
| |