Skip to content

Fix convolution flattening across orthogonalization megabatches - #121

Open
Zherui Yang (Adversarr) wants to merge 1 commit into
microsoft:mainfrom
Adversarr:fix/megabatch-conv-flatten
Open

Fix convolution flattening across orthogonalization megabatches#121
Zherui Yang (Adversarr) wants to merge 1 commit into
microsoft:mainfrom
Adversarr:fix/megabatch-conv-flatten

Conversation

@Adversarr

Copy link
Copy Markdown

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:

  • Speech Commands v0.02 — one-second audio recordings of 35 spoken keywords, used for Conv1d classification.
  • Food-101 — food photographs across 101 categories, used for Conv2d classification.
  • ModelNet40 — 3D objects across 40 categories, represented as point clouds and voxelized for sparse Conv3d classification.
W B Chart 2026_9_9 11_57_57 W B Chart 2026_9_9 11_57_36 W B Chart 2026_9_9 11_57_04

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.
@Adversarr

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant