Fix convolution flattening across orthogonalization megabatches - #121
Open
Zherui Yang (Adversarr) wants to merge 1 commit into
Open
Fix convolution flattening across orthogonalization megabatches#121Zherui Yang (Adversarr) wants to merge 1 commit into
Zherui Yang (Adversarr) wants to merge 1 commit into
Conversation
Preserve the leading layer axis in stacked and distributed Newton-Schulz inputs, and leave stacks of 2D parameters as independent matrices. Add standalone regression coverage for Conv1d/2d/3d, Linear, LR geometry, row splitting, replicated communication, and sharded packing with two and four CPU ranks. Validation: 216 passed, 137 CUDA-dependent tests skipped. Historical helper negative control: 15 stacked failures and 5 single-parameter passes.
Author
|
@microsoft-github-policy-service agree |
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.
Problem: Stacked convolution weights were flattened into (N, numel), causing Newton–Schulz to orthogonalize across layers instead of independently within each layer.
Fix: This fix explicitly identifies the megabatch axis and preserves (N, out_channels, flattened_input) geometry in local, replicated, and FSDP2-sharded paths. Single-parameter behavior, flatten=False, and row splitting remain unchanged. Stacked Linear parameters with flatten=True also retain independent matrix geometry, correcting the same layer-mixing defect.
Results: Regression coverage includes Conv1d/2d/3d. I also include three testing case below: