Skip to content

Commit

Permalink
Fix bug in distopt allgathers with interleaved pipeline parallelism
Browse files Browse the repository at this point in the history
Only first few param all-gathers were being aligned across pipeline parallel ranks.

Signed-off-by: Tim Moon <[email protected]>
  • Loading branch information
timmoon10 committed Aug 15, 2023
1 parent 255b1d0 commit 32bbb76
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion megatron/core/pipeline_parallel/schedules.py
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ def forward_step_helper(microbatch_id, checkpoint_activations_microbatch):
# pipeline-parallel group.
if config.param_sync_func is not None:
param_sync_microbatch_id = microbatch_id + pipeline_parallel_rank
if param_sync_microbatch_id < num_microbatches and is_first_microbatch_for_model_chunk(
if param_sync_microbatch_id < total_num_microbatches and is_first_microbatch_for_model_chunk(
param_sync_microbatch_id
):
param_sync_chunk_id = get_model_chunk_id(param_sync_microbatch_id, forward=True) + 1
Expand Down

0 comments on commit 32bbb76

Please sign in to comment.