Repository navigation
RMSNorm save output: skip inference tensor weights, keep the default path free of opt-in checks - #13981
Merged
Conversation
… free of the opt-in checks UNSLOTH_RMSNORM_SAVE_OUTPUT=1 read W._version, which raises for weights created under torch.inference_mode(). Skip the saved-Y path when X needs no grad (backward never runs) or W is an inference tensor. With the flag off, fused LoRA no longer calls the saved-norm marker check and RMSNorm backward no longer takes an extra view of the saved X.
Member
Author
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Nice work! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
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.
Follow-up to #13868.
UNSLOTH_RMSNORM_SAVE_OUTPUT=1, a decoder forward over norm weights created insidetorch.inference_mode()raisedRuntimeError: Inference tensors do not track version counter.from_save_output_ok. Inference-tensor weights now fall back to saving X. The saved-Y path is also skipped when X needs no grad, since backward never runs and the weight check and its.item()would be wasted.Tests: two new tests in
tests/test_rmsnorm_save_output.py(both fail on main); RMSNorm and fused LoRA GPU tests pass (629 passed).