Skip to content

Add opt-in compact GQA backward with registered packing metadata - #3575

Open
layalir wants to merge 5 commits into
NVIDIA:mainfrom
layalir:gqa-native-integration-20260928
Open

layalir wants to merge 5 commits into
NVIDIA:mainfrom
layalir:gqa-native-integration-20260928

Conversation

@layalir

@layalir layalir commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Add opt-in compact GQA backward through cuDNN Frontend. Register host packing offsets and scope scratch reuse to forward/backward; unsupported inputs keep the existing path.

Enable with NVTE_CUDNN_COMPACT_GQA_BWD=1. Supports SM107, BF16 packed THD, Hq=8/Hkv=1, D=256, and causal attention.

Validation: 39 CPU contract tests across the companion changes and three native SM107 numerical cases passed. Latest full-workload A/B reduced mean policy-training time by 1.46%; rollout token counts differed, so timings are not normalized. The complete required L0 suites remain pending.

Requires NVIDIA/cudnn-frontend#1207. Packing integration: NVIDIA-NeMo/RL#4293.

Signed-off-by: Layali Rashid <lrashid@nvidia.com>
@github-actions github-actions Bot added the community-contribution PRs from external contributor outside the core maintainers, representing community-driven work. label Sep 28, 2026
Signed-off-by: Layali Rashid <lrashid@nvidia.com>
@layalir
layalir marked this pull request as ready for review September 29, 2026 12:19
@layalir
layalir requested a review from cyanguwa as a code owner September 29, 2026 12:19
@greptile-apps

greptile-apps Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] No actionable defect was established; the PR appears safe to merge.

Summary

Adds opt-in compact GQA backward for supported SM107 BF16 packed attention.

  • Eligible packed GQA calls can use compact cuDNN backward.
  • Callers can register packed-sequence offsets and scope attention scratch.

No new actionable issues were established. Tests were inspected but not run during this review.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Fused attention backward] --> B{Compact path enabled and supported?}
  B -->|No| S[Stock backward]
  B -->|Yes| C{Packing metadata registered and current?}
  C -->|No| S
  C -->|Yes| D[Get cached plan and scoped scratch]
  D --> E[Run compact backward]
  E --> F[Return gradients]
Loading

Reviews (4) · Last reviewed commit: "Merge branch 'main' into gqa-native-inte..." · Reviewed by Greptile

Signed-off-by: Layali Rashid <lrashid@nvidia.com>
Comment thread docs/envvars.rst Resolved
Signed-off-by: Layali Rashid <lrashid@nvidia.com>

This branch has not been deployed

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

Labels

2.22 attention community-contribution PRs from external contributor outside the core maintainers, representing community-driven work.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants