Skip to content

Commit 3ea6285

Browse files
committed
fix(nemotron): disable moe_router in CUDA graph configurations
- Removed "moe_router" from the set_cuda_graph_modules function calls in both GB200 and GB300 configurations. - Added a TODO comment to indicate the need for this change due to MCore PR 7046, which affects CPU-to-GPU copy for per token loss. Signed-off-by: rghadia <rghadia@nvidia.com>
1 parent 892a800 commit 3ea6285

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

‎src/megatron/bridge/perf_recipes/nemotronh/gb200/nemotronh.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,8 @@ def nemotron_3_ultra_pretrain_256gpu_gb200_fp8mx_config(*, num_gpus: int = 256)
249249
cfg.model.gtp_remat_opt_in_modules = ["moe_latent_proj"]
250250

251251
cfg.model.cuda_graph_impl = "local"
252-
set_cuda_graph_modules(cfg.model, ["attn", "mamba", "moe_router", "moe_preprocess"])
252+
set_cuda_graph_modules(cfg.model, ["attn", "mamba", "moe_preprocess"])
253+
#TODO: "moe_router" needs to be disabled due to MCore PR 7046, performing a CPU-to-GPU copy for per token loss
253254
# TE attention requires TE's RNG tracker while MCore local graphs are capturing.
254255
cfg.rng.te_rng_tracker = cfg.model.use_te_rng_tracker = True
255256

‎src/megatron/bridge/perf_recipes/nemotronh/gb300/nemotronh.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,8 @@ def _nemotron_3_ultra_gb300_fp8mx_config(
260260
_apply_nemotron_3_ultra_gtp(cfg)
261261

262262
cfg.model.cuda_graph_impl = "local"
263-
set_cuda_graph_modules(cfg.model, ["attn", "mamba", "moe_router", "moe_preprocess"])
263+
set_cuda_graph_modules(cfg.model, ["attn", "mamba", "moe_preprocess"])
264+
#TODO: "moe_router" needs to be disabled due to MCore PR 7046, performing a CPU-to-GPU copy for per token loss
264265
# TE attention requires TE's RNG tracker while MCore local graphs are capturing.
265266
cfg.rng.te_rng_tracker = cfg.model.use_te_rng_tracker = True
266267

0 commit comments

Comments
 (0)