Megatron-LM icon indicating copy to clipboard operation
Megatron-LM copied to clipboard

Add minimal DBuffer implementation

Open wujingyue opened this issue 6 months ago • 14 comments

Summary

  • Add a minimal Megatron-FSDP DBuffer implementation following http://nv/mfsdp-design
  • Add global flat-buffer layout computation with row-aligned offsets and padded global size.
  • Add unit coverage for construction, tensor views, DTensor conversion, scatter/allgather, allreduce/reduce-scatter, and 2D mesh cases.

For broader context on how DBuffer will be used, refer to https://github.com/NVIDIA/Megatron-LM/pull/4976.

wujingyue avatar May 17 '26 08:05 wujingyue

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.

copy-pr-bot[bot] avatar May 17 '26 08:05 copy-pr-bot[bot]

/ok to test

wujingyue avatar May 26 '26 04:05 wujingyue

/ok to test

wujingyue avatar May 26 '26 18:05 wujingyue

@greptile

skyw avatar Jun 04 '26 15:06 skyw

/claude review

skyw avatar Jun 04 '26 16:06 skyw

@greptile review with strictness 2

skyw avatar Jun 04 '26 22:06 skyw

Reviews (1): Last reviewed commit: "Improve DBuffer out validation errors" | Re-trigger Greptile

greptile-apps avatar Jun 04 '26 22:06 greptile-apps

@greptileai

skyw avatar Jun 04 '26 22:06 skyw

Reviews (2): Last reviewed commit: "Improve DBuffer out validation errors" | Re-trigger Greptile

greptile-apps avatar Jun 04 '26 22:06 greptile-apps

@greptileai review entire pr

skyw avatar Jun 05 '26 00:06 skyw

Reviews (3): Last reviewed commit: "Improve DBuffer out validation errors" | Re-trigger Greptile

greptile-apps avatar Jun 05 '26 00:06 greptile-apps

particularly around the design and usage of GlobalLayout. It would be very helpful to have some form of usage guide or documentation that explains how to obtain the desired element slices using GlobalLayout and DBuffer.

GlobalLayout is an internal data structure. Users never create a DBuffer with GlobalLayout. Currently, only unit tests read it for sanity check. Maybe I should make it _layout instead and remove all uses of it from the tests?

cc @shjwudp

Thanks for the review!

wujingyue avatar Jun 09 '26 04:06 wujingyue

/ok to test

wujingyue avatar Jun 09 '26 21:06 wujingyue

/ok to test

wujingyue avatar Jun 10 '26 21:06 wujingyue

/ok to test

wujingyue avatar Jun 16 '26 20:06 wujingyue

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

copy-pr-bot[bot] avatar Jun 16 '26 22:06 copy-pr-bot[bot]

/ok to test

wujingyue avatar Jun 16 '26 22:06 wujingyue

/ok to test

@wujingyue, there was an error processing your request: E1

See the following link for more information: https://docs.gha-runners.nvidia.com/cpr/e/1/

copy-pr-bot[bot] avatar Jun 16 '26 22:06 copy-pr-bot[bot]

/ok to test

wujingyue avatar Jun 16 '26 22:06 wujingyue

🔄 Merge queue validation started!

You can track the progress here: https://github.com/NVIDIA/Megatron-LM/actions/runs/27655533140

svcnvidia-nemo-ci avatar Jun 16 '26 23:06 svcnvidia-nemo-ci