fix: auto-attn falls back to FA2 on non-SM100 Blackwell (#3079)
Docker Push / Push CUDA image to Docker (push) Canceled after 0s

resolve_auto_attn routed every GPU with major >= 9 that wasn't exactly
SM100 to FA3, whose kernels are Hopper-only. Workstation Blackwell
(RTX PRO 6000, SM120) then hit "no kernel image is available for
execution on the device" at runtime, and the FA2 fallback branch was
unreachable for any Blackwell/Hopper card.

Gate FA3 on SM90 (Hopper) exactly so non-SM100 Blackwell resolves to
FA2, which ships sm_120 kernels.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Mika Senghaas
2026-07-17 17:10:37 -07:00
committed by GitHub
co-authored by Claude Opus 4.8
parent 0eadc24027
commit a12935c140
+4 -4
View File
@@ -1138,15 +1138,15 @@ def resolve_auto_attn(config: ModelConfig) -> None:
"""Resolve ``attn='auto'`` to a concrete flash attention implementation based on GPU architecture.
FA4 on datacenter Blackwell (SM100), FA3 on Hopper (SM90), FA2 otherwise.
Workstation Blackwell GPUs (SM103, e.g. RTX PRO 6000) lack FA4 kernels,
so they fall back to FA2.
Workstation Blackwell GPUs (e.g. RTX PRO 6000, SM120) lack FA4 kernels and
can't run the Hopper-only FA3 kernels, so they fall back to FA2.
"""
if config.attn != "auto":
return
major, minor = torch.cuda.get_device_capability()
if major == 10 and minor == 0:
if (major, minor) == (10, 0):
resolved = "flash_attention_4"
elif major >= 9:
elif major == 9:
resolved = "flash_attention_3"
else:
resolved = "flash_attention_2"