[Windows · RTX-5090] SageAttention3 fails to compile — hard-coded C++17 flags + missing typename in kernel_traits.h

#7
by mzry0000 - opened

Current status – build still fails (tested with both C++17 and C++20)

Environment
• Windows 11
• Python 3.13.5
• Visual Studio 2022 Build Tools 17.10 (MSVC 19.40.33813)
• CUDA 12.8
• PyTorch 2.8.0 + cu128
• RTX-5090 (Blackwell sm_120)

What I tried and what happened

Default pip install -e .
→ Build stops in CUTLASS with
cutlass::platform::is_unsigned_v not found.
(Cause: the project is compiled with /std:c++17, which is too low.)

Explicitly forced /std:c++17 again (env vars)
→ Same error. Confirms C++17 cannot compile current code.

Switched to /std:c++20 and set DISTUTILS_USE_SDK=1
→ Build script still appends /std:c++17; MSVC prints
D9025: '/std:c++17' overrides '/std:c++20' and we are back to step 1.

Edited setup.py – replaced every std=c++17 with C++20
→ D9025 is gone. CUTLASS now compiles, but build fails in
sageattn/blackwell/kernel_traits.h with

error C2061: syntax error: identifier 'LayoutSF'
error C2061: syntax error: identifier 'SfAtom'
warning C4346: dependent name is not a type

Open problems

  1. The build script always forces C++17 flags; users cannot raise the standard.
  2. kernel_traits.h is missing typename for two dependent types.

Using c++17 is fine - some required flags from cutlass cmake file are just missing when compiling with python's setup.
You can use PR from #5 - it contains all necessary changes.

After turning to linux i can install and build it but when trying to use it with ComfyUI it spits the error: "No module named sageattention" since im a dumbo, how can i fix that?

After turning to linux i can install and build it but when trying to use it with ComfyUI it spits the error: "No module named sageattention" since im a dumbo, how can i fix that?

https://github.com/comfyanonymous/ComfyUI/pull/9047 Use this PR

Let me download the source code folder, I'll try to create a *.whl for Windows.

After turning to linux i can install and build it but when trying to use it with ComfyUI it spits the error: "No module named sageattention" since im a dumbo, how can i fix that?

https://github.com/comfyanonymous/ComfyUI/pull/9047 Use this PR

Unsure what exactly you mean, do i just have to use the sattn3 flag? Or do i need to implement it somehow?

Sign up or log in to comment