2424from megatron .bridge .perf_recipes .nemotronh import (
2525 nemotron_3_5_lightning_pretrain_8gpu_b200_bf16_config ,
2626 nemotron_3_5_lightning_pretrain_8gpu_b200_fp8mx_config ,
27- nemotron_3_5_lightning_pretrain_8gpu_b200_fp8mx_fsdp_config ,
2827 nemotron_3_5_lightning_pretrain_8gpu_b200_nvfp4_config ,
2928 nemotron_3_5_lightning_pretrain_8gpu_b300_bf16_config ,
3029 nemotron_3_5_lightning_pretrain_8gpu_b300_fp8mx_config ,
31- nemotron_3_5_lightning_pretrain_8gpu_b300_fp8mx_fsdp_config ,
3230 nemotron_3_5_lightning_pretrain_8gpu_b300_nvfp4_config ,
3331 nemotron_3_5_lightning_pretrain_8gpu_gb200_bf16_config ,
3432 nemotron_3_5_lightning_pretrain_8gpu_gb200_fp8mx_config ,
7775 nemotron_3_5_lightning_pretrain_8gpu_b300_fp8mx_config ,
7876 nemotron_3_5_lightning_pretrain_8gpu_b300_nvfp4_config ,
7977)
80- _B_FSDP_RECIPES = (
81- nemotron_3_5_lightning_pretrain_8gpu_b200_fp8mx_fsdp_config ,
82- nemotron_3_5_lightning_pretrain_8gpu_b300_fp8mx_fsdp_config ,
83- )
8478_GB200_RECIPES = (
8579 nemotron_3_5_lightning_pretrain_8gpu_gb200_bf16_config ,
8680 nemotron_3_5_lightning_pretrain_8gpu_gb200_fp8mx_config ,
9589 nemotron_3_5_lightning_pretrain_8gpu_gb200_fp8mx_fsdp_config ,
9690 nemotron_3_5_lightning_pretrain_8gpu_gb300_fp8mx_fsdp_config ,
9791)
98- _ALL_FSDP_RECIPES = (* _B_FSDP_RECIPES , * _GB_FSDP_RECIPES )
9992_NEMOTRON_3_RECIPES = (
10093 nemotron_3_nano_pretrain_16gpu_h100_bf16_config ,
10194 nemotron_3_nano_pretrain_16gpu_h100_fp8cs_config ,
204197 "megatron.bridge.perf_recipes.nemotronh.b200.nemotronh" ,
205198 "nemotron_3_5_lightning_pretrain_8gpu_b200_fp8mx_config" ,
206199 ),
207- (
208- "megatron.bridge.perf_recipes.nemotronh.b200.nemotronh" ,
209- "nemotron_3_5_lightning_pretrain_8gpu_b200_fp8mx_fsdp_config" ,
210- ),
211200 (
212201 "megatron.bridge.perf_recipes.nemotronh.b200.nemotronh" ,
213202 "nemotron_3_5_lightning_pretrain_8gpu_b200_nvfp4_config" ,
220209 "megatron.bridge.perf_recipes.nemotronh.b300.nemotronh" ,
221210 "nemotron_3_5_lightning_pretrain_8gpu_b300_fp8mx_config" ,
222211 ),
223- (
224- "megatron.bridge.perf_recipes.nemotronh.b300.nemotronh" ,
225- "nemotron_3_5_lightning_pretrain_8gpu_b300_fp8mx_fsdp_config" ,
226- ),
227212 (
228213 "megatron.bridge.perf_recipes.nemotronh.b300.nemotronh" ,
229214 "nemotron_3_5_lightning_pretrain_8gpu_b300_nvfp4_config" ,
@@ -285,7 +270,7 @@ def test_standard_perf_recipes_do_not_expose_mtp_flag(recipe_factory: Callable[[
285270
286271@pytest .mark .parametrize (
287272 "recipe_factory" ,
288- (* _H100_RECIPES , * _B200_RECIPES , * _B300_RECIPES , * _GB200_RECIPES , * _GB300_RECIPES , * _ALL_FSDP_RECIPES ),
273+ (* _H100_RECIPES , * _B200_RECIPES , * _B300_RECIPES , * _GB200_RECIPES , * _GB300_RECIPES , * _GB_FSDP_RECIPES ),
289274 ids = lambda recipe : recipe .__name__ ,
290275)
291276def test_perf_recipes_enable_mtp (recipe_factory : Callable [[], ConfigContainer ]) -> None :
@@ -513,9 +498,9 @@ def test_gb300_perf_recipe_topology(recipe_factory: Callable[[], ConfigContainer
513498 assert cfg .env_vars ["USE_MNNVL" ] == 1
514499
515500
516- @pytest .mark .parametrize ("recipe_factory" , _ALL_FSDP_RECIPES , ids = lambda recipe : recipe .__name__ )
517- def test_mxfp8_fsdp_perf_recipe_defaults (recipe_factory : Callable [[], ConfigContainer ]) -> None :
518- """The Lightning FSDP variants retain their measured 8-GPU performance settings."""
501+ @pytest .mark .parametrize ("recipe_factory" , _GB_FSDP_RECIPES , ids = lambda recipe : recipe .__name__ )
502+ def test_gb_fsdp_perf_recipe_defaults (recipe_factory : Callable [[], ConfigContainer ]) -> None :
503+ """The GB FSDP variants retain their measured 8-GPU performance settings."""
519504 cfg = recipe_factory ()
520505
521506 assert cfg .train .global_batch_size == 384
@@ -537,23 +522,3 @@ def test_mxfp8_fsdp_perf_recipe_defaults(recipe_factory: Callable[[], ConfigCont
537522 assert cfg .optimizer .reuse_grad_buf_for_mxfp8_param_ag is False
538523 assert cfg .checkpoint .load is None
539524 assert cfg .checkpoint .ckpt_format == "fsdp_dtensor"
540-
541-
542- @pytest .mark .parametrize (
543- ("recipe_factory" , "expect_b300_affinity" ),
544- (
545- (nemotron_3_5_lightning_pretrain_8gpu_b200_fp8mx_fsdp_config , False ),
546- (nemotron_3_5_lightning_pretrain_8gpu_b300_fp8mx_fsdp_config , True ),
547- ),
548- ids = lambda value : value .__name__ if callable (value ) else str (value ),
549- )
550- def test_b200_b300_mxfp8_fsdp_topology (
551- recipe_factory : Callable [[], ConfigContainer ], expect_b300_affinity : bool
552- ) -> None :
553- """B200 and B300 FSDP variants preserve their NVL8 topology settings."""
554- cfg = recipe_factory ()
555-
556- assert cfg .model .expert_model_parallel_size == 8
557- assert cfg .env_vars ["NVLINK_DOMAIN_SIZE" ] == 8
558- assert cfg .env_vars ["USE_MNNVL" ] == 0
559- assert ("NCCL_IGNORE_CPU_AFFINITY" in cfg .env_vars ) is expect_b300_affinity
0 commit comments