未验证 提交 25a77450 编写于 作者: K kangguangli 提交者: GitHub

remove with_data_parallel in OpTest (#51237)

上级 2bd63c0c
......@@ -943,11 +943,7 @@ class OpTest(unittest.TestCase):
use_cuda = False
if isinstance(place, fluid.CUDAPlace):
use_cuda = True
compiled_prog = fluid.CompiledProgram(
program
).with_data_parallel(
loss_name=loss.name if loss else None, places=place
)
compiled_prog = fluid.CompiledProgram(program)
program = compiled_prog
fetch_list = getattr(self, "fetch_list", [])
# if the fetch_list is customized by user, we use it directly.
......@@ -971,9 +967,7 @@ class OpTest(unittest.TestCase):
build_strategy.enable_inplace = enable_inplace
compiled_prog = fluid.CompiledProgram(
program
).with_data_parallel(
build_strategy=build_strategy, places=place
program, build_strategy=build_strategy
)
program = compiled_prog
......@@ -1273,9 +1267,7 @@ class OpTest(unittest.TestCase):
build_strategy = fluid.BuildStrategy()
build_strategy.enable_inplace = enable_inplace
compiled_program = fluid.CompiledProgram(
grad_program
).with_data_parallel(
loss_name="", build_strategy=build_strategy, places=place
grad_program, build_strategy=build_strategy
)
program = compiled_program
......@@ -2426,9 +2418,7 @@ class OpTest(unittest.TestCase):
use_cuda = False
if isinstance(place, fluid.CUDAPlace):
use_cuda = True
compiled_prog = fluid.CompiledProgram(prog).with_data_parallel(
loss_name=loss.name, places=place
)
compiled_prog = fluid.CompiledProgram(prog)
prog = compiled_prog
executor = fluid.Executor(place)
res = list(
......
......@@ -1041,11 +1041,7 @@ class OpTest(unittest.TestCase):
use_cuda = False
if isinstance(place, fluid.CUDAPlace):
use_cuda = True
compiled_prog = fluid.CompiledProgram(
program
).with_data_parallel(
loss_name=loss.name if loss else None, places=place
)
compiled_prog = fluid.CompiledProgram(program)
program = compiled_prog
fetch_list = getattr(self, "fetch_list", [])
# if the fetch_list is customized by user, we use it directly.
......@@ -1069,9 +1065,7 @@ class OpTest(unittest.TestCase):
build_strategy.enable_inplace = enable_inplace
compiled_prog = fluid.CompiledProgram(
program
).with_data_parallel(
build_strategy=build_strategy, places=place
program, build_strategy=build_strategy
)
program = compiled_prog
......@@ -1371,9 +1365,7 @@ class OpTest(unittest.TestCase):
build_strategy = fluid.BuildStrategy()
build_strategy.enable_inplace = enable_inplace
compiled_program = fluid.CompiledProgram(
grad_program
).with_data_parallel(
loss_name="", build_strategy=build_strategy, places=place
grad_program, build_strategy=build_strategy
)
program = compiled_program
......@@ -2736,9 +2728,7 @@ class OpTest(unittest.TestCase):
use_cuda = False
if isinstance(place, fluid.CUDAPlace):
use_cuda = True
compiled_prog = fluid.CompiledProgram(prog).with_data_parallel(
loss_name=loss.name, places=place
)
compiled_prog = fluid.CompiledProgram(prog)
prog = compiled_prog
executor = fluid.Executor(place)
res = list(
......
......@@ -104,10 +104,9 @@ class TestParallelExecutorBase(unittest.TestCase):
)
if use_parallel_executor:
binary = compiler.CompiledProgram(main).with_data_parallel(
loss_name=loss.name,
binary = compiler.CompiledProgram(
main,
build_strategy=build_strategy,
exec_strategy=exec_strategy,
)
else:
binary = main
......@@ -204,10 +203,9 @@ class TestParallelExecutorBase(unittest.TestCase):
use_device,
)
binary = compiler.CompiledProgram(main).with_data_parallel(
loss_name=loss.name,
binary = compiler.CompiledProgram(
main,
build_strategy=build_strategy,
exec_strategy=exec_strategy,
)
exe.run(binary, feed=feed_dict, fetch_list=[loss.name])
......
......@@ -121,7 +121,6 @@ class TestDygraphDataLoader(unittest.TestCase):
return ret
def test_main(self):
# dynamic graph do not run with_data_parallel
for p in prepare_places():
for persistent_workers in [False, True]:
results = []
......
......@@ -121,7 +121,6 @@ class TestDygraphDataLoader(unittest.TestCase):
return ret
def test_main(self):
# dynamic graph do not run with_data_parallel
for p in prepare_places():
for persistent_workers in [False, True]:
results = []
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册