fix: remove unconditional inplace_mask_diag that overrides owner self…#2597
fix: remove unconditional inplace_mask_diag that overrides owner self…#2597greatjourney589 wants to merge 11 commits intoopentensor:devnet-readyfrom
Conversation
|
Hi @open-junius @sam0x17 @gztensor @JohnReedV @camfairchild |
|
utACK Thanks for the contribution |
camfairchild
left a comment
There was a problem hiding this comment.
Please write a test for this also
b9ddcb3 to
4a3d782
Compare
A corresponding test has been added. Thank you for catching that. |
|
@camfairchild Could you review again in your time? |
camfairchild
left a comment
There was a problem hiding this comment.
I'm not seeing the tests?
It seems you added some tests but they're not relevant to the change.
Also you removed some comments that are not related to your change.
Perhaps your commit was rebased wrong
…-weight exception
4a3d782 to
7d0fa9e
Compare
My mistake. Something went wrong during rebase. I fixed and updated the PR. Request your review again, please. @camfairchild |
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.