fix(weights): handle empty colocated tensor buckets#1492
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the weight-updating logic for colocated engines to handle empty tensor buckets. Specifically, it ensures that when FlattenedTensorBucket supports multiple data types, empty named tensors are handled correctly. It also pads empty colocated bucket entries with an empty serialized tensor when ranks have differing numbers of buckets. Additionally, a new test suite has been added to verify these changes. There are no review comments, so I have no feedback to provide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
9c36597 to
d5b8c8e
Compare
|
@fzyzcjy @yueming-yuan @maocheng23 @yushengsu-thu @Zhichenzzz Could I get a quick review on this empty colocated weight-bucket fix? It avoids failing a weight update when a rank owns no tensors. |
Port of THUDM/slime#2134 for the miles weight-sync layout.
Summary:
Validation:
uv run --with pytest --with torch --with ray --with packaging --with numpy pytest --confcutdir=tests/fast/backends/megatron_utils tests/fast/backends/megatron_utils/test_empty_colocated_weight_bucket.py -q-> 2 passed