From 742cbe666024415f856ec77721b19a8a58c8e44f Mon Sep 17 00:00:00 2001 From: lilong12 Date: Wed, 30 Sep 2020 14:04:10 +0800 Subject: [PATCH] [bug fix] avoiding multiple initialization of gloo for fleet in dygraph mode (#27706) * add double grad for expand, test=develop --- python/paddle/distributed/fleet/base/role_maker.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/python/paddle/distributed/fleet/base/role_maker.py b/python/paddle/distributed/fleet/base/role_maker.py index 874cb533574..deba3b4a17d 100644 --- a/python/paddle/distributed/fleet/base/role_maker.py +++ b/python/paddle/distributed/fleet/base/role_maker.py @@ -18,6 +18,7 @@ import numpy as np import warnings from multiprocessing import Process, Manager +import paddle import paddle.fluid as fluid from paddle.distributed.fleet.base.private_helper_function import wait_server_ready @@ -869,7 +870,8 @@ class PaddleCloudRoleMaker(RoleMakerBase): else: self._collective_env() self._role_is_generated = True - self._gloo_init() + if not paddle.fluid.framework.in_dygraph_mode(): + self._gloo_init() class UserDefinedRoleMaker(PaddleCloudRoleMaker): -- GitLab