Skip to content

Commit

Permalink
Fix sharding overlap bug (#8333)
Browse files Browse the repository at this point in the history
  • Loading branch information
DesmonDay authored Apr 28, 2024
1 parent ea2926c commit 7c3ab53
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions paddlenlp/trainer/training_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -1026,6 +1026,11 @@ def __post_init__(self):
enable_dp_comm_overlap and enable_sharding_comm_overlap
), "dp_comm_overlap and sharding_comm_overlap cannot be enabled at the same time"

if enable_sharding_comm_overlap and not self.amp_master_grad:
raise ValueError(
"If `enable_sharding_comm_overlap` in pipeline_parallel_configs, `amp_master_grad` must be True."
)

dygraph_pp_configs = {
"delay_scale_loss": True if "enable_delay_scale_loss" in pipeline_parallel_config else False,
"dp_comm_overlap": enable_dp_comm_overlap,
Expand Down

0 comments on commit 7c3ab53

Please sign in to comment.