Reject FP8/MXFP8 SDPA forward combinations exposed to a cuDNN 9.24 split-KV bug#414
Open
vedaanta wants to merge 1 commit into
Open
Reject FP8/MXFP8 SDPA forward combinations exposed to a cuDNN 9.24 split-KV bug#414vedaanta wants to merge 1 commit into
vedaanta wants to merge 1 commit into
Conversation
…lit-KV bug cuDNN 9.24 on Blackwell can select a split-KV prefill kernel for FP8/MXFP8 forward graphs whose combine step encodes the result as FP16 regardless of the requested output data type. A BF16 output tensor then holds FP16 bit patterns, which reinterpret as ~1e-21 denormals — effectively a silent all-zeros output. The kernel is preferred exactly when the Q-tile grid under-fills the GPU while s_kv is long (e.g. cross-attention with small s_q and s_kv in the tens of thousands). Add a support-surface check that rejects the exposed combination on cuDNN 9.24 with an actionable message: FP8/MXFP8 forward, BF16 output, s_q > 1, s_kv >= 4096, no diagonal band bounds, non-paged/non-ragged/non-dropout (the split-KV kernel is never selected outside those conditions). cuDNN 9.25.0 ships the kernel fix, and versions before 9.24 do not have the kernel, so only 9.24 is gated. Also add build-only tests covering the gated combination and the neighboring allowed ones (short s_kv, causal masking).
Contributor
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
cuDNN 9.24 on Blackwell can select a split-KV prefill kernel for FP8/MXFP8 SDPA forward graphs whose combine step encodes the result as FP16 regardless of the requested output data type. A BF16 output tensor then holds FP16 bit patterns, which reinterpret as ~1e-21 denormals — effectively a silent all-zeros output. The kernel is preferred exactly when the Q-tile grid under-fills the GPU while
s_kvis long, e.g. cross-attention with Q=(1, 1024, h, 128) against K/V=(1, 62208, h, 128).cuDNN 9.25.0 ships the kernel fix. Versions before 9.24 do not have the kernel. Since 9.24 binaries are already public, the frontend should refuse the exposed combination there rather than let it corrupt silently.
Change
sdpa_support_surface.h: reject, on cuDNN 9.24 only (92400 <= version < 92500), FP8/MXFP8 forward graphs with BF16 output,s_q > 1,s_kv >= 4096, no diagonal band bounds, non-paged / non-ragged / non-dropout — the exact envelope in which the backend can select the split-KV prefill kernel. The error message names the bug and the fixed version. FP16 and FP8 outputs are unaffected by the bug and stay allowed, as do causal/banded, short-s_kv, paged, ragged and dropout graphs (the kernel is never selected for those).test/python/test_sdpa_fp8_split_kv_guard.py: build-only tests (no execution, no quantization deps) asserting the combination raisescudnnGraphNotSupportedErroron 9.24 and validates cleanly on other versions, plus the neighboring allowed combinations (shorts_kv, causal).Verification (B200)
cudnnGraphNotSupportedErrorwith the actionable message (previously returned all-zeros);s_kv=512and causal variants still build and produce correct results; BF16 (non-FP8) SDPA unaffected.🤖 Generated with Claude Code