Skip to content

Commit bc1d14f

Browse files
committed
test(fsdp): simplify MFSDP V2 EP smoke
Signed-off-by: Jingyue Wu <jingyuew@nvidia.com>
1 parent 2523f54 commit bc1d14f

1 file changed

Lines changed: 6 additions & 8 deletions

File tree

tests/functional_tests/test_groups/megatron_fsdp/test_megatron_fsdp.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323

2424
from megatron.bridge.models.gpt_provider import GPTModelProvider
2525
from megatron.bridge.models.hybrid.hybrid_provider import HybridModelProvider
26-
from megatron.bridge.models.transformer_config import MLATransformerConfig
2726
from megatron.bridge.training.config import (
2827
CheckpointConfig,
2928
ConfigContainer,
@@ -114,14 +113,13 @@ class DenseHybridSmokeModelProvider(HybridModelProvider):
114113

115114

116115
@dataclass
117-
class MLAMoEHybridSmokeModelProvider(MLATransformerConfig, HybridModelProvider):
118-
"""Small MLA/MoE HybridModel configuration for the MFSDP V2 EP smoke test."""
116+
class MoEHybridSmokeModelProvider(HybridModelProvider):
117+
"""Small HybridModel configuration for the MFSDP V2 EP smoke test."""
119118

120119
attention_backend: AttnBackend = AttnBackend.auto
121120
seq_length: int = 128
122121
hidden_size: int = 128
123-
multi_latent_attention: bool = True
124-
hybrid_layer_pattern: str = "+E"
122+
hybrid_layer_pattern: str = "*E"
125123
num_moe_experts: int = 4
126124
expert_model_parallel_size: int = 2
127125

@@ -443,8 +441,8 @@ def test_fsdp_v2_dense_hybrid_pretrain_smoke(self):
443441
torch.distributed.barrier()
444442

445443
@pytest.mark.run_only_on("GPU")
446-
def test_fsdp_v2_mla_moe_ep2_pretrain_smoke(self):
447-
"""Train a small MLA/MoE HybridModel with MFSDP V2 and EP=2."""
444+
def test_fsdp_v2_moe_ep2_pretrain_smoke(self):
445+
"""Train a small MoE HybridModel with MFSDP V2 and EP=2."""
448446
initialize_distributed()
449447
torch.distributed.barrier()
450448

@@ -453,7 +451,7 @@ def test_fsdp_v2_mla_moe_ep2_pretrain_smoke(self):
453451
train_iters=10,
454452
optimizer={"clip_grad": 0.0},
455453
)
456-
cfg.model = MLAMoEHybridSmokeModelProvider()
454+
cfg.model = MoEHybridSmokeModelProvider()
457455
cfg.ddp.megatron_fsdp_version = 2
458456

459457
pretrain(cfg, forward_step)

0 commit comments

Comments
 (0)