Skip to content

Commit

Permalink
Allow tp_overlap tree substitution in hydra config
Browse files Browse the repository at this point in the history
Signed-off-by: Jan Baczek <[email protected]>
  • Loading branch information
jbaczek committed Jul 17, 2023
1 parent 2c192b0 commit bdbc6bf
Show file tree
Hide file tree
Showing 5 changed files with 227 additions and 0 deletions.
3 changes: 3 additions & 0 deletions examples/nlp/language_modeling/conf/megatron_gpt_config.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
defaults:
- optional [email protected]_tp_comm_overlap_cfg:

name: megatron_gpt
restore_from_path: null # used when starting from a .nemo file

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# UB communicator configurations
# Model configs: A100/175B/TP4/MBS1/SeqLen2K/BF16

# Bulk overlap with AllGather
qkv_dgrad:
method: bulk
num_sm: 2
set_sm_margin: 0

qkv_wgrad:
method: bulk
num_sm: 2
set_sm_margin: 0

fc1_dgrad:
method: bulk
num_sm: 2
set_sm_margin: 0

fc1_wgrad:
method: bulk
num_sm: 2
set_sm_margin: 0

## Ring-exchange overlap with AllGather
qkv_fprop:
method: ring_exchange
aggregate: 0

proj_dgrad:
method: ring_exchange
aggregate: 0

fc1_fprop:
method: ring_exchange
aggregate: 0

fc2_dgrad:
method: ring_exchange
aggregate: 0

# Chunked-collective overlap with ReduceScatter
proj_fprop:
method: pipeline
num_sm: 4
num_splits: 4
set_sm_margin: 0

fc2_fprop:
method: pipeline
num_sm: 4
num_splits: 4
set_sm_margin: 0
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# UB communicator configurations
# Model configs: A100/175B/TP4/MBS2/SeqLen2K/BF16

# Bulk overlap with AllGather
qkv_dgrad:
method: bulk
num_sm: 2
set_sm_margin: 0

qkv_wgrad:
method: bulk
num_sm: 2
set_sm_margin: 0

fc1_dgrad:
method: bulk
num_sm: 2
set_sm_margin: 0

fc1_wgrad:
method: bulk
num_sm: 2
set_sm_margin: 0

## Ring-exchange overlap with AllGather
qkv_fprop:
method: ring_exchange
aggregate: 0

proj_dgrad:
method: ring_exchange
aggregate: 0

fc1_fprop:
method: ring_exchange
aggregate: 0

fc2_dgrad:
method: ring_exchange
aggregate: 0

# Chunked-collective overlap with ReduceScatter
proj_fprop:
method: pipeline
num_sm: 8
num_splits: 4
set_sm_margin: 0

fc2_fprop:
method: pipeline
num_sm: 4
num_splits: 4
set_sm_margin: 0
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# UB communicator configurations
# Model configs: H100/175B/TP4/MBS1/SeqLen2K/FP8

# Bulk overlap with AllGather / ReduceScatter
qkv_dgrad:
method: bulk
num_sm: 4
cga_size: 2
set_sm_margin: 0

qkv_wgrad:
method: bulk
num_sm: 8
cga_size: 2
set_sm_margin: 0

fc1_dgrad:
method: bulk
num_sm: 2
cga_size: 2
set_sm_margin: 0

fc1_wgrad:
method: bulk
num_sm: 4
cga_size: 2
set_sm_margin: 0

## Ring-exchange overlap with AllGather
qkv_fprop:
method: ring_exchange
aggregate: 0

proj_dgrad:
method: ring_exchange
aggregate: 0

fc1_fprop:
method: ring_exchange
aggregate: 0

fc2_dgrad:
method: ring_exchange
aggregate: 1

# Chunked-collective overlap with ReduceScatter
proj_fprop:
method: pipeline
num_sm: 24
cga_size: 2
num_splits: 4
set_sm_margin: 1

fc2_fprop:
method: pipeline
num_sm: 20
cga_size: 2
num_splits: 4
set_sm_margin: 1
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# UB communicator configurations
# Model configs: H100/175B/TP8/MBS2/SeqLen2K/FP8

# Bulk overlap with AllGather
qkv_dgrad:
method: bulk
num_sm: 8
cga_size: 2
set_sm_margin: 0

qkv_wgrad:
method: bulk
num_sm: 16
cga_size: 2
set_sm_margin: 0

fc1_dgrad:
method: bulk
num_sm: 4
cga_size: 2
set_sm_margin: 0

fc1_wgrad:
method: bulk
num_sm: 16
cga_size: 2
set_sm_margin: 0

## Ring-exchange overlap with AllGather
qkv_fprop:
method: ring_exchange
aggregate: 0

proj_dgrad:
method: ring_exchange
aggregate: 1

fc1_fprop:
method: ring_exchange
aggregate: 0

fc2_dgrad:
method: ring_exchange
aggregate: 0

# Chunked-collective overlap with ReduceScatter
proj_fprop:
method: pipeline
num_sm: 16
cga_size: 2
num_splits: 4
set_sm_margin: 1

fc2_fprop:
method: pipeline
num_sm: 24
cga_size: 2
num_splits: 4
set_sm_margin: 1

0 comments on commit bdbc6bf

Please sign in to comment.