Skip to content

Commit 373fe80

Browse files
liuzhenhai93wentaoyu
authored andcommitted
part-4 cherry-pick from: dp and sharding coexist (PaddlePaddle#56096)
* dp and sharding coexist * dp
1 parent e987ee1 commit 373fe80

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

python/paddle/distributed/fleet/meta_optimizers/dygraph_optimizer/hybrid_parallel_optimizer.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,13 @@ def async_add_n(var_list):
200200
+ global_norm_not_dist_fp32
201201
)
202202

203+
return self._comm_and_clip(
204+
params_grads, global_norm_var_dist, global_norm_var_not_dist
205+
)
206+
207+
def _comm_and_clip(
208+
self, params_grads, global_norm_var_dist, global_norm_var_not_dist
209+
):
203210
self._global_norm(global_norm_var_dist, global_norm_var_not_dist)
204211

205212
global_norm_var_fp32 = paddle.sqrt(

0 commit comments

Comments
 (0)