From d817d896cf093a8813d93b034f044a9dd868110c Mon Sep 17 00:00:00 2001 From: Roc <30228238+sljlp@users.noreply.github.com> Date: Wed, 19 Oct 2022 10:00:45 +0800 Subject: [PATCH] fix send for old dygraph mode by passing use_calc_stream to the send op (#47110) --- .../fleet/meta_parallel/pp_utils/p2p_communication.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/python/paddle/distributed/fleet/meta_parallel/pp_utils/p2p_communication.py b/python/paddle/distributed/fleet/meta_parallel/pp_utils/p2p_communication.py index ca438326386..c9566b188a5 100644 --- a/python/paddle/distributed/fleet/meta_parallel/pp_utils/p2p_communication.py +++ b/python/paddle/distributed/fleet/meta_parallel/pp_utils/p2p_communication.py @@ -199,7 +199,8 @@ def send_partial(tensor, dst_rank = _hcg._get_p2p_next_rank( ) if dst == 1 else _hcg._get_p2p_prev_rank() if _in_legacy_dygraph(): - send_op = paddle.distributed.send + send_op = lambda x, dst, group: \ + paddle.distributed.send(x, dst, group, use_calc_stream) elif in_dygraph_mode(): send_op = paddle.distributed.isend return send_op(tensor.detach(), dst=dst_rank, group=group) -- GitLab