diff --git a/python/paddle/distributed/fleet/__init__.py b/python/paddle/distributed/fleet/__init__.py index 2539fa57a34b1fe6fdea6b6b847d52f765df3fa3..0a148625abc645f486f42519d39b8896eff12e4f 100644 --- a/python/paddle/distributed/fleet/__init__.py +++ b/python/paddle/distributed/fleet/__init__.py @@ -29,6 +29,7 @@ __all__ = [ ] fleet = Fleet() +_role_maker_ = fleet._role_maker_ init = fleet.init is_first_worker = fleet.is_first_worker worker_index = fleet.worker_index diff --git a/python/paddle/distributed/fleet/base/fleet_base.py b/python/paddle/distributed/fleet/base/fleet_base.py index 0dfcd5f3255efa945bbd4ac94b00433960eeaa22..2a3f52be613e7215c21db6cc75724e2ac6d02ba8 100644 --- a/python/paddle/distributed/fleet/base/fleet_base.py +++ b/python/paddle/distributed/fleet/base/fleet_base.py @@ -189,6 +189,9 @@ class Fleet(object): paddle.distributed.init_parallel_env() return None + def _role_maker_(self): + return self._role_maker + def is_first_worker(self): """ Check whether the node is the first instance of worker.