未验证 提交 1fa98c5d 编写于 作者: C Chen Weihang 提交者: GitHub

[Cherry-pick] remove distributed prepare context (#30219) (#30256)

att, cherry-pick of #30219
上级 70cbde83
...@@ -19,7 +19,6 @@ from . import parallel ...@@ -19,7 +19,6 @@ from . import parallel
from .parallel import init_parallel_env from .parallel import init_parallel_env
from .parallel import get_rank from .parallel import get_rank
from .parallel import get_world_size from .parallel import get_world_size
from paddle.fluid.dygraph.parallel import prepare_context #DEFINE_ALIAS
from paddle.fluid.dygraph.parallel import ParallelEnv #DEFINE_ALIAS from paddle.fluid.dygraph.parallel import ParallelEnv #DEFINE_ALIAS
from paddle.distributed.fleet.dataset import * from paddle.distributed.fleet.dataset import *
...@@ -34,7 +33,6 @@ __all__ += [ ...@@ -34,7 +33,6 @@ __all__ += [
"init_parallel_env", "init_parallel_env",
"get_rank", "get_rank",
"get_world_size", "get_world_size",
"prepare_context",
"ParallelEnv", "ParallelEnv",
"InMemoryDataset", "InMemoryDataset",
"QueueDataset", "QueueDataset",
......
...@@ -38,8 +38,7 @@ class TestDirectory(unittest.TestCase): ...@@ -38,8 +38,7 @@ class TestDirectory(unittest.TestCase):
'paddle.enable_static', 'paddle.disable_static', 'paddle.enable_static', 'paddle.disable_static',
'paddle.in_dynamic_mode', 'paddle.to_tensor', 'paddle.grad', 'paddle.in_dynamic_mode', 'paddle.to_tensor', 'paddle.grad',
'paddle.no_grad', 'paddle.static.save', 'paddle.static.load', 'paddle.no_grad', 'paddle.static.save', 'paddle.static.load',
'paddle.distributed.ParallelEnv', 'paddle.distributed.ParallelEnv', 'paddle.DataParallel',
'paddle.distributed.prepare_context', 'paddle.DataParallel',
'paddle.jit', 'paddle.jit.TracedLayer', 'paddle.jit.to_static', 'paddle.jit', 'paddle.jit.TracedLayer', 'paddle.jit.to_static',
'paddle.jit.ProgramTranslator', 'paddle.jit.TranslatedLayer', 'paddle.jit.ProgramTranslator', 'paddle.jit.TranslatedLayer',
'paddle.jit.save', 'paddle.jit.load', 'paddle.jit.save', 'paddle.jit.load',
......
...@@ -43,7 +43,7 @@ class MLP(fluid.Layer): ...@@ -43,7 +43,7 @@ class MLP(fluid.Layer):
class TestDataParallelStateDict(unittest.TestCase): class TestDataParallelStateDict(unittest.TestCase):
def test_data_parallel_state_dict(self): def test_data_parallel_state_dict(self):
with fluid.dygraph.guard(): with fluid.dygraph.guard():
strategy = paddle.distributed.prepare_context() strategy = dygraph.parallel.prepare_context()
mlp = MLP() mlp = MLP()
parallel_mlp = dygraph.parallel.DataParallel(mlp, strategy) parallel_mlp = dygraph.parallel.DataParallel(mlp, strategy)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册