This commit is contained in:
Junya Morioka
2025-08-13 21:02:10 +09:00
parent b5830b8b7e
commit b260b4843d
3 changed files with 23 additions and 11 deletions
+21 -10
View File
@@ -5,10 +5,7 @@ on:
jobs:
build_windows_wheels:
name: Build wheels and Upload (Windows x86_64, GitHub hosted runner)
runs-on: windows-latest
env:
MAX_JOBS: 2
NVCC_THREADS: 2
runs-on: windows-2022
strategy:
fail-fast: false
matrix:
@@ -33,23 +30,37 @@ jobs:
use-github-cache: false
use-local-cache: false
- name: Install VS2022 BuildTools
- name: Install Visual Studio BuildTools (C++/CMake + Windows SDK)
shell: pwsh
run: |
choco install -y visualstudio2022buildtools `
--version=117.14.1 `
--params "--add Microsoft.VisualStudio.Component.VC.Tools.x86.x64"
choco install -y windows-sdk-10.1 visualstudio2022-workload-vctools
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 setuptools packaging psutil ninja
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 }}"
ls
dir flash-attention\dist
$wheelName = Get-ChildItem -Path "flash-attention\dist\*.whl" | Select-Object -First 1 | ForEach-Object { $_.Name }
echo "wheel_name=$wheelName" >> $env:GITHUB_ENV
+1 -1
View File
@@ -50,5 +50,5 @@ cd flash-attention
FLASH_ATTENTION_FORCE_BUILD=TRUE python setup.py bdist_wheel --dist-dir=dist
base_wheel_name=$(basename $(ls dist/*.whl | head -n 1))
wheel_name=$(echo $base_wheel_name | sed "s/$FLASH_ATTN_VERSION/$FLASH_ATTN_VERSION+cu${MATRIX_CUDA_VERSION}torch${MATRIX_TORCH_VERSION}/")
mv dist/$base_wheel_name dist/$wheel_name
mv -v dist/$base_wheel_name dist/$wheel_name
echo "Built wheel: $wheel_name"
+1
View File
@@ -62,6 +62,7 @@ $env:BUILD_TARGET = "cuda"
if (-not $env:MAX_JOBS) { $env:MAX_JOBS = "2" }
if (-not $env:NVCC_THREADS) { $env:NVCC_THREADS = "2" }
$env:FLASH_ATTENTION_FORCE_BUILD = "TRUE"
$env:NVCC_FLAGS = "-w --disable-warnings"
cd flash-attention
python setup.py bdist_wheel --dist-dir=dist