Skip to content

Commit

Permalink
[Trainer] Fix sharding overlap bug (#8334)
Browse files Browse the repository at this point in the history
  • Loading branch information
DesmonDay authored Apr 26, 2024
1 parent 3105c18 commit 89daaa3
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 @@ -1020,6 +1020,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 89daaa3

Please sign in to comment.