Repository navigation
Disable cuDNN SDPA to prevent nonfinite attention gradients - #3296
Merged
Merged
Conversation
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.
cuDNN SDPA can return NaN gradients from finite inputs, including with cuDNN 9.27 (NVIDIA #1072, NVIDIA #160). Disable cuDNN SDPA during attention initialization, backend selection and context cleanup so native attention and automatic Kohaku delegation cannot select it during training or validation.
Reject explicit cuDNN aliases, remove the CLI/WebUI choice and MiniMax-H3 context-parallel allowance, and remove the obsolete cuDNN backward-layout override. Switch the Krea2 example and quickstart to Kohaku-FA and update OPTIONS, Krea2 and MiniMax-H3 documentation in all five translations.
Validation:
.venv/bin/python -m unittest -v -f: 7,095 tests passed, 323 skipped.reduce-overheadcompilation. All gradients were finite. Kohaku profiles confirmed CuTe kernels with cuDNN SDPA disabled. The cuDNN baseline uses the preceding main-branch policy in an isolated process.2048px uses
vae_enable_tiling=truefor both backends: untiled VAE cache creation runs out of memory on the L40S before denoiser training begins. The smaller resolutions use untiled VAE preprocessing. Peak training memory includes first-use compilation; warm timing excludes the first three updates and the profiled update.