Add block-atomic DBuffer placement - #6978
Open
wujingyue wants to merge 1 commit into
Open
Conversation
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
wujingyue
force-pushed
the
agent/mfsdp-block-atomic
branch
14 times, most recently
from
August 31, 2026 14:20
bbae52d to
268638f
Compare
wujingyue
commented
Aug 31, 2026
Signed-off-by: Jingyue Wu <jingyuew@nvidia.com>
wujingyue
force-pushed
the
agent/mfsdp-block-atomic
branch
from
August 31, 2026 14:55
268638f to
d866c63
Compare
wujingyue
marked this pull request as ready for review
August 31, 2026 14:56
wujingyue
commented
Aug 31, 2026
| f"Cannot compute a layout for zero-sized non-leading dims: {shape}." | ||
| ) | ||
| chunk_size = math.lcm(chunk_size, row_size) | ||
| # Match Transformer Engine MXFP8's whole-block requirement: |
Contributor
Author
There was a problem hiding this comment.
@NVIDIA/megatron-fsdp to double check. This appears to be an over constraint but happens to simplify the logic in this function.
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.
What
BlockAtomic(block_size), a dim-0 DBuffer sharding placement that keeps row blocks on one rank.GlobalLayoutper parameter group and share it across its weights, gradients, and temporary buffers.block_size=1case.Why
BlockAtomic provides the layout guarantee needed by block-wise parameter formats. A group-owned layout keeps its buffers compatible even when their current placements differ.
Related to #5615.
Testing
/opt/venv/bin/python -m torch.distributed.run --nproc-per-node 2 -m pytest -q tests/unit_tests/distributed/mfsdp_v2/test_dbuffer.py tests/unit_tests/distributed/mfsdp_v2/test_fully_shard.py— 49 passed, 12 skipped