Skip to content

[PyTorch] torch.compile support for FusedAttention (diff vs #3480 only) - #46

Open
pggPL wants to merge 1 commit into
fused_attn_func_refactorfrom
fused_attention_torch_compile
Open

[PyTorch] torch.compile support for FusedAttention (diff vs #3480 only)#46
pggPL wants to merge 1 commit into
fused_attn_func_refactorfrom
fused_attention_torch_compile

Conversation

@pggPL

@pggPL pggPL commented Sep 4, 2026

Copy link
Copy Markdown
Owner

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.

@pggPL
pggPL requested a review from cyanguwa as a code owner September 4, 2026 10:44
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
pggPL force-pushed the fused_attention_torch_compile branch from 889032f to e16a1ab Compare September 4, 2026 11:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant