Repository navigation
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/198468
Note: Links to docs will display an error until the docs builds have been completed. ✅ You can merge normally! (2 Unrelated Failures)As of commit 52d6ebd with merge base 5613a88 ( UNSTABLE - The following jobs are marked as unstable, possibly due to flakiness on trunk:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
weifengpy
added a commit
to pytorch/torchtitan
that referenced
this pull request
Sep 24, 2026
Generator MXFP8 linears use FSDP degree 1, but retaining separate parameter and compute weights wastes memory and complicates CUDA graph weight updates. Store the existing quantizer's FP8 data and GEMM-ready scales as the parameter's persistent buffers, and let FSDP expose a compute view of those same allocations. ``` meta model -> TP -> FP8 storage -> fully_shard -> allocate/init TorchStore BF16 receive DTensor -> existing MXFP8 quantizer -> update persistent FP8 data + GEMM-ready scales in place -> captured compute reads the same buffers ``` `_MXFP8StorageTensor` reuses `_quantize_mxfp8_weight`, `_MXFP8LinearOperands`, and `_UnshardedFSDPTensor`. There is one persistent storage subclass and one FP8 data allocation per converted weight. Loading BF16 weights preserves the addresses of the data and both existing scale layouts. No FSDP all-gather, packed byte payload, or scale-layout conversion is needed during unshard. The inference variant is installed after TP and before `fully_shard`, with logical BF16 parameter metadata. State dicts expose temporary BF16 DTensors with the generator's mesh and placements, preserving checkpoint and TorchStore loading. It supports ordinary and stacked projections, requires complete TP-local 32x32 tiles, and explicitly requires FSDP degree 1. Training and grouped-expert implementations are unchanged. Requires pytorch/pytorch#198468 for FSDP's borrowed-storage path and `fsdp_get_unsharded_view`. Generator parameters are frozen so ordinary BF16 parameters can share storage too. The generic generator prepare/finish callbacks remain for other formats with separate compute buffers and still require pytorch/pytorch#198417. Direct MXFP8 weight-loading tests exercise #198468 independently of #198417. Validation: - CPU quantization/storage suite: 61 passed. - GPU storage and CUDA graph checks: 4 passed; 4 native MXFP8 cases skipped because this machine has H100 GPUs, not SM100. - `pre-commit run --all-files`: passed, including type checking. - GPU checks use real DTensor/FSDP with TP=1/2 and a reference quantizer plus BF16 matmul on H100. They verify exact data/scales, shared and stable addresses, and exact replay outputs after three BF16 loads without explicit reshard/unshard. Native TorchAO MXFP8/GEMM cases require SM100 GPUs; full vLLM/RL validation is not included. - The GPU checks use the independent Python FSDP changes from #198468 on the existing built torch, without the earlier multi-rank extension-layout candidate. The CPU and multi-GPU test files are selected by the repository's existing CI workflows once that dependency is available. Prepared with Codex as a user-requested draft. Based on the independent #4860 copy of #4838; the original #4838 is untouched. ghstack-source-id: f959f33 Pull-Request: #4861
Contributor
|
Looks like this PR hasn't been updated in a while so we're going to go ahead and mark this as |
This branch has not been deployed
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.
Stack from ghstack (oldest at bottom):