diff --git a/python/paddle/fluid/tests/unittests/eager_op_test.py b/python/paddle/fluid/tests/unittests/eager_op_test.py index cff3b34fdaf29d9710cd5e4b81e3a837301bed80..d2e21863a87e9d081043127a86c97910abda2815 100644 --- a/python/paddle/fluid/tests/unittests/eager_op_test.py +++ b/python/paddle/fluid/tests/unittests/eager_op_test.py @@ -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( diff --git a/python/paddle/fluid/tests/unittests/op_test.py b/python/paddle/fluid/tests/unittests/op_test.py index d5bfbce28a7a5d1a40baa19ae26b5b59d3efc85e..d9c4cfce2a86e308fd1acb1d96ea960b55f5662a 100644 --- a/python/paddle/fluid/tests/unittests/op_test.py +++ b/python/paddle/fluid/tests/unittests/op_test.py @@ -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( diff --git a/python/paddle/fluid/tests/unittests/parallel_executor_test_base.py b/python/paddle/fluid/tests/unittests/parallel_executor_test_base.py index 5ff55155ccd09a5407831371c31c4006fe429f84..6096300e5efc9ef16f1eef58d3224b83fb6ff365 100644 --- a/python/paddle/fluid/tests/unittests/parallel_executor_test_base.py +++ b/python/paddle/fluid/tests/unittests/parallel_executor_test_base.py @@ -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]) diff --git a/python/paddle/fluid/tests/unittests/test_multiprocess_dataloader_dynamic.py b/python/paddle/fluid/tests/unittests/test_multiprocess_dataloader_dynamic.py index 2fc0f8ac175ef690c5fa09b518aadaef0c2a26f7..03af43716a5cfb20ba3ed261ecc6efa37c4bf7ed 100644 --- a/python/paddle/fluid/tests/unittests/test_multiprocess_dataloader_dynamic.py +++ b/python/paddle/fluid/tests/unittests/test_multiprocess_dataloader_dynamic.py @@ -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 = [] diff --git a/python/paddle/fluid/tests/unittests/test_multiprocess_dataloader_iterable_dataset_dynamic.py b/python/paddle/fluid/tests/unittests/test_multiprocess_dataloader_iterable_dataset_dynamic.py index 3c5b7fa5b3d635b286ab0159a539ab3762c11bfe..e0140621d07d35823da6adab271c13510989a024 100644 --- a/python/paddle/fluid/tests/unittests/test_multiprocess_dataloader_iterable_dataset_dynamic.py +++ b/python/paddle/fluid/tests/unittests/test_multiprocess_dataloader_iterable_dataset_dynamic.py @@ -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 = []