mirror of
https://github.com/BillyOutlast/flash-attention-prebuild-wheels-rocm.git
synced 2026-07-01 01:27:54 -04:00
7101956b00
- Fix wheel path issue caused by build_windows.ps1 changing to flash-attention directory (was causing double path like flash-attention/flash-attention/dist) - Add working-directory to Install Test and Upload steps for explicit directory control - Add log grouping (::group::) in build_windows.ps1 for collapsible logs in GitHub Actions - Suppress verbose output with pip -q, git clone -q, and NINJA_STATUS=""
74 lines
2.4 KiB
YAML
74 lines
2.4 KiB
YAML
name: "Test Windows build"
|
|
on:
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build_windows_wheels:
|
|
name: Build wheels and Upload (Windows x86_64, GitHub hosted runner)
|
|
runs-on: windows-2022
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
flash-attn-version: ["2.6.3"]
|
|
python-version: ["3.11"]
|
|
torch-version: ["2.7.1"]
|
|
cuda-version: ["12.4.1"]
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Enable Git long paths
|
|
shell: pwsh
|
|
run: git config --system core.longpaths true
|
|
|
|
- uses: actions/setup-python@v5
|
|
with:
|
|
python-version: ${{ matrix.python-version }}
|
|
|
|
- uses: Jimver/cuda-toolkit@v0.2.24
|
|
with:
|
|
cuda: ${{ matrix.cuda-version }}
|
|
method: "network"
|
|
use-github-cache: false
|
|
use-local-cache: false
|
|
|
|
- name: Install Visual Studio BuildTools (C++/CMake + Windows SDK)
|
|
shell: pwsh
|
|
run: |
|
|
choco upgrade -y visualstudio2022buildtools `
|
|
--params "--add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 `
|
|
--add Microsoft.VisualStudio.Component.VC.CMake.Project `
|
|
--add Microsoft.VisualStudio.Component.Windows11SDK.22621 `
|
|
--includeRecommended --includeOptional"
|
|
|
|
- name: Setup MSVC Developer Command Prompt
|
|
uses: TheMrMilchmann/setup-msvc-dev@v3
|
|
with:
|
|
arch: x64
|
|
|
|
- name: Add msbuild to PATH
|
|
uses: microsoft/setup-msbuild@v2
|
|
|
|
- name: Install build dependencies
|
|
shell: pwsh
|
|
run: |
|
|
pip install -U pip setuptools==75.8.0 wheel packaging psutil ninja
|
|
|
|
- name: Build wheels
|
|
shell: pwsh
|
|
env:
|
|
MAX_JOBS: 2
|
|
NVCC_THREADS: 2
|
|
run: |
|
|
.\build_windows.ps1 -FlashAttnVersion "${{ matrix.flash-attn-version }}" -PythonVersion "${{ matrix.python-version }}" -TorchVersion "${{ matrix.torch-version }}" -CudaVersion "${{ matrix.cuda-version }}"
|
|
# Script changes to flash-attention directory, wheel is in dist/
|
|
ls
|
|
dir dist
|
|
$wheelName = Get-ChildItem -Path "dist\*.whl" | Select-Object -First 1 | ForEach-Object { $_.Name }
|
|
echo "wheel_name=$wheelName" >> $env:GITHUB_ENV
|
|
|
|
- name: Install Test
|
|
shell: pwsh
|
|
working-directory: flash-attention
|
|
run: |
|
|
pip install dist/$env:wheel_name
|
|
python -c "import flash_attn; print(flash_attn.__version__)"
|