mirror of
https://github.com/BillyOutlast/flash-attention-prebuild-wheels-rocm.git
synced 2026-06-30 23:57:53 -04:00
fix: improve Windows self-hosted runner workflow and update docs
- Add pwsh and vswhere to prerequisites list - Increase timeout to 2160 minutes for long builds - Improve CUDA cleanup using proper Windows uninstaller - Update README platform table and manylinux compatibility note
This commit is contained in:
@@ -2,12 +2,14 @@
|
||||
# Test build wheels with self-hosted runner on Windows x86_64
|
||||
#
|
||||
# Prerequisites (must be pre-installed on the runner):
|
||||
# - pwsh
|
||||
# - Git
|
||||
# - Chocolatey
|
||||
# - Visual Studio BuildTools 2022 with:
|
||||
# - Microsoft.VisualStudio.Component.VC.Tools.x86.x64
|
||||
# - Microsoft.VisualStudio.Component.VC.CMake.Project
|
||||
# - Microsoft.VisualStudio.Component.Windows11SDK.22621
|
||||
# - vswhere
|
||||
# - CMake
|
||||
# - Ninja
|
||||
# - Make (optional)
|
||||
@@ -43,7 +45,7 @@ jobs:
|
||||
build_windows_wheels_self_hosted:
|
||||
name: Build wheels and Test (Windows x86_64, self-hosted runner)
|
||||
runs-on: ["self-hosted", "windows", "x64"]
|
||||
timeout-minutes: 360
|
||||
timeout-minutes: 2160
|
||||
env:
|
||||
MAX_JOBS: 2
|
||||
NVCC_THREADS: 2
|
||||
@@ -81,6 +83,7 @@ jobs:
|
||||
|
||||
- name: Build wheels
|
||||
shell: pwsh
|
||||
timeout-minutes: 2160
|
||||
run: |
|
||||
.\build_windows.ps1 -FlashAttnVersion "${{ inputs.flash-attn-version }}" -PythonVersion "${{ inputs.python-version }}" -TorchVersion "${{ inputs.torch-version }}" -CudaVersion "${{ inputs.cuda-version }}"
|
||||
$wheelName = Get-ChildItem -Path "flash-attention\dist\*.whl" | Select-Object -First 1 | ForEach-Object { $_.Name }
|
||||
@@ -138,16 +141,37 @@ jobs:
|
||||
Write-Host "[4/6] uv cache not found, skipping"
|
||||
}
|
||||
|
||||
# 5. Remove CUDA installation
|
||||
$cudaBaseDir = "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA"
|
||||
if (Test-Path $cudaBaseDir) {
|
||||
Write-Host "[5/6] Removing CUDA installations: $cudaBaseDir"
|
||||
Get-ChildItem -Path $cudaBaseDir -Directory -ErrorAction SilentlyContinue | ForEach-Object {
|
||||
Write-Host " Removing: $($_.FullName)"
|
||||
Remove-Item -Path $_.FullName -Recurse -Force -ErrorAction SilentlyContinue
|
||||
# 5. Uninstall CUDA using proper Windows uninstaller
|
||||
Write-Host "[5/6] Uninstalling CUDA packages..."
|
||||
$cudaPackages = Get-Package -Name "*CUDA*" -ErrorAction SilentlyContinue
|
||||
if ($cudaPackages) {
|
||||
foreach ($package in $cudaPackages) {
|
||||
Write-Host " Uninstalling: $($package.Name)"
|
||||
try {
|
||||
$package | Uninstall-Package -Force -ErrorAction SilentlyContinue
|
||||
} catch {
|
||||
Write-Host " Warning: Could not uninstall via Package Manager, trying alternative method..."
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Write-Host "[5/6] CUDA directory not found, skipping"
|
||||
Write-Host " No CUDA packages found in Package Manager"
|
||||
}
|
||||
|
||||
# Also try NVIDIA uninstaller if exists
|
||||
$cudaBaseDir = "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA"
|
||||
if (Test-Path $cudaBaseDir) {
|
||||
Get-ChildItem -Path $cudaBaseDir -Directory -ErrorAction SilentlyContinue | ForEach-Object {
|
||||
$uninstaller = Join-Path $_.FullName "Uninstall.exe"
|
||||
if (Test-Path $uninstaller) {
|
||||
Write-Host " Running CUDA uninstaller: $uninstaller"
|
||||
Start-Process -FilePath $uninstaller -ArgumentList "/S" -Wait -ErrorAction SilentlyContinue
|
||||
}
|
||||
}
|
||||
# Remove remaining directory if exists
|
||||
if (Test-Path $cudaBaseDir) {
|
||||
Write-Host " Removing remaining CUDA directory: $cudaBaseDir"
|
||||
Remove-Item -Path $cudaBaseDir -Recurse -Force -ErrorAction SilentlyContinue
|
||||
}
|
||||
}
|
||||
|
||||
# 6. Remove temp files
|
||||
|
||||
@@ -45,6 +45,7 @@ pip install ./flash_attn-2.6.3+cu124torch2.5-cp312-cp312-linux_x86_64.whl
|
||||
|
||||
> [!NOTE]
|
||||
> Since v0.7.0, wheels are built with manylinux2_28 platform.
|
||||
> These wheels compatible with old glibc versions (<=2.17).
|
||||
|
||||
> [!NOTE]
|
||||
> Since v0.5.0, wheels are built with a local version label indicating the CUDA and PyTorch versions.
|
||||
@@ -227,10 +228,10 @@ docker compose up -d runner-arm
|
||||
|
||||
This repository builds wheels across multiple platforms and environments:
|
||||
|
||||
| Platform | Runner Type | Container Image |
|
||||
| ------------------ | ------------------------------ | ------------------------------------------ |
|
||||
| **Linux x86_64** | GitHub-hosted (`ubuntu-22.04`) | - |
|
||||
| **Linux x86_64** | Self-hosted | `ubuntu:22.04` or `manylinux_2_28_x86_64` |
|
||||
| **Linux ARM64** | Self-hosted (`linux/arm64`) | `ubuntu:22.04` or `manylinux_2_28_aarch64` |
|
||||
| **Windows x86_64** | GitHub-hosted (`windows-2022`) | - |
|
||||
| **Windows x86_64** | AWS CodeBuild | - |
|
||||
| Platform | Runner Type | Container Image |
|
||||
| ------------------ | ---------------------------------- | ----------------------------------------- |
|
||||
| **Linux x86_64** | GitHub-hosted (`ubuntu-22.04`) | - |
|
||||
| **Linux x86_64** | Self-hosted | `ubuntu:22.04` or `manylinux_2_28_x86_64` |
|
||||
| **Linux ARM64** | GitHub-hosted (`ubuntu-22.04-arm`) | - |
|
||||
| **Windows x86_64** | GitHub-hosted (`windows-2022`) | - |
|
||||
| **Windows x86_64** | AWS CodeBuild | - |
|
||||
|
||||
Reference in New Issue
Block a user