Repository navigation
Conversation
Signed-off-by: Chen Cui <chcui@nvidia.com>
|
Automatic Claude reviews have been retired. To request a pull-request review, post a comment containing: Add |
Signed-off-by: Chen Cui <chcui@nvidia.com>
Recursively visit optimizer-chain children before inspecting leaf optimizers in the HybridDeviceOptimizer master-copy synchronization helper. Add real ChainedOptimizer regression coverage for nested non-HDO and mixed HDO trees. Signed-off-by: rohitrango <rohit.rango@gmail.com>
|
/review |
svcnvidia-nemo-ci
left a comment
There was a problem hiding this comment.
One blocking validation-order issue: runtime setup rejects a Muon configuration before its explicit communication-overlap override can make it valid.
Reviewed all 26 changed files and traced the affected setup, synchronization, and checkpoint paths. This was a static review; tests were not executed.
Suggested test cases
No perf tests impacted.
test_runtime_config_update_applies_overlap_override_before_layerwise_validation— proposed regression described inline.- test_distributed_emerging_optimizer_normalization — retain normalization and idempotence assertions.
- test_reject_layerwise_optimizer_step_overlap — retain rejection when optimizer-step overlap remains enabled.
- L1_Launch_training_muon.sh — run the numerical and fresh-process resume matrix.
Note: formal approval is not available for this request, so this review is posted as a comment only.
Review generated by codex
| cfg._disable_native_energon_packing_moe_overlap() | ||
|
|
||
| # Resolve optimizer mode before selecting communication overlap capabilities. | ||
| _validate_and_sync_distributed_optimizer_settings(cfg) |
There was a problem hiding this comment.
[P2] Apply communication overrides before validating optimizer-step overlap
Failure: Start with vanilla_gpt_pretrain_config() and set:
cfg.optimizer.optimizer = "muon"
cfg.optimizer.overlap_param_gather_with_optimizer_step = True
cfg.comm_overlap = CommOverlapConfig(
tp_comm_overlap=False,
overlap_param_gather_with_optimizer_step=False,
)
runtime_config_update(cfg)The inherited distributed flag makes this call select layer-wise distribution, then normalize_optimizer_config raises immediately. However, CommOverlapConfig applies explicit user overrides, so the effective optimizer-step-overlap setting should be False and this configuration should proceed.
Correction: Remove this pre-overlap synchronization call; retain the call at the start of ConfigContainer.validate, which runs after overlap setup. The updated CommOverlapConfig.setup gate already recognizes optimizer-side flags and legacy aliases without this early normalization. Suggested patch at this location, for author verification:
- # Resolve optimizer mode before selecting communication overlap capabilities.
- _validate_and_sync_distributed_optimizer_settings(cfg)
-The invariant is to validate effective settings after communication overrides, while still normalizing distribution before model construction.
Preservation and acceptance — proposed checks, not executed: Add test_runtime_config_update_applies_overlap_override_before_layerwise_validation using the setup above, parameterized with muon and dist_muon. Expect successful runtime update, normalized name muon, layer-wise distribution enabled, ordinary optimizer distribution disabled, DDP distribution enabled, and optimizer-step overlap disabled. With no override, or an explicit True override, expect the existing ValueError. Retain the existing normalization test's idempotent explicit/inherited/alias results, replicated Muon's all-distribution-flags-false result, and Adam/SGD's ordinary-distribution result in the distribution tests.
| raise ValueError("Layer-wise optimizers require num_distributed_optimizer_instances=1.") | ||
| # Both distributed implementations use reduce-scatter. Model setup must | ||
| # additionally pass layer-wise intent so Core chooses the correct layout. | ||
| config.ddp.use_distributed_optimizer = True |
There was a problem hiding this comment.
This also moves the existing dist_muon recipes (Kimi K2 and its perf recipes, Kimi K2.5-VL) off the legacy LayerWise path, even though they set ddp.use_distributed_optimizer=False, and they now pick up overlap_param_gather from CommOverlapConfig too. Probably the right direction, but it's not in the description or validated on MoE/PP. It also looks like pre-PR Muon checkpoints won't restore optimizer state, and there's no Bridge opt-out like --no-use-layer-wise-param-layout. Could you do a quick before/after on one Kimi config and update the stale recipe comments and docs?
What does this PR do?
Fix distributed Muon setup, parameter synchronization, and checkpoint save/resume. Changing an Adam recipe to
optimizer="muon"can currently retain incompatible distributed settings and silently produce incorrect updates. Explicit layer-wise configurations also miss overlap and checkpoint paths that check onlyuse_distributed_optimizer.Changelog
dist_*aliases, and pass the required parameter layout through provider, builder, and component model setup.Validation
These are short correctness runs; they do not establish long-run convergence or performance.
GitHub Actions CI
The added
L1_Launch_training_muon.shruns the two-GPU matrix with exact comparisons. CI results are pending.Before your PR is ready for review