mirror of
https://github.com/BillyOutlast/flash-attention-prebuild-wheels-rocm.git
synced 2026-07-01 01:37:53 -04:00
feat: add dynamic matrix
This commit is contained in:
@@ -0,0 +1,77 @@
|
||||
name: Test dynamic matrix
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
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: |
|
||||
echo "matrix=$(python create_matrix.py)" >> $GITHUB_OUTPUT
|
||||
|
||||
# #########################################################
|
||||
# Linux
|
||||
# #########################################################
|
||||
build_wheels_linux:
|
||||
name: Build Linux
|
||||
runs-on: ubuntu-latest
|
||||
needs: [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 }}
|
||||
steps:
|
||||
- name: Test Linux
|
||||
run: |
|
||||
echo "Flash Attn Version: ${{ matrix.flash-attn-version }}"
|
||||
echo "Python Version: ${{ matrix.python-version }}"
|
||||
echo "Torch Version: ${{ matrix.torch-version }}"
|
||||
echo "CUDA Version: ${{ matrix.cuda-version }}"
|
||||
|
||||
build_wheels_linux_self_hosted:
|
||||
name: Build Linux (self-hosted)
|
||||
needs: [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
|
||||
|
||||
update_release_notes:
|
||||
name: Update Release Notes
|
||||
needs:
|
||||
- build_wheels_linux
|
||||
- build_wheels_linux_self_hosted
|
||||
permissions:
|
||||
contents: write
|
||||
if: always()
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: 3.12
|
||||
@@ -0,0 +1,75 @@
|
||||
import json
|
||||
|
||||
EXCLUDE = [
|
||||
# torch < 2.2 does not support Python 3.12
|
||||
{"python-version": "3.12", "torch-version": "2.0.1"},
|
||||
{"python-version": "3.12", "torch-version": "2.1.2"},
|
||||
# torch 2.0.1 does not support CUDA 12.x
|
||||
{"torch-version": "2.0.1", "cuda-version": "12.1.1"},
|
||||
{"torch-version": "2.0.1", "cuda-version": "12.4.1"},
|
||||
{"torch-version": "2.0.1", "cuda-version": "12.6.3"},
|
||||
{"torch-version": "2.0.1", "cuda-version": "12.8.1"},
|
||||
# torch 2.6.0 does not support CUDA 12.1
|
||||
{"torch-version": "2.6.0", "cuda-version": "12.1.1"},
|
||||
# torch 2.7.0 does not support CUDA 12.4
|
||||
{"torch-version": "2.7.0", "cuda-version": "12.4.1"},
|
||||
# torch < 2.8 does not support CUDA 12.9
|
||||
{"torch-version": "2.5.1", "cuda-version": "12.9.1"},
|
||||
{"torch-version": "2.6.3", "cuda-version": "12.9.1"},
|
||||
{"torch-version": "2.7.1", "cuda-version": "12.9.1"},
|
||||
# torch >= 2.9 does not support Python 3.9
|
||||
{"torch-version": "2.9.0", "python-version": "3.9"},
|
||||
]
|
||||
|
||||
LINUX_MATRIX = {
|
||||
"flash-attn-version": ["2.6.3", "2.7.4.post1", "2.8.3"],
|
||||
"python-version": ["3.10", "3.11", "3.12", "3.13"],
|
||||
"torch-version": [
|
||||
# "2.5.1", "2.6.0", "2.7.1", "2.8.0",
|
||||
"2.9.0",
|
||||
],
|
||||
"cuda-version": [
|
||||
# "12.4.1", "12.6.3", "12.8.1", "12.9.1",
|
||||
"13.0.1",
|
||||
],
|
||||
}
|
||||
|
||||
LINUX_SELF_HOSTED_MATRIX = {
|
||||
"flash-attn-version": ["2.7.4.post1", "2.8.3"],
|
||||
"python-version": ["3.10", "3.11", "3.12", "3.13"],
|
||||
"torch-version": ["2.9.0"],
|
||||
"cuda-version": ["13.0.1"],
|
||||
}
|
||||
|
||||
WINDOWS_MATRIX = {
|
||||
"flash-attn-version": ["2.6.3", "2.7.4.post1", "2.8.3"],
|
||||
"python-version": ["3.10", "3.11", "3.12", "3.13"],
|
||||
"torch-version": ["2.9.0"],
|
||||
"cuda-version": ["13.0.1"],
|
||||
}
|
||||
|
||||
WINDOWS_CODEBUILD_MATRIX = {
|
||||
"flash-attn-version": ["2.6.3", "2.7.4.post1", "2.8.3"],
|
||||
"python-version": ["3.10", "3.11", "3.12", "3.13"],
|
||||
"torch-version": ["2.9.0"],
|
||||
"cuda-version": ["13.0.1"],
|
||||
}
|
||||
|
||||
|
||||
def main():
|
||||
json.dump(
|
||||
{
|
||||
"linux": LINUX_MATRIX,
|
||||
# "linux_self_hosted": LINUX_SELF_HOSTED_MATRIX,
|
||||
"linux_self_hosted": False,
|
||||
# "windows": WINDOWS_MATRIX,
|
||||
"windows": False,
|
||||
# "windows_code_build": WINDOWS_CODEBUILD_MATRIX,
|
||||
"windows_code_build": False,
|
||||
"exclude": EXCLUDE,
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user