Skip to content

Support 1f1b a2a overlap #1671

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion megatron/core/model_parallel_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,8 +312,13 @@ class ModelParallelConfig:
rank 1 | 0 1 2 0 1 2 3 4 3 4
"""

overlap_moe_expert_parallel_comm: bool = False
"""If true, use batch-level overlapping in 1f1b stage for A2A communication hiding."""

delay_wgrad_compute: bool = False
"""If true, delay the wgrad compute for better overlapping in combined 1F1B."""
"""If true, delay the wgrad compute for better overlapping
in overlap_moe_expert_parallel_comm.
"""

###################
# CPU Offloading
Expand Down Expand Up @@ -398,3 +403,8 @@ def __post_init__(self):
"Pipeline parallel communication overlapping in warmup and flush is only "
"compatible with overlap_p2p_comm but not batch_p2p_comm."
)

if self.delay_wgrad_compute and not self.overlap_moe_expert_parallel_comm:
raise ValueError(
"Delaying wgrad compute only works when setting --overlap-moe-expert-parallel-comm"
)
Loading