Skip to content

Commit b556cfc

Browse files
committed
test(nemotron): align fusion checks with job configs
Signed-off-by: Malay Nagda <malayn@nvidia.com>
1 parent 771f642 commit b556cfc

2 files changed

Lines changed: 27 additions & 13 deletions

File tree

‎tests/unit_tests/recipes/test_nemotron_3_5_lightning_perf_recipes.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -197,10 +197,10 @@ def test_gb200_mxfp8_enables_cutedsl_fusion() -> None:
197197
assert cfg.model.use_transformer_engine_op_fuser is True
198198
assert cfg.model.moe_mlp_glu_interleave_size == 32
199199
assert cfg.model.high_priority_a2a_comm_stream is False
200-
assert cfg.model.moe_hybridep_num_sms_preprocessing != 32
200+
assert cfg.model.moe_hybridep_num_sms_preprocessing == 108
201201
assert cfg.mixed_precision.fp8_dot_product_attention is True
202-
assert cfg.comm_overlap.overlap_moe_expert_parallel_comm is not True
203-
assert cfg.comm_overlap.delay_wgrad_compute is not True
202+
assert cfg.comm_overlap.overlap_moe_expert_parallel_comm is False
203+
assert cfg.comm_overlap.delay_wgrad_compute is False
204204

205205

206206
def test_gb200_mxfp8_fsdp_skips_cutedsl_fusion() -> None:

‎tests/unit_tests/recipes/test_nemotronh_recipes.py‎

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ class _FakeModelProvider:
5454

5555
def __init__(self) -> None:
5656
self.vocab_size = 256
57+
self.high_priority_a2a_comm_stream = False
58+
self.moe_hybridep_num_sms_preprocessing = 108
5759

5860
def finalize(self) -> None:
5961
return None
@@ -163,32 +165,40 @@ def test_nemotron_3_nano_gb200_defers_vocab_size_to_training_tokenizer():
163165

164166

165167
@pytest.mark.parametrize(
166-
("module_name", "factory_name"),
168+
("module_name", "factory_name", "has_comm_overlap"),
167169
[
168-
(
170+
pytest.param(
169171
"megatron.bridge.perf_recipes.nemotronh.gb200.nemotronh",
170172
"nemotron_3_nano_pretrain_8gpu_gb200_fp8mx_config",
173+
True,
174+
id="nano-gb200",
171175
),
172-
(
176+
pytest.param(
173177
"megatron.bridge.perf_recipes.nemotronh.gb300.nemotronh",
174178
"nemotron_3_nano_pretrain_8gpu_gb300_fp8mx_config",
179+
True,
180+
id="nano-gb300",
175181
),
176-
(
182+
pytest.param(
177183
"megatron.bridge.perf_recipes.nemotronh.gb200.nemotronh",
178184
"nemotron_3_super_pretrain_64gpu_gb200_fp8mx_config",
185+
False,
186+
id="super-gb200",
179187
),
180-
(
188+
pytest.param(
181189
"megatron.bridge.perf_recipes.nemotronh.gb300.nemotronh",
182190
"nemotron_3_super_pretrain_64gpu_gb300_fp8mx_config",
191+
False,
192+
id="super-gb300",
183193
),
184194
],
185-
ids=lambda recipe: recipe.rsplit(".", 1)[-1],
186195
)
187196
def test_nemotron_3_gb_mxfp8_perf_recipes_enable_cutedsl_fusion(
188197
module_name: str,
189198
factory_name: str,
199+
has_comm_overlap: bool,
190200
) -> None:
191-
"""GB200 and GB300 MXFP8 recipes enable CutDSL without MoE A2A overlap."""
201+
"""GB MXFP8 recipes match the measured CutDSL and MoE overlap settings."""
192202
module = importlib.import_module(module_name)
193203
cfg = getattr(module, factory_name)()
194204

@@ -197,10 +207,14 @@ def test_nemotron_3_gb_mxfp8_perf_recipes_enable_cutedsl_fusion(
197207
assert cfg.model.use_transformer_engine_op_fuser is True
198208
assert cfg.model.moe_mlp_glu_interleave_size == 32
199209
assert cfg.model.high_priority_a2a_comm_stream is False
200-
assert cfg.model.moe_hybridep_num_sms_preprocessing != 32
210+
assert cfg.model.moe_hybridep_num_sms_preprocessing == 108
201211
assert cfg.mixed_precision.fp8_dot_product_attention is True
202-
assert cfg.comm_overlap.overlap_moe_expert_parallel_comm is not True
203-
assert cfg.comm_overlap.delay_wgrad_compute is not True
212+
if has_comm_overlap:
213+
assert cfg.comm_overlap is not None
214+
assert cfg.comm_overlap.overlap_moe_expert_parallel_comm is False
215+
assert cfg.comm_overlap.delay_wgrad_compute is False
216+
else:
217+
assert cfg.comm_overlap is None
204218

205219

206220
def test_nemotron_3_super_64gpu_gb200_matches_benchmark_hardware_configuration():

0 commit comments

Comments
 (0)