Skip to content

Commit

Permalink
Fix expert rank generator
Browse files Browse the repository at this point in the history
Signed-off-by: Guyue Huang <guyueh@nvidia.com>
  • Loading branch information
guyueh1 committed Dec 3, 2024
1 parent b12892b commit 23befa1
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions nemo/collections/nlp/modules/common/megatron/megatron_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,12 +361,9 @@ def fake_initialize_model_parallel(
expert_decoder_rank_generator = RankGenerator(
tp=tensor_model_parallel_size, # the same as Attention part
ep=expert_model_parallel_size_,
dp=(
decoder_world_size
// (expert_model_parallel_size_ * tensor_model_parallel_size * pipeline_model_parallel_size)
),
dp=(data_parallel_size // expert_model_parallel_size_),
pp=pipeline_model_parallel_size,
cp=1,
cp=context_parallel_size,
order='tp-pp-dp' if use_tp_pp_dp_mapping else 'tp-cp-ep-dp-pp',
rank_offset=encoder_world_size,
)
Expand Down

0 comments on commit 23befa1

Please sign in to comment.