Free | No tracking | Every fact with a source|German and English

Error / Speed

UserWarning: Torch was not compiled with flash attention – usually harmless on Windows

Your PyTorch is missing the FlashAttention variant; PyTorch automatically uses a different computation method.

The message

UserWarning: 1Torch was not compiled with flash attention. (Triggered internally at …\aten\src\ATen\native\transformers\cuda\sdp_utils.cpp:263.)

Affects: ComfyUI, AUTOMATIC1111 Stable Diffusion WebUI, Stable Diffusion WebUI Forge, TextGen (text-generation-webui), F5-TTS, Python

Why is this happening?

PyTorch knows three Attention paths: FlashAttention-2, Memory-Efficient Attention, and a general C++ variant, and it automatically chooses the best available one. The official Windows packages from PyTorch currently do not include FlashAttention-2; the issue is still unresolved in PyTorch. That is why the warning appears, but the program keeps calculating with one of the other variants.

How to fix it

  1. If the program keeps running after the warning and produces results, you can ignore it. It is a warning, not an error.
  2. Setting the environment variable USE_FLASH_ATTENTION=1 does not remove the warning. It only works if you build PyTorch yourself from source.
  3. Even a nightly version of PyTorch did not remove the warning on Windows in the reports.
  4. You only need to take action if, instead of the warning, you get RuntimeError: Torch was not compiled with flash attention. and the program aborts. In that case, the program is forcing FlashAttention only. Turn off this setting so PyTorch is allowed to fall back to the other variants.
  5. If you get the RuntimeError with an unofficial PyTorch package (for example from conda-forge), install the official package according to the guide on pytorch.org.

Better not: Do not build PyTorch yourself from source just to get rid of this warning.

Set up from scratch again

If it still doesn’t work after that, a fresh setup step by step often helps:

Terms for this

Similar errors

Sources

Checked on Oct 27, 2026. Didn't help? Ask in the forum and name the graphics card, program, and the full message.