Skip to content

[Common] Gate FP8 THD sink backward on cuDNN 9.26 - #3441

Open
sudhakarsingh27 wants to merge 1 commit into
NVIDIA:mainfrom
sudhakarsingh27:fix/fp8-thd-sink-cudnn-guard
Open

[Common] Gate FP8 THD sink backward on cuDNN 9.26#3441
sudhakarsingh27 wants to merge 1 commit into
NVIDIA:mainfrom
sudhakarsingh27:fix/fp8-thd-sink-cudnn-guard

Conversation

@sudhakarsingh27

Copy link
Copy Markdown
Member

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.cpp
  • git diff --check

GPU runtime validation is left to CI.

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 <[email protected]>
@greptile-apps

greptile-apps Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This 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.

  • Adds a cuDNN 9.26 minimum for FP8 THD training with off-by-one or learnable sink softmax.
  • Leaves FP8 THD inference and vanilla-softmax training available on older supported cuDNN versions.
  • Returns no fused backend for known-bad combinations so they fail cleanly or use a framework fallback where available.

Confidence Score: 5/5

The 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

Filename Overview
transformer_engine/common/fused_attn/fused_attn.cpp Narrows FP8 THD backend selection only for sink-softmax training on cuDNN releases affected by the ragged-statistics backward defect.

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]
Loading

Reviews (1): Last reviewed commit: "[Common] Gate FP8 THD sink backward on c..." | Re-trigger Greptile

@sudhakarsingh27

Copy link
Copy Markdown
Member Author

/te-ci pytorch L0

@KshitijLakhani KshitijLakhani left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM ! Thanks
Good to merge once CI passes fully for both pipelines

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants