Skip to content

Commit dbd0769

Browse files
build(deps): install Triton on Windows NVIDIA installs (#9993)
1 parent a0ab6f5 commit dbd0769

6 files changed

Lines changed: 454 additions & 435 deletions

File tree

‎docs/src/content/docs/configuration/Optimization/sage-attention.mdx‎

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@ smaller (not measured).
5050
InvokeAI has measured it on an RTX 4090; the other generations use the kernels SageAttention picks for them, which
5151
InvokeAI has not validated (on RTX 30-series cards, its Triton kernel). Jetson Orin is not supported.
5252
- **SageAttention 2.2, installed separately.** InvokeAI was validated with 2.2.0. The `sageattention` package on PyPI is
53-
the older SageAttention 1 and is not used. On Windows it also needs the `triton-windows` package.
53+
the older SageAttention 1 and is not used.
54+
- **Triton**, which InvokeAI's NVIDIA install on Windows x64 and Linux includes (on Windows the `triton-windows`
55+
package). A [manual install](/start-here/manual/) on Windows without the `cuda` extra has none; see below.
5456
- Not available on AMD (ROCm), Apple Silicon (MPS), Intel (XPU) or CPU. There InvokeAI keeps PyTorch's attention.
5557

5658
## Installing
@@ -63,20 +65,21 @@ commands use [uv](https://docs.astral.sh/uv/), which InvokeAI's environment is m
6365

6466
<Steps>
6567
1. Open a terminal in your InvokeAI install directory.
66-
2. Install Triton for Windows, matching the Triton version of InvokeAI's PyTorch (Triton 3.7 for PyTorch 2.13):
67-
68-
```powershell
69-
uv pip install --python .venv\Scripts\python.exe "triton-windows>=3.7,<3.8"
70-
```
71-
72-
3. Install a SageAttention 2.2 wheel from the [SageAttention for Windows releases](https://github.com/woct0rdho/SageAttention/releases)
68+
2. Install a SageAttention 2.2 wheel from the [SageAttention for Windows releases](https://github.com/woct0rdho/SageAttention/releases)
7369
that matches InvokeAI's PyTorch (CUDA 13, PyTorch 2.10 or newer), without letting it touch PyTorch:
7470

7571
```powershell
7672
uv pip install --python .venv\Scripts\python.exe --no-deps "https://github.com/woct0rdho/SageAttention/releases/download/v2.2.0-windows.post6/sageattention-2.2.0%2Bcu130torch2.10.0andhigher.post6-cp310-abi3-win_amd64.whl"
7773
```
7874
</Steps>
7975

76+
A manual install without the `cuda` extra also needs Triton for Windows, matching the Triton version of InvokeAI's
77+
PyTorch (Triton 3.7 for PyTorch 2.13):
78+
79+
```powershell
80+
uv pip install --python .venv\Scripts\python.exe "triton-windows>=3.7,<3.8"
81+
```
82+
8083
### Linux
8184

8285
SageAttention 2 has no prebuilt wheels for Linux. Build it from source into InvokeAI's environment
@@ -86,10 +89,11 @@ with the CUDA toolkit that matches InvokeAI's PyTorch (CUDA 13) installed. Invok
8689
Linux.
8790

8891
:::caution[Keep it matched to InvokeAI's PyTorch]
89-
SageAttention is built against PyTorch, and Triton must match PyTorch's version. When an update moves InvokeAI to a new
90-
PyTorch, install the matching `triton-windows` again on Windows, and on Linux rebuild SageAttention. A wheel for a
91-
different CUDA major version, or a repair that re-creates the environment, needs a matching SageAttention too. Until
92-
then InvokeAI logs why it cannot use it and generates with PyTorch's attention.
92+
SageAttention is built against PyTorch, and Triton must match PyTorch's version. InvokeAI's NVIDIA install on Windows
93+
x64 and Linux updates Triton together with PyTorch. When an update moves InvokeAI to a new PyTorch, rebuild
94+
SageAttention on Linux; on Windows, a manual install without the `cuda` extra needs the matching `triton-windows` again.
95+
A wheel for a different CUDA major version, or a repair that re-creates the environment, needs a matching SageAttention
96+
too. Until then InvokeAI logs why it cannot use it and generates with PyTorch's attention.
9397
:::
9498

9599
## Enabling

‎docs/src/content/docs/start-here/manual.mdx‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,12 @@ The following commands vary depending on the version of Invoke being installed a
9595
View Releases
9696
</LinkButton>
9797

98-
6. Determine the package specifier to use when installing. This is a performance optimization.
98+
6. Determine the package specifier to use when installing: `invokeai`, plus any of these extras in brackets, separated by commas.
9999

100-
- If you have an Nvidia 16xx or 20xx series GPU, use `invokeai[xformers]`.
101-
- If you have an Nvidia 30xx series GPU or newer, or do not have an Nvidia GPU, use `invokeai`.
100+
- `cuda`, if you use `--torch-backend=cu130` in the next step (Nvidia GPU on Windows x64 or Linux x86_64). It installs the PyTorch build Invoke is tested with and, on Windows, Triton. Add it only for Invoke 7 or newer, and never with another torch backend: it pins PyTorch's CUDA 13 build, which no other backend provides.
101+
- `xformers`, if you have an Nvidia 16xx or 20xx series GPU. This is a performance optimization.
102+
103+
For example `invokeai[cuda]` for a 30xx series GPU or newer, `invokeai[cuda,xformers]` for a 16xx or 20xx series GPU, or `invokeai` without an Nvidia GPU.
102104

103105
7. Determine the torch backend to use for installation, if any. This is necessary to get the right version of torch installed. This is achieved by using [UV's built in torch support.](https://docs.astral.sh/uv/guides/integration/pytorch/#automatic-backend-selection)
104106

@@ -199,7 +201,7 @@ The following commands vary depending on the version of Invoke being installed a
199201
</TabItem>
200202
<TabItem label="With torch backend">
201203
```sh
202-
uv pip install <PACKAGE_SPECIFIER>==<VERSION> --python 3.12 --python-preference only-managed --torch-backend=<VERSION> --force-reinstall
204+
uv pip install "<PACKAGE_SPECIFIER>==<VERSION>" --python 3.12 --python-preference only-managed --torch-backend=<VERSION> --force-reinstall
203205
```
204206
</TabItem>
205207
<TabItem label="Windows on ARM64">

‎docs/src/content/docs/start-here/system-requirements.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Hardware requirements vary significantly depending on model and image output siz
1616
The requirements below are rough guidelines for best performance. GPUs with less VRAM typically still work, if a bit slower. Follow the [Low VRAM Guide] to optimize performance.
1717

1818
- All Apple Silicon (M1, M2, etc) Macs work, but 16GB+ memory is recommended.
19-
- Nvidia GPUs need compute capability 7.5 or newer (GTX 16xx, RTX 20xx and everything after) and a driver from the R580 series or newer. Maxwell, Pascal and Volta cards (GTX 9xx/10xx, Titan V, Tesla P40/P100/V100) are not supported by Invoke's CUDA build: stay on the previous Invoke release, or do a [manual install](../manual) with `--torch-backend=cu126`, whose PyTorch build still includes these GPUs (not tested by the Invoke team). With a driver that is too old, Invoke starts on the CPU and logs an error saying so; on an unsupported GPU it logs an error at startup and generation fails.
19+
- Nvidia GPUs need compute capability 7.5 or newer (GTX 16xx, RTX 20xx and everything after) and a driver from the R580 series or newer. Maxwell, Pascal and Volta cards (GTX 9xx/10xx, Titan V, Tesla P40/P100/V100) are not supported by Invoke's CUDA build: stay on the previous Invoke release, or do a [manual install](../manual) with `--torch-backend=cu126` and without the `cuda` extra, whose PyTorch build still includes these GPUs (not tested by the Invoke team). With a driver that is too old, Invoke starts on the CPU and logs an error saying so; on an unsupported GPU it logs an error at startup and generation fails.
2020
- AMD GPUs are supported on Windows and Linux `x86_64` through ROCm 10 (see [AMD](#amd) below for the GPUs and drivers). On Linux, Vega-based cards (gfx900/gfx906) are no longer supported. The VRAM requirements are the same as Nvidia GPUs.
2121
- Intel Arc GPUs (Alchemist, Battlemage and newer) are supported on Windows and Linux `x86_64`. The VRAM requirements are the same as Nvidia GPUs.
2222
- Linux ARM64 (`aarch64`) devices — e.g. Raspberry Pi 5, other SBCs, ARM servers — are supported in CPU-only mode. Local generation is slow without a GPU, but API-backed models (e.g. GPT Image, Gemini) work well.

‎docs/src/content/docs/troubleshooting/faq.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ Once v7 has run on an install, it has updated the database, and older versions c
4848

4949
## Triton error on startup
5050

51-
This can be safely ignored. Invoke only uses Triton for [SageAttention](/configuration/optimization/sage-attention/), which is off unless you enable it. If you are on Linux and wish to dismiss the error, you can install Triton.
51+
Invoke only uses Triton for [SageAttention](/configuration/optimization/sage-attention/), which is off unless you enable it. Installs without Triton can ignore the error: CPU, macOS, AMD on Windows, Windows on ARM64, and a manual Windows install without the `cuda` extra (`--torch-backend=cu126` installs included). Other NVIDIA installs include Triton (on Windows the `triton-windows` package), so there the error means Triton is broken or does not match PyTorch; repair the install from the launcher, or rerun the manual install command.
5252

5353
## No ffmpeg exe could be found (Windows on ARM64)
5454

‎pyproject.toml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,9 @@ dependencies = [
181181
"cuda" = [
182182
"torch==2.13.0+cu130; (sys_platform == 'linux' and platform_machine == 'x86_64') or (sys_platform == 'win32' and platform_machine != 'ARM64')",
183183
"torchvision==0.28.0+cu130; (sys_platform == 'linux' and platform_machine == 'x86_64') or (sys_platform == 'win32' and platform_machine != 'ARM64')",
184+
# The Linux torch wheel requires triton; the Windows wheel requires none. triton-windows is the Windows build
185+
# (no win_arm64 wheel); its minor version must match the Triton that torch 2.13 is built against.
186+
"triton-windows>=3.7,<3.8; sys_platform == 'win32' and platform_machine != 'ARM64'",
184187
# macOS / linux_aarch64 fallback, see note under "cpu"
185188
"torch==2.7.1; sys_platform == 'darwin' or (sys_platform == 'linux' and platform_machine == 'aarch64')",
186189
"torchvision==0.22.1; sys_platform == 'darwin' or (sys_platform == 'linux' and platform_machine == 'aarch64')",

0 commit comments

Comments
 (0)