Skip to content

Sync 2 diffs to facebookresearch/optimizers (#281) - #281

Closed
wz337 wants to merge 1 commit into
facebookresearch:mainfrom
wz337:export-D127258042
Closed

wz337 wants to merge 1 commit into
facebookresearch:mainfrom
wz337:export-D127258042

Conversation

@wz337

@wz337 wz337 commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Summary:

Syncs the following changes from the internal dev tree to
facebookresearch/optimizers via scripts/oss_sync.sh:

  • [shampoo] Fix the lossless FSDP2/HSDP2 distributors silently discarding model weights loaded after the optimizer was constructed. These distributors keep a gathered copy of the full parameters and write it back on every step; that copy was taken at construction, so loading weights into the model afterwards (without also loading optimizer state) reset every FSDP2-wrapped layer to its initial values at the first step. The copy is now marked stale at construction and rebuilt from the live model at the first optimizer step, at the cost of one extra all-gather per run. Loading weights before or after constructing the optimizer now trains identically.
  • [shampoo] Remove an unused type-checker suppression comment in distributed_shampoo.py (no behavior change).

Internal revisions: D125752049, D126803644

All mirror files are script output. The only hand edit is to CHANGELOG.md, where the generated bullets were rewritten as release notes. The generator also listed D126125211 (OSS mypy fix). That bullet was dropped because the change already shipped in the 2026-10-19 sync; it was re-listed only because that sync hand-set the marker to the last public commit.

New marker ba2736b1e697 (D126803644) is public.

Differential Revision: D127258042

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Oct 23, 2026
@meta-codesync

meta-codesync Bot commented Oct 23, 2026

Copy link
Copy Markdown

@wz337 has exported this pull request. If you are a Meta employee, you can view the originating Diff in D127258042.

@meta-codesync meta-codesync Bot changed the title Sync 2 diffs to facebookresearch/optimizers Sync 2 diffs to facebookresearch/optimizers (#281) Oct 23, 2026
wz337 added a commit to wz337/optimizers that referenced this pull request Oct 23, 2026
Summary:

Syncs the following changes from the internal dev tree to
facebookresearch/optimizers via scripts/oss_sync.sh:

- [shampoo] Fix the lossless FSDP2/HSDP2 distributors silently discarding model weights loaded after the optimizer was constructed. These distributors keep a gathered copy of the full parameters and write it back on every step; that copy was taken at construction, so loading weights into the model afterwards (without also loading optimizer state) reset every FSDP2-wrapped layer to its initial values at the first step. The copy is now marked stale at construction and rebuilt from the live model at the first optimizer step, at the cost of one extra all-gather per run. Loading weights before or after constructing the optimizer now trains identically.
- [shampoo] Remove an unused type-checker suppression comment in `distributed_shampoo.py` (no behavior change).

Internal revisions: D125752049, D126803644

All mirror files are script output. The only hand edit is to `CHANGELOG.md`, where the generated bullets were rewritten as release notes. The generator also listed D126125211 (OSS mypy fix). That bullet was dropped because the change already shipped in the 2026-10-19 sync; it was re-listed only because that sync hand-set the marker to the last public commit.

New marker `ba2736b1e697` (D126803644) is public.

Differential Revision: D127258042
@wz337
wz337 force-pushed the export-D127258042 branch from f87873e to bc8c540 Compare October 23, 2026 23:28
Summary:

Syncs the following changes from the internal dev tree to
facebookresearch/optimizers via scripts/oss_sync.sh:

- [shampoo] Fix the lossless FSDP2/HSDP2 distributors silently discarding model weights loaded after the optimizer was constructed. These distributors keep a gathered copy of the full parameters and write it back on every step; that copy was taken at construction, so loading weights into the model afterwards (without also loading optimizer state) reset every FSDP2-wrapped layer to its initial values at the first step. The copy is now marked stale at construction and rebuilt from the live model at the first optimizer step, at the cost of one extra all-gather per run. Loading weights before or after constructing the optimizer now trains identically.
- [shampoo] Remove an unused type-checker suppression comment in `distributed_shampoo.py` (no behavior change).

Internal revisions: D125752049, D126803644

All mirror files are script output. The only hand edit is to `CHANGELOG.md`, where the generated bullets were rewritten as release notes. The generator also listed D126125211 (OSS mypy fix). That bullet was dropped because the change already shipped in the 2026-10-19 sync; it was re-listed only because that sync hand-set the marker to the last public commit.

New marker `ba2736b1e697` (D126803644) is public.

Differential Revision: D127258042
@wz337
wz337 force-pushed the export-D127258042 branch from bc8c540 to 4ecdcb4 Compare October 23, 2026 23:29
@meta-codesync meta-codesync Bot closed this in 2837ffc Oct 23, 2026
@meta-codesync meta-codesync Bot added the Merged label Oct 23, 2026
@meta-codesync

meta-codesync Bot commented Oct 23, 2026

Copy link
Copy Markdown

This pull request has been merged in 2837ffc.

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

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant