[Common] Gate FP8 THD sink backward on cuDNN 9.26 - #3441
Conversation
cuDNN versions before 9.26 can misindex ragged stats when FP8 THD uses a sink token during backward. Preserve FP8 THD inference and vanilla-softmax training on older supported versions while avoiding the affected sink backward path. Signed-off-by: Sudhakar Singh <sudhakars@nvidia.com>
Greptile SummaryThis PR prevents selection of the affected cuDNN fused-attention backend for FP8 THD sink-softmax training before cuDNN 9.26 while preserving inference and vanilla-softmax training.
Confidence Score: 5/5The PR appears safe to merge because the new predicate narrowly excludes the documented unsafe cuDNN training combination while retaining unaffected inference and vanilla-softmax paths. The selector now rejects FP8 THD sink-softmax training before cuDNN 9.26, and the surrounding enum, training, layout, and fallback behavior align with the intended mitigation. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[FP8 THD request] --> B{Training?}
B -- No --> C[Allow supported cuDNN backend]
B -- Yes --> D{Vanilla softmax?}
D -- Yes --> C
D -- No: sink softmax --> E{cuDNN >= 9.26?}
E -- Yes --> C
E -- No --> F[Return No Backend]
Reviews (1): Last reviewed commit: "[Common] Gate FP8 THD sink backward on c..." | Re-trigger Greptile |
|
/te-ci pytorch L0 |
KshitijLakhani
left a comment
There was a problem hiding this comment.
LGTM ! Thanks
Good to merge once CI passes fully for both pipelines
Description
cuDNN versions before 9.26 can misindex ragged FP8 Stats during sink-token backward. FP8 THD backend selection currently permits this training path with cuDNN 9.23 and newer.
Require cuDNN 9.26 only when selecting FP8 THD training with a non-vanilla softmax mode. This preserves FP8 THD inference and vanilla-softmax training on older supported cuDNN versions.
Testing
pre-commit run clang-format --files transformer_engine/common/fused_attn/fused_attn.cppgit diff --checkGPU runtime validation is left to CI.