[PyTorch] torch.compile support for FusedAttention (diff vs #3480 only) - #46
Open
pggPL wants to merge 1 commit into
Open
[PyTorch] torch.compile support for FusedAttention (diff vs #3480 only)#46pggPL wants to merge 1 commit into
pggPL wants to merge 1 commit into
Conversation
Register the cuDNN fused attention forward/backward as a torch custom op through dynamo/custom_op.py, reusing the single-argument helpers behind FusedAttnFunc, so DotProductAttention with the fused backend traces under torch.compile(fullgraph=True), including KV caching. F16/BF16 only; FP8, context parallelism, score_mod, FAv2 backward and CPU offloading keep falling back to eager via no_torch_dynamo(when=...). Signed-off-by: Pawel Gadzinski <pgadzinski@nvidia.com>
pggPL
force-pushed
the
fused_attention_torch_compile
branch
from
September 4, 2026 11:05
889032f to
e16a1ab
Compare
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.
Review-only PR on the fork: upstream NVIDIA#3472 with NVIDIA#3480 as the base, so only the compile commit shows in the diff. Do not merge here; the real PRs are NVIDIA#3480 and NVIDIA#3472.