Repository navigation
Fix GPT-OSS final norm reconstruction in FakeBaseModel - #2897
Merged
Merged
Conversation
Contributor
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2897 +/- ##
==========================================
- Coverage 79.63% 78.94% -0.70%
==========================================
Files 659 659
Lines 74141 74146 +5
==========================================
- Hits 59045 58536 -509
- Misses 15096 15610 +514
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
cjluo-nv
reviewed
Oct 20, 2026
cjluo-nv
left a comment
Collaborator
There was a problem hiding this comment.
Bot review (gpt-6.1-sol) — DM the bot to share feedback.
LGTM: the fix reuses Transformers’ normalization and has strong parity coverage; the justified existing-test update needs human sign-off.
Needs action:
- Confirm the updated GPT-OSS expectation in
test_modeling_final_norm.py: registering the matching norm legitimately replaces the previous unsupported-model assertion.
No action needed:
- Coverage checks checkpoint dtypes, loading precision, exact logits and gradients, and save/reload parity.
- Tests were inspected but not executed during this review.
Signed-off-by: Sandeep Agrawal <[email protected]>
sragrawal
force-pushed
the
sandeepa/gptoss-final-norm-reuse
branch
from
October 22, 2026 04:05
ab57299 to
922e0bf
Compare
Contributor
Author
Confirmed. Adding GPT-OSS support requires replacing the old “unsupported” test expectation, and includes parity tests against Transformers. |
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.
What does this PR do?
Type of change: Bug fix.
GPT-OSS draft training cannot reconstruct teacher logits from hidden states
captured before the final normalization because
FakeBaseModelhas no GPT-OSSfinal-norm mapping.
Register GPT-OSS and reuse Transformers'
GptOssRMSNorm. Follow its loadingdtype policy: BF16 and FP32 keep the requested precision; FP16 loading keeps
the norm weights in FP32. Later explicit model dtype conversions retain normal
PyTorch behavior.
Usage
No new flag or dependency. Existing GPT-OSS
FakeBaseModelloading selectsthe normalization automatically.
Testing
and Transformers 5.18. Changed-file pre-commit passed, including mypy and Bandit.
GptOssForCausalLMloaded from localsafetensors: BF16/FP32 checkpoint weights crossed with FP32/BF16/FP16 loading.
They check exact norm weights, logits, input/scale gradients and save/reload
parity.
control fails the two BF16 cases.
registered norm. Other model assertions remain intact.
Before your PR is "Ready for review"
Additional Information
AI-assisted implementation and testing using Codex. No changes to training
algorithms, loss masking, launchers or serving code.
Summary by CodeRabbit