[build] fix: Restore Bridge compatibility with MCore dev - #4094
Conversation
Signed-off-by: yaoyu-33 <yaoyu.094@gmail.com>
|
/ok to test 47da44e |
| print( | ||
| " > number of parameters on (tensor, pipeline) model parallel rank ({}, {}): {}".format( | ||
| pg_collection.tp.rank(), | ||
| pg_collection.pp.rank(), | ||
| sum([sum([p.nelement() for p in model_module.parameters()]) for model_module in model]), | ||
| ), | ||
| flush=True, | ||
| ) | ||
|
|
There was a problem hiding this comment.
Nit: bare print() is discouraged by project rules (CLAUDE.md: "NEVER use bare print() — use logging.getLogger(__name__) or print_rank_0()"). The DP/CP rank guard makes this intentional (matching the MCore original), but since we're inlining anyway, consider switching to print_rank_0 or the module logger to stay consistent with Bridge conventions.
Light Code ReviewOverall this is a clean inlining of MCore helpers that are being removed upstream. The imports are fully migrated, test patch paths are updated, and no stale references remain. Minor observations
No critical bugs or logic errors found. Suggested test cases No perf tests impacted. |
Summary
What
Why
PR #4093 bumps MCore dev to
1fe78252e9690505a04759f56b6cbb35861fcb37and fails during import/collection because MCore removed or flattened:megatron.core._slurm_utilssafe_get_world_sizefrommegatron.core._rank_utilsmegatron.training.vocab_utilsmegatron.training.utils.log_utilsmegatron.training.models.base/dist_utilsmegatron.training.utils.common_utils.get_local_rank_preinitValidation
ruff formaton changed filesruff checkon changed filespre-commit run --fileson changed filesgit diff --check378d81fbd32a3faa90726d0e59344f7893ce4b47)uv.lock(main, mcore-dev) (2026-05-31) #4093 (1fe78252e9690505a04759f56b6cbb35861fcb37)uv runcannot install lockednvidia-resiliency-ext==0.6.0for this host's platform, and the active Python environment has an older NVRX package than MCore requires.Unblocks the Bridge-side compatibility failures observed in #4093.