Skip to content

Allow DCP to load Float8 MoE training weights - #4782

Open
ivy-zhou wants to merge 1 commit into
pytorch:mainfrom
ivy-zhou:export-D113730611
Open

Allow DCP to load Float8 MoE training weights#4782
ivy-zhou wants to merge 1 commit into
pytorch:mainfrom
ivy-zhou:export-D113730611

Conversation

@ivy-zhou

Copy link
Copy Markdown

Summary:
Register Float8TrainingWeightWrapperTensor and its serialized configuration types as safe globals so the DCP weights_only=True reader can restore Float8 MoE training weights. Add direct and DCP round-trip coverage.

This fixes a general DCP deserialization compatibility gap exposed by TorchTitan, not a TorchTitan-specific reader bug. The quantized DeepSeek-V3.1 671B MoE configuration wraps expert weights in Float8TrainingWeightWrapperTensor. Both native DCP resume and DCP-to-torch_checkpointing compatibility loading ultimately use the DCP FileSystemReader, which restores payloads with torch.load(..., weights_only=True). Without this registration, loading fails before state-dict adaptation with Unsupported global.

Differential Revision: D113730611

Summary:
Register `Float8TrainingWeightWrapperTensor` and its serialized configuration types as safe globals so the DCP `weights_only=True` reader can restore Float8 MoE training weights. Add direct and DCP round-trip coverage.

This fixes a general DCP deserialization compatibility gap exposed by TorchTitan, not a TorchTitan-specific reader bug. The quantized DeepSeek-V3.1 671B MoE configuration wraps expert weights in `Float8TrainingWeightWrapperTensor`. Both native DCP resume and DCP-to-`torch_checkpointing` compatibility loading ultimately use the DCP `FileSystemReader`, which restores payloads with `torch.load(..., weights_only=True)`. Without this registration, loading fails before state-dict adaptation with `Unsupported global`.

Differential Revision: D113730611
@pytorch-bot

pytorch-bot Bot commented Aug 19, 2026

Copy link
Copy Markdown

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/ao/4782

Note: Links to docs will display an error until the docs builds have been completed.

❌ 2 New Failures, 1 Unclassified Failure

As of commit a7b88b9 with merge base 46e106b (image):

NEW FAILURES - The following jobs have failed:

UNCLASSIFIED FAILURE - DrCI could not classify the following job because the workflow did not run on the merge base. The failure may be pre-existing on trunk or introduced by this PR:

  • PR Label Check / Check PR Labels (gh) (this job did not run on the merge base, so DrCI cannot tell whether the failure is pre-existing)
    ##[error]This PR requires at least one label starting with 'module:'. Available modules can be found at: https://github.com/pytorch/ao/labels?q=module

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@meta-codesync

meta-codesync Bot commented Aug 19, 2026

Copy link
Copy Markdown

@ivy-zhou has exported this pull request. If you are a Meta employee, you can view the originating Diff in D113730611.

@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 Aug 19, 2026
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. meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant