Skip to content

Commit

Permalink
remove fluid APIs in distributed_strategy.py and role_maker.py
Browse files Browse the repository at this point in the history
  • Loading branch information
wangxn12138 committed Nov 15, 2022
1 parent 19f5dfe commit 223bbee
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions python/paddle/distributed/fleet/base/distributed_strategy.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def _set_distributed_strategy(self, dist_strategy):
self.job_info.strategy = dist_strategy


ReduceStrategyFluid = paddle.fluid.BuildStrategy.ReduceStrategy
ReduceStrategyFluid = paddle.static.BuildStrategy.ReduceStrategy
ReduceStrategyFleet = int


Expand Down Expand Up @@ -204,7 +204,7 @@ def execution_strategy(self):
strategy = paddle.distributed.fleet.DistributedStrategy()
strategy.execution_strategy = exe_strategy
"""
execution_strategy = paddle.fluid.ExecutionStrategy()
execution_strategy = paddle.static.ExecutionStrategy()
fields = self.strategy.execution_strategy.DESCRIPTOR.fields
for f in fields:
setattr(
Expand Down Expand Up @@ -251,7 +251,7 @@ def build_strategy(self):
strategy.build_strategy = build_strategy
"""

build_strategy = paddle.fluid.BuildStrategy()
build_strategy = paddle.static.BuildStrategy()
fields = self.strategy.build_strategy.DESCRIPTOR.fields
for f in fields:
value = getattr(self.strategy.build_strategy, f.name)
Expand Down
10 changes: 5 additions & 5 deletions python/paddle/distributed/fleet/base/role_maker.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from multiprocessing import Process, Manager

import paddle
import paddle.fluid as fluid
import paddle.framework as framework
from paddle.distributed.fleet.base.private_helper_function import (
wait_server_ready,
)
Expand Down Expand Up @@ -128,7 +128,7 @@ def init(

def _init_fs(self, fs_path, prefix):
def init(rank, nodes, role):
gloo = fluid.core.Gloo()
gloo = framework.core.Gloo()
gloo.set_rank(rank)
gloo.set_size(nodes)
gloo.set_prefix(prefix)
Expand Down Expand Up @@ -156,7 +156,7 @@ def init(rank, nodes, role):

def _init_dfs(self, dfs_name, dfs_ugi, dfs_path, prefix):
def init(rank, nodes, role):
gloo = fluid.core.Gloo()
gloo = framework.core.Gloo()
gloo.set_rank(rank)
gloo.set_size(nodes)
gloo.set_prefix(prefix)
Expand Down Expand Up @@ -216,7 +216,7 @@ def init_kv_server(http_server_d):
return _http_server

def init(rank, nodes, role):
gloo = fluid.core.Gloo()
gloo = framework.core.Gloo()
gloo.set_rank(rank)
gloo.set_size(nodes)
gloo.set_prefix(prefix)
Expand Down Expand Up @@ -1175,7 +1175,7 @@ def _generate_role(self):
else:
self._collective_env()
self._role_is_generated = True
if not paddle.fluid.framework._non_static_mode():
if not paddle.framework._non_static_mode():
self._gloo_init()


Expand Down

0 comments on commit 223bbee

Please sign in to comment.