Skip to content

Reduce noncontiguous model gradients - #489

Merged
Toni-SM merged 5 commits into
Toni-SM:developfrom
Afloat16:fix/noncontiguous-gradient-reduction-20261029
Nov 8, 2026
Merged

Toni-SM merged 5 commits into
Toni-SM:developfrom
Afloat16:fix/noncontiguous-gradient-reduction-20261029

Conversation

@Afloat16

Copy link
Copy Markdown
Contributor

Problem and change

Distributed gradient reduction uses view(-1), which cannot flatten noncontiguous gradients such as channels-last convolution weights. Flatten with reshape before reduction. A real two-worker CPU Gloo regression verifies averaged gradients and preserves the original channels-last gradient layout.

Validation

The new regression fails on the unchanged base. pytest -q tests/utils/model_instantiators/torch: 46 passed with the fix. Full pre-commit run --all-files and git diff --check passed.

CPU tests on Python 3.12.14 and PyTorch 2.15.0; the complete Torch model-instantiator directory was exercised. No complete multi-backend project-suite claim.

Validation was performed on base e43d04d4e7eba068016a341f2fdbe3eeef97b70f.

@Toni-SM
Toni-SM merged commit 0c4d777 into Toni-SM:develop Nov 8, 2026
8 of 10 checks passed
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.

2 participants