Skip to content

fix(weights): handle empty colocated tensor buckets#1492

Open
EazyReal wants to merge 1 commit into
radixark:mainfrom
EazyReal:upstream-pr/empty-colocated-weight-bucket
Open

fix(weights): handle empty colocated tensor buckets#1492
EazyReal wants to merge 1 commit into
radixark:mainfrom
EazyReal:upstream-pr/empty-colocated-weight-bucket

Conversation

@EazyReal

Copy link
Copy Markdown

Port of THUDM/slime#2134 for the miles weight-sync layout.

Summary:

  • let empty local HF tensor chunks participate in the colocated gather
  • if another rank has real tensors, pad missing rank entries with an empty flattened bucket
  • keep all-empty gathered chunks as no-ops

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

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@EazyReal EazyReal force-pushed the upstream-pr/empty-colocated-weight-bucket branch from 9c36597 to d5b8c8e Compare June 30, 2026 08:38
@EazyReal

Copy link
Copy Markdown
Author

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant