Single grouped weight fixes#3225
Conversation
Greptile SummaryThis PR delivers three targeted bug fixes to the single grouped weight path introduced in #3178: preserving high-precision initialization metadata when packing discrete weights into a
Confidence Score: 5/5All three fixes are narrow and well-targeted, each addressing a distinct silent failure mode without touching shared infrastructure beyond the refactored helpers. Each bug is exercised by a dedicated new test that directly asserts the previously-broken invariant. The refactored _attach_high_precision_init_val helper is a pure extraction of existing inline closure logic with identical semantics, and the defensive getattr guards in the register_parameter override prevent regressions during super().init() ordering. No files require special attention. The MXFP8 columnwise stickiness fix in ops/fused/grouped_mlp.py is the most subtle change, but the accompanying test validates the end-to-end behavior. Important Files Changed
Reviews (4): Last reviewed commit: "[PyTorch] Preserve grouped MXFP8 columnw..." | Re-trigger Greptile |
|
/te-ci pytorch L1 |
|
/te-ci pytorch L1 |
| # Full-iteration CUDA graph replay does not rerun this Python metadata | ||
| # update. Remember that a grad-enabled forward requested columnwise | ||
| # storage so eager eval cannot drop buffers still used by captured dgrad. | ||
| fc1_weight_quantizer.set_usage( | ||
| rowwise=True, | ||
| columnwise=input_requires_grad or fc1_weight_quantizer.columnwise_usage, | ||
| ) | ||
| fc1_op.weight.quantizer = fc1_weight_quantizer | ||
| grouped_fc1_weight = fc1_op.weight |
There was a problem hiding this comment.
The op and the param purposely have different quantizers so that you can change them independently. However, we are incorrectly reusing the same quantizer in two places, and getting unexpected interactions. The op's quantizer is set in each forward pass:
The proper fix is keep the op and param quantizers distinct.
|
/te-ci pytorch |
Signed-off-by: CarlosGomes98 <carlosmiguel.gomes@live.com.pt>
Signed-off-by: CarlosGomes98 <carlosmiguel.gomes@live.com.pt>
Signed-off-by: CarlosGomes98 <carlosmiguel.gomes@live.com.pt>
2c7db67 to
b4f2be1
Compare
Description
A few fixes to the single grouped weight implementation
12406c9 — Preserve grouped weight initialization metadata
99b3f37 — Mark late grouped weights for delayed wgrad
aa4e233 — Preserve grouped MXFP8 columnwise usage
See #3178 for the original PR.
PR #3224 is very relevant to this one, both are required fixes.
Fixes # (issue)
Type of change
Changes
Please list the changes introduced in this PR:
Checklist: