Skip to content

Commit

Permalink
Merge branch 'moe_distckpt_compatibility' into 'main'
Browse files Browse the repository at this point in the history
Fix moe dist-ckpt compatibility for !2230

See merge request ADLR/megatron-lm!2449
  • Loading branch information
jaredcasper committed Dec 13, 2024
2 parents 99f23d2 + 17b92eb commit 40db706
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion megatron/core/transformer/transformer_block.py
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,10 @@ def sharded_state_dict(
non_homogeneous_layers = metadata is not None and metadata.get(
'non_homogeneous_layers', False
)
if self.config.num_moe_experts is not None:
if isinstance(self.config.moe_layer_freq, int):
if self.config.moe_layer_freq > 1:
non_homogeneous_layers = True
elif isinstance(self.config.moe_layer_freq, list):
non_homogeneous_layers = True

sharded_state_dict = {}
Expand Down

0 comments on commit 40db706

Please sign in to comment.