Repository navigation
[Fix] Capture complete Nemotron auxiliary hidden states - #40801
Merged
Merged
Conversation
ch-wan
force-pushed
the
cheng/hot-fix/nemotron-aux-capture
branch
from
September 23, 2026 00:23
976d803 to
5a236ad
Compare
This was referenced Sep 23, 2026
ch-wan
changed the base branch from
main
to
cheng/hot-fix/nemotron-mtp-reduction
September 23, 2026 00:24
This was referenced Sep 23, 2026
Merged
Merged
ch-wan
marked this pull request as ready for review
September 23, 2026 07:31
ch-wan
force-pushed
the
cheng/hot-fix/nemotron-mtp-reduction
branch
from
September 23, 2026 09:32
c8af486 to
0383b28
Compare
ch-wan
force-pushed
the
cheng/hot-fix/nemotron-aux-capture
branch
from
September 23, 2026 09:32
5a236ad to
b24b22e
Compare
ch-wan
force-pushed
the
cheng/hot-fix/nemotron-mtp-reduction
branch
from
September 23, 2026 21:38
0383b28 to
72f40e1
Compare
Base automatically changed from
cheng/hot-fix/nemotron-mtp-reduction
to
main
September 23, 2026 21:39
ch-wan
force-pushed
the
cheng/hot-fix/nemotron-aux-capture
branch
from
September 23, 2026 21:39
b24b22e to
930a93f
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.
This PR is part of a stack (oldest at bottom):
Motivation
With DP attention, Nemotron Attention/Mamba outputs remain partial across attention TP until the next layer prepares them. Auxiliary hidden-state capture currently adds these partials directly to the residual. Also, the first captured tensor aliases the input residual and can be overwritten by a later in-place norm.
Modifications
Reduce a copy when capturing a DP Attention/Mamba output, preserving the live tensor for the next layer's normal reduction. Clone the initial snapshot before it becomes the mutable residual. Reuse the capture helper at intermediate boundaries and the model endpoint.
Add a regression through the model and actual decoder/communicator forwards, covering Attention, Mamba, consecutive Attention, endpoint capture, TP1/TP2, and DP enabled/disabled. It checks snapshots against an independent reference and verifies that enabling capture leaves the main output unchanged.
Accuracy Tests
Stacking and comment cleanup preserve the executable AST of the tested revisions.
The GPU probe uses synthetic Attention/MLP outputs. Full-checkpoint auxiliary-state/speculative decoding has not been run.
Speed Tests and Profiling
No performance benchmark. Capturing a DP Attention/Mamba partial now adds a clone and an attention-TP reduction for that snapshot. Capturing the initial input adds a clone. Forward passes without auxiliary capture do not execute the new helper.
Checklist
Review and Merge Process
/tag-and-rerun-ci,/tag-run-ci-label,/rerun-failed-ciCI States
Latest PR Test (Base): 🚫 Run #35923794078
Latest PR Test (Extra): 🚫 Run #35923793342
Latest PR Test (AMD ROCm 10): ❌ Run #35923793607