mirror of
https://github.com/BillyOutlast/flash-attention-prebuild-wheels-rocm.git
synced 2026-07-01 01:27:54 -04:00
192 lines
7.3 KiB
YAML
192 lines
7.3 KiB
YAML
name: Build wheels and upload to GitHub Releases
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- "v*"
|
|
|
|
jobs:
|
|
create_releases:
|
|
name: Create Releases
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Create Release
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
run: |
|
|
gh release create "${{ github.ref_name }}" \
|
|
--title "${{ github.ref_name }}" \
|
|
--notes "TBD"
|
|
|
|
create_matrix:
|
|
name: Create Matrix
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
matrix: ${{ steps.create_matrix.outputs.matrix }}
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Create Matrix
|
|
id: create_matrix
|
|
run: |
|
|
python create_matrix.py | tee /tmp/matrix.json
|
|
echo "matrix=$(cat /tmp/matrix.json)" >> $GITHUB_OUTPUT
|
|
|
|
# #########################################################
|
|
# Linux
|
|
# #########################################################
|
|
build_wheels_linux:
|
|
name: Build Linux
|
|
needs: [create_releases, create_matrix]
|
|
if: ${{ fromjson(needs.create_matrix.outputs.matrix).linux }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
flash-attn-version: ${{ fromjson(needs.create_matrix.outputs.matrix).linux.flash-attn-version }}
|
|
python-version: ${{ fromjson(needs.create_matrix.outputs.matrix).linux.python-version }}
|
|
torch-version: ${{ fromjson(needs.create_matrix.outputs.matrix).linux.torch-version }}
|
|
cuda-version: ${{ fromjson(needs.create_matrix.outputs.matrix).linux.cuda-version }}
|
|
exclude: ${{ fromjson(needs.create_matrix.outputs.matrix).exclude }}
|
|
uses: ./.github/workflows/_build_linux.yml
|
|
with:
|
|
flash-attn-version: ${{ matrix.flash-attn-version }}
|
|
python-version: ${{ matrix.python-version }}
|
|
torch-version: ${{ matrix.torch-version }}
|
|
cuda-version: ${{ matrix.cuda-version }}
|
|
secrets: inherit
|
|
|
|
build_wheels_linux_self_hosted:
|
|
name: Build Linux (self-hosted)
|
|
needs: [create_releases, create_matrix]
|
|
if: ${{ fromjson(needs.create_matrix.outputs.matrix).linux_self_hosted }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
flash-attn-version: ${{ fromjson(needs.create_matrix.outputs.matrix).linux_self_hosted.flash-attn-version }}
|
|
python-version: ${{ fromjson(needs.create_matrix.outputs.matrix).linux_self_hosted.python-version }}
|
|
torch-version: ${{ fromjson(needs.create_matrix.outputs.matrix).linux_self_hosted.torch-version }}
|
|
cuda-version: ${{ fromjson(needs.create_matrix.outputs.matrix).linux_self_hosted.cuda-version }}
|
|
exclude: ${{ fromjson(needs.create_matrix.outputs.matrix).exclude }}
|
|
uses: ./.github/workflows/_build_linux_self_host.yml
|
|
with:
|
|
flash-attn-version: ${{ matrix.flash-attn-version }}
|
|
python-version: ${{ matrix.python-version }}
|
|
torch-version: ${{ matrix.torch-version }}
|
|
cuda-version: ${{ matrix.cuda-version }}
|
|
secrets: inherit
|
|
|
|
# #########################################################
|
|
# Windows
|
|
# #########################################################
|
|
build_wheels_windows:
|
|
name: Build Windows
|
|
needs: [create_releases, create_matrix]
|
|
if: ${{ fromjson(needs.create_matrix.outputs.matrix).windows }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
flash-attn-version: ${{ fromjson(needs.create_matrix.outputs.matrix).windows.flash-attn-version }}
|
|
python-version: ${{ fromjson(needs.create_matrix.outputs.matrix).windows.python-version }}
|
|
torch-version: ${{ fromjson(needs.create_matrix.outputs.matrix).windows.torch-version }}
|
|
cuda-version: ${{ fromjson(needs.create_matrix.outputs.matrix).windows.cuda-version }}
|
|
exclude: ${{ fromjson(needs.create_matrix.outputs.matrix).exclude }}
|
|
uses: ./.github/workflows/_build_windows.yml
|
|
with:
|
|
flash-attn-version: ${{ matrix.flash-attn-version }}
|
|
python-version: ${{ matrix.python-version }}
|
|
torch-version: ${{ matrix.torch-version }}
|
|
cuda-version: ${{ matrix.cuda-version }}
|
|
secrets: inherit
|
|
|
|
build_wheels_windows_code_build:
|
|
name: Build Windows (AWS CodeBuild)
|
|
needs: [create_releases, create_matrix]
|
|
if: ${{ fromjson(needs.create_matrix.outputs.matrix).windows_code_build }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
flash-attn-version: ${{ fromjson(needs.create_matrix.outputs.matrix).windows_code_build.flash-attn-version }}
|
|
python-version: ${{ fromjson(needs.create_matrix.outputs.matrix).windows_code_build.python-version }}
|
|
torch-version: ${{ fromjson(needs.create_matrix.outputs.matrix).windows_code_build.torch-version }}
|
|
cuda-version: ${{ fromjson(needs.create_matrix.outputs.matrix).windows_code_build.cuda-version }}
|
|
exclude: ${{ fromjson(needs.create_matrix.outputs.matrix).exclude }}
|
|
uses: ./.github/workflows/_build_windows_code_build.yml
|
|
with:
|
|
flash-attn-version: ${{ matrix.flash-attn-version }}
|
|
python-version: ${{ matrix.python-version }}
|
|
torch-version: ${{ matrix.torch-version }}
|
|
cuda-version: ${{ matrix.cuda-version }}
|
|
secrets: inherit
|
|
|
|
update_release_notes:
|
|
name: Update Release Notes
|
|
needs:
|
|
- build_wheels_linux
|
|
- build_wheels_linux_self_hosted
|
|
- build_wheels_windows
|
|
- build_wheels_windows_code_build
|
|
if: always()
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: actions/setup-python@v5
|
|
with:
|
|
python-version: 3.12
|
|
|
|
- name: Install dependencies
|
|
run: pip install pandas
|
|
|
|
- name: Generate Release Notes
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
run: |
|
|
gh release view "${{ github.ref_name }}" --json assets > /tmp/assets.json
|
|
python create_release_note.py /tmp/assets.json > /tmp/release_notes.md
|
|
gh release edit "${{ github.ref_name }}" --notes-file /tmp/release_notes.md
|
|
|
|
update_docs:
|
|
name: Update Docs
|
|
needs:
|
|
- build_wheels_linux
|
|
- build_wheels_linux_self_hosted
|
|
- build_wheels_windows
|
|
- build_wheels_windows_code_build
|
|
permissions:
|
|
contents: write
|
|
if: always()
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: actions/setup-python@v5
|
|
with:
|
|
python-version: 3.12
|
|
|
|
- name: Install dependencies
|
|
run: pip install pandas
|
|
|
|
- name: Update docs
|
|
run: |
|
|
gh release view "${{ github.ref_name }}" --json assets > /tmp/assets.json
|
|
python create_release_history.py \
|
|
--assets /tmp/assets.json \
|
|
--tag "${{ github.ref_name }}" \
|
|
--repo "${{ github.repository }}" \
|
|
--output docs/release_history.md
|
|
python create_packages.py --assets /tmp/assets.json --output docs/packages.md
|
|
|
|
- name: Commit and push docs updates
|
|
run: |
|
|
git config --global user.name "github-actions[bot]"
|
|
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
|
if git diff --quiet; then
|
|
echo "No docs updates to commit."
|
|
exit 0
|
|
fi
|
|
git commit -am "docs: update docs for ${{ github.ref_name }}"
|
|
git push origin HEAD:"${DEFAULT_BRANCH}"
|