fix: remove unconditional inplace_mask_diag that overrides owner self…#2597
Open
greatjourney589 wants to merge 2 commits intoopentensor:devnet-readyfrom
Open
fix: remove unconditional inplace_mask_diag that overrides owner self…#2597greatjourney589 wants to merge 2 commits intoopentensor:devnet-readyfrom
greatjourney589 wants to merge 2 commits intoopentensor:devnet-readyfrom
Conversation
Author
|
Hi @open-junius @sam0x17 @gztensor @JohnReedV @camfairchild |
Contributor
|
utACK Thanks for the contribution |
camfairchild
suggested changes
Apr 20, 2026
Contributor
camfairchild
left a comment
There was a problem hiding this comment.
Please write a test for this also
b9ddcb3 to
4a3d782
Compare
Author
A corresponding test has been added. Thank you for catching that. |
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.
Description
Remove a stray unconditional
inplace_mask_diag(&mut weights)call inepoch_dense_mechanismthat immediately followed the owner self-weight exception block. When anowner_uidis present, theifbranch correctly callsinplace_mask_diag_except_indexto preserve the owner's self-weight on the diagonal. However, the redundant call afterward would unconditionally zero the entire diagonal — silently overriding and negating that exception on every epoch.Related Issue(s)
Type of Change
Breaking Change
N/A — this fix restores intended behavior and does not alter any public interfaces.
Checklist
./scripts/fix_rust.shto ensure my code is formatted and linted correctlyScreenshots (if applicable)
Please include any relevant screenshots or GIFs that demonstrate the changes made.
Additional Notes
The removed line appears to be a leftover from before the owner self-weight exception was introduced. The
if let Some(owner_uid)block already handles both branches (inplace_mask_diag_except_indexfor the owner case,inplace_mask_diagfor the general case), making the unconditional call after the block both redundant and harmful.