sgl-flash-attn3 is currently built against a specific Torch version ([torch] src = [...torch-ext/torch_binding.cpp...], no stable-abi). SGLang has moved to Torch 2.11, which we are deprecating in the kernel builder (see huggingface/kernels#732, this discussion). Rather than keeping a legacy Torch version alive just for this kernel, it would be better to switch it to the Torch stable ABI, like we already do for flash-attn3 and vllm-flash-attn3 — then a single build works across Torch versions.
The upstream kernel already has everything needed: it is in sync with the upstream stable ABI sources, cf. hopper/flash_api_stable.cpp.
So this should mostly be build configuration changes, mirroring flash-attn3:
- In
sgl-flash-attn3/build.toml, set stable-abi in the [torch] section and point src at flash_api_stable.cpp instead of the torch-ext/ bindings + shim.
- Adjust
sgl-flash-attn3/flake.nix if needed (cf. flash-attn3/flake.nix).
- Verify that the op signatures exposed by
flash_api_stable.cpp stay in sync with flash_api.cpp modulo stable API/ABI differences, so the Python-side API does not change for SGLang users.
cc @danieldk @sayakpaul
Requested by Daniël de Kok - Slack thread - Agent trace
sgl-flash-attn3is currently built against a specific Torch version ([torch] src = [...torch-ext/torch_binding.cpp...], nostable-abi). SGLang has moved to Torch 2.11, which we are deprecating in the kernel builder (see huggingface/kernels#732, this discussion). Rather than keeping a legacy Torch version alive just for this kernel, it would be better to switch it to the Torch stable ABI, like we already do forflash-attn3andvllm-flash-attn3— then a single build works across Torch versions.The upstream kernel already has everything needed: it is in sync with the upstream stable ABI sources, cf.
hopper/flash_api_stable.cpp.So this should mostly be build configuration changes, mirroring
flash-attn3:sgl-flash-attn3/build.toml, setstable-abiin the[torch]section and pointsrcatflash_api_stable.cppinstead of thetorch-ext/bindings + shim.sgl-flash-attn3/flake.nixif needed (cf.flash-attn3/flake.nix).flash_api_stable.cppstay in sync withflash_api.cppmodulo stable API/ABI differences, so the Python-side API does not change for SGLang users.cc @danieldk @sayakpaul
Requested by Daniël de Kok - Slack thread - Agent trace