Repository navigation
[bugfix] Fix Qwen4Exp PLE HF export and TP checkpoint metadata - #192
Merged
hjh0119 merged 1 commit intoSep 15, 2026
Merged
Conversation
hjh0119
approved these changes
Sep 15, 2026
Collaborator
|
thanks! |
hjh0119
added a commit
to hjh0119/mcore-bridge
that referenced
this pull request
Sep 15, 2026
…): resolve ple.py -- keep modelscope#192 unified naming + chunked all_reduce with CPU accumulation
hjh0119
added a commit
to hjh0119/mcore-bridge
that referenced
this pull request
Sep 15, 2026
- ple.py: split export_table_to_hf into a generator (iter_export_table_to_hf) that yields one shard at a time; the bulk API remains as a thin wrapper - qwen4_exp.py: stage the shard iterator in _set_layer_ple and interleave the cross-PP broadcast per shard (_iter_ple_table_export); consumed at _convert's yield point so no rank accumulates the 100GB-scale table in host memory - gpt_bridge.py: drain the staged iterator at the per-layer yield point and make the per-layer yield lazy Verified: 13 unit tests (modelscope#192's test_ple_checkpoint included), medium e2e TP2xPP2xEP2xETP2 (0 missing keys), and a load->export roundtrip that is bit-exact on all 16 PLE shards and 12 sampled other weights
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.
Summary
cpu_offload=False: export the current embedding TP partition and assemble the HF shards across TP ranks using the existing table export path.sharded_state_dictmethods soVocabParallelEmbeddingsupplies its vocabulary-axis TP metadata instead of being marked replicated. Keep hash buffers replicated.tests/test_ple_checkpoint.pycovering updated-weight export with simulated TP1/2/8 ranks (with and without FP8 scale), and TP8/TP2 checkpoint layouts.Validation