Upload install_sageattn2.bat
Browse files
runscripts/install_sageattn2.bat
CHANGED
|
@@ -1,15 +1,58 @@
|
|
| 1 |
@ECHO OFF
|
| 2 |
CALL environment.bat passive
|
|
|
|
| 3 |
ECHO # SageAttention2 install script
|
| 4 |
ECHO.
|
| 5 |
ECHO This will install Triton and SageAttention 2.2.0 into the Python environment.
|
| 6 |
ECHO An Internet connection is required to download the necessary components.
|
| 7 |
PAUSE
|
| 8 |
|
|
|
|
|
|
|
| 9 |
set PYTHONUTF8=1
|
| 10 |
set PYTHONIOENCODING=utf-8
|
| 11 |
set PYTHON=python_embeded\python.exe
|
| 12 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
ECHO.
|
| 14 |
ECHO ### Installing Visual Studio Build Tools.
|
| 15 |
ECHO If you already have a compatible version, the update will read "Installer failed with exit code: 1". This is normal!
|
|
@@ -20,15 +63,25 @@ ECHO.
|
|
| 20 |
ECHO ### Installing Triton
|
| 21 |
ECHO =====================
|
| 22 |
%PYTHON% -s -m pip install triton-windows
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
|
| 24 |
ECHO.
|
| 25 |
ECHO ### Installing SageAttention
|
| 26 |
-
ECHO ============================
|
| 27 |
-
%PYTHON% -s -m pip install
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
|
| 29 |
ECHO Runnning test script ...
|
| 30 |
ECHO.
|
| 31 |
-
%PYTHON% .\
|
| 32 |
|
| 33 |
ECHO.
|
| 34 |
ECHO Installation complete ...
|
|
|
|
| 1 |
@ECHO OFF
|
| 2 |
CALL environment.bat passive
|
| 3 |
+
|
| 4 |
ECHO # SageAttention2 install script
|
| 5 |
ECHO.
|
| 6 |
ECHO This will install Triton and SageAttention 2.2.0 into the Python environment.
|
| 7 |
ECHO An Internet connection is required to download the necessary components.
|
| 8 |
PAUSE
|
| 9 |
|
| 10 |
+
set SAGEATTN_CU128_WHL=https://github.com/woct0rdho/SageAttention/releases/download/v2.2.0-windows.post4/sageattention-2.2.0+cu128torch2.9.0andhigher.post4-cp39-abi3-win_amd64.whl
|
| 11 |
+
set SAGEATTN_CU130_WHL=https://github.com/woct0rdho/SageAttention/releases/download/v2.2.0-windows.post4/sageattention-2.2.0+cu130torch2.9.0andhigher.post4-cp39-abi3-win_amd64.whl
|
| 12 |
set PYTHONUTF8=1
|
| 13 |
set PYTHONIOENCODING=utf-8
|
| 14 |
set PYTHON=python_embeded\python.exe
|
| 15 |
|
| 16 |
+
for /f "tokens=1,2" %%A in ('%PYTHON% -s -m pip list') do (
|
| 17 |
+
if "%%A"=="torch" (
|
| 18 |
+
set TORCH_VERSION=%%B
|
| 19 |
+
)
|
| 20 |
+
)
|
| 21 |
+
|
| 22 |
+
if not defined TORCH_VERSION (
|
| 23 |
+
ECHO ERROR: PyTorch is not installed in this Python environment.
|
| 24 |
+
ECHO Aborting.
|
| 25 |
+
PAUSE
|
| 26 |
+
EXIT /B 1
|
| 27 |
+
)
|
| 28 |
+
|
| 29 |
+
echo %TORCH_VERSION% | findstr /i "+cu128" >nul
|
| 30 |
+
if %errorlevel%==0 (
|
| 31 |
+
set TORCH_CUDA=cu128
|
| 32 |
+
set SAGEATTN_WHL=%SAGEATTN_CU128_WHL%
|
| 33 |
+
goto :cuda_ok
|
| 34 |
+
)
|
| 35 |
+
|
| 36 |
+
echo %TORCH_VERSION% | findstr /i "+cu130" >nul
|
| 37 |
+
if %errorlevel%==0 (
|
| 38 |
+
set TORCH_CUDA=cu130
|
| 39 |
+
set SAGEATTN_WHL=%SAGEATTN_CU130_WHL%
|
| 40 |
+
goto :cuda_ok
|
| 41 |
+
)
|
| 42 |
+
|
| 43 |
+
ECHO.
|
| 44 |
+
ECHO ERROR: Unsupported CUDA build detected.
|
| 45 |
+
ECHO Torch reports: %TORCH_VERSION%
|
| 46 |
+
ECHO Supported builds: cu128 or cu130 only.
|
| 47 |
+
ECHO Aborting before installation.
|
| 48 |
+
PAUSE
|
| 49 |
+
EXIT /B 1
|
| 50 |
+
|
| 51 |
+
:cuda_ok
|
| 52 |
+
ECHO.
|
| 53 |
+
ECHO CUDA build detected: %TORCH_CUDA%
|
| 54 |
+
ECHO Using SageAttention package: %SAGEATTN_WHL%
|
| 55 |
+
|
| 56 |
ECHO.
|
| 57 |
ECHO ### Installing Visual Studio Build Tools.
|
| 58 |
ECHO If you already have a compatible version, the update will read "Installer failed with exit code: 1". This is normal!
|
|
|
|
| 63 |
ECHO ### Installing Triton
|
| 64 |
ECHO =====================
|
| 65 |
%PYTHON% -s -m pip install triton-windows
|
| 66 |
+
if errorlevel 1 (
|
| 67 |
+
ECHO ERROR: Triton installation failed.
|
| 68 |
+
PAUSE
|
| 69 |
+
EXIT /B 1
|
| 70 |
+
)
|
| 71 |
|
| 72 |
ECHO.
|
| 73 |
ECHO ### Installing SageAttention
|
| 74 |
+
ECHO ============================
|
| 75 |
+
%PYTHON% -s -m pip install %SAGEATTN_WHL%
|
| 76 |
+
if errorlevel 1 (
|
| 77 |
+
ECHO ERROR: SageAttention installation failed.
|
| 78 |
+
PAUSE
|
| 79 |
+
EXIT /B 1
|
| 80 |
+
)
|
| 81 |
|
| 82 |
ECHO Runnning test script ...
|
| 83 |
ECHO.
|
| 84 |
+
%PYTHON% .\python_embeded\test_sageattn.py
|
| 85 |
|
| 86 |
ECHO.
|
| 87 |
ECHO Installation complete ...
|