diff --git a/paddle/fluid/framework/parallel_executor.cc b/paddle/fluid/framework/parallel_executor.cc index da3f08782507a2eadabe21c05fd90090a13fde22..144651f1b63cc619da091b90933559318f3d9892 100644 --- a/paddle/fluid/framework/parallel_executor.cc +++ b/paddle/fluid/framework/parallel_executor.cc @@ -59,10 +59,6 @@ PADDLE_DEFINE_EXPORTED_string( "", "Profiler filename for PE, which generated by gperftools." "Only valid when compiled `WITH_PRIFILER=ON`. Empty if disable."); -PADDLE_DEFINE_EXPORTED_bool( - enable_parallel_graph, - false, - "Force disable parallel graph execution mode if set false."); namespace paddle { namespace framework { @@ -1276,9 +1272,7 @@ bool ParallelExecutor::EnableParallelGraphExecution( const ir::Graph &graph, const ExecutionStrategy &exec_strategy, const BuildStrategy &build_strategy) const { - if (!FLAGS_enable_parallel_graph) { - return false; - } + return false; bool enable_parallel_graph = true; diff --git a/python/paddle/fluid/executor.py b/python/paddle/fluid/executor.py index 93ff85e10769452369fc497411bec4c112c3fcc3..49d073d988383bccc21d8e0aff9b78225f55a40d 100755 --- a/python/paddle/fluid/executor.py +++ b/python/paddle/fluid/executor.py @@ -1689,21 +1689,7 @@ class Executor: ) return False - # Unsupported case 2: parallel graph - if core.globals()['FLAGS_enable_parallel_graph'] in [ - 1, - '1', - True, - 'True', - 'true', - ]: - warnings.warn( - "Standalone executor is not used for parallel graph", - UserWarning, - ) - return False - - # Unsupported case 3: inference + # Unsupported case 2: inference if compiled_program._is_inference: warnings.warn( "Standalone executor is not used for inference", @@ -1711,7 +1697,7 @@ class Executor: ) return False - # Unsupported case 4: async mode + # Unsupported case 3: async mode if ( compiled_program._build_strategy is not None and compiled_program._build_strategy.async_mode @@ -1722,7 +1708,7 @@ class Executor: ) return False - # Unsupported case 5: CUDA Graph + # Unsupported case 4: CUDA Graph if ( compiled_program._build_strategy is not None and compiled_program._build_strategy.allow_cuda_graph_capture diff --git a/python/paddle/fluid/tests/unittests/CMakeLists.txt b/python/paddle/fluid/tests/unittests/CMakeLists.txt index 038d3c0ee768e487e54bbcc3b9177cb6aa0146b2..9e703be30e4f96efeed2ae687498c03381f2fc59 100755 --- a/python/paddle/fluid/tests/unittests/CMakeLists.txt +++ b/python/paddle/fluid/tests/unittests/CMakeLists.txt @@ -886,12 +886,8 @@ add_subdirectory(standalone_executor) set_tests_properties( test_buffer_shared_memory_reuse_pass_and_fuse_optimization_op_pass - test_data_norm_op - test_dataloader_keep_order - test_dataloader_unkeep_order - test_parallel_ssa_graph_inference_feed_partial_data - test_buffer_shared_memory_reuse_pass - PROPERTIES LABELS "RUN_TYPE=DIST") + test_data_norm_op test_dataloader_keep_order test_dataloader_unkeep_order + test_buffer_shared_memory_reuse_pass PROPERTIES LABELS "RUN_TYPE=DIST") set_tests_properties( test_sync_batch_norm_op test_inplace_abn_op @@ -1018,8 +1014,6 @@ set_tests_properties(test_imperative_selected_rows_to_lod_tensor PROPERTIES TIMEOUT 200) set_tests_properties(test_index_select_op PROPERTIES TIMEOUT 120) set_tests_properties(test_index_add_op PROPERTIES TIMEOUT 120) -set_tests_properties(test_parallel_ssa_graph_inference_feed_partial_data - PROPERTIES TIMEOUT 120) set_tests_properties(test_tensordot PROPERTIES TIMEOUT 200) set_tests_properties(test_partial_eager_deletion_transformer PROPERTIES TIMEOUT 120) diff --git a/python/paddle/fluid/tests/unittests/asp/test_fleet_with_asp_sharding.py b/python/paddle/fluid/tests/unittests/asp/test_fleet_with_asp_sharding.py index 147bd9128bf30aab7886ea41a2cbbb08de6dc9ca..36c11bf8f86aabbe73d94ee1af8967de5c99fa44 100644 --- a/python/paddle/fluid/tests/unittests/asp/test_fleet_with_asp_sharding.py +++ b/python/paddle/fluid/tests/unittests/asp/test_fleet_with_asp_sharding.py @@ -40,7 +40,6 @@ class TestFleetWithASPSharding(unittest.TestCase): os.environ["PADDLE_TRAINERS_NUM"] = "1" os.environ["PADDLE_TRAINER_ID"] = "0" - os.environ['FLAGS_enable_parallel_graph'] = "0" os.environ['FLAGS_fraction_of_gpu_memory_to_use'] = "0.1" os.environ['FLAGS_sync_nccl_allreduce'] = "1" os.environ['FLAGS_eager_delete_tensor_gb'] = "0" diff --git a/python/paddle/fluid/tests/unittests/test_parallel_executor_pg.py b/python/paddle/fluid/tests/unittests/test_parallel_executor_pg.py deleted file mode 100644 index 43f6801b360c3ae6e0549bb1fd80ad3f1bc34336..0000000000000000000000000000000000000000 --- a/python/paddle/fluid/tests/unittests/test_parallel_executor_pg.py +++ /dev/null @@ -1,87 +0,0 @@ -# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import os -import unittest - -import numpy as np - -os.environ['FLAGS_enable_parallel_graph'] = str(1) -import os - -from parallel_executor_test_base import DeviceType, TestParallelExecutorBase -from simple_nets import init_data, simple_fc_net - -import paddle.fluid.core as core - - -class TestMNIST(TestParallelExecutorBase): - @classmethod - def setUpClass(cls): - os.environ['CPU_NUM'] = str(4) - - # simple_fc - def check_simple_fc_convergence(self, use_device, use_reduce=False): - if use_device == DeviceType.CUDA and not core.is_compiled_with_cuda(): - return - - img, label = init_data() - self.check_network_convergence( - simple_fc_net, - feed_dict={"image": img, "label": label}, - use_device=use_device, - use_reduce=use_reduce, - ) - - def test_simple_fc(self): - # use_device - self.check_simple_fc_convergence(True) - - def check_simple_fc_parallel_accuracy(self, use_device): - if use_device and not core.is_compiled_with_cuda(): - return - - img, label = init_data() - single_first_loss, single_last_loss, _ = self.check_network_convergence( - method=simple_fc_net, - feed_dict={"image": img, "label": label}, - use_device=use_device, - use_parallel_executor=False, - ) - ( - parallel_first_loss, - parallel_last_loss, - _, - ) = self.check_network_convergence( - method=simple_fc_net, - feed_dict={"image": img, "label": label}, - use_device=use_device, - use_parallel_executor=True, - ) - - self.assertAlmostEqual( - np.mean(parallel_first_loss), - single_first_loss, - delta=1e-6, - ) - self.assertAlmostEqual( - np.mean(parallel_last_loss), single_last_loss, delta=1e-6 - ) - - def test_simple_fc_parallel_accuracy(self): - self.check_simple_fc_parallel_accuracy(DeviceType.CUDA) - - -if __name__ == '__main__': - unittest.main() diff --git a/python/paddle/fluid/tests/unittests/test_parallel_ssa_graph_inference_feed_partial_data.py b/python/paddle/fluid/tests/unittests/test_parallel_ssa_graph_inference_feed_partial_data.py deleted file mode 100644 index fe318e772c5c65be92e486844d8ba70d35ba98cc..0000000000000000000000000000000000000000 --- a/python/paddle/fluid/tests/unittests/test_parallel_ssa_graph_inference_feed_partial_data.py +++ /dev/null @@ -1,22 +0,0 @@ -# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import unittest - -import paddle.fluid as fluid - -fluid.core.globals()['FLAGS_enable_parallel_graph'] = 1 - -if __name__ == '__main__': - unittest.main() diff --git a/tools/parallel_UT_rule.py b/tools/parallel_UT_rule.py index 29a4ce26a5b265e8c57efb9839d740ab6ac73e63..90f6f3600e3fdd631feadc87788cd2b94433fb98 100755 --- a/tools/parallel_UT_rule.py +++ b/tools/parallel_UT_rule.py @@ -1492,7 +1492,6 @@ FOURTH_HIGH_PARALLEL_JOB_NEW = [ 'float16_gpu_test', 'test_dict', 'test_bilinear_tensor_product_op', - 'test_parallel_executor_pg', 'test_assert', 'test_smooth_l1_loss_op', 'sequence_padding_test', @@ -1508,7 +1507,6 @@ FOURTH_HIGH_PARALLEL_JOB_NEW = [ 'test_inplace_abn_op', 'test_parallel_executor_seresnext_base_gpu', 'test_parallel_executor_seresnext_with_fuse_all_reduce_gpu', - 'test_parallel_ssa_graph_inference_feed_partial_data', 'test_parallel_executor_seresnext_with_reduce_gpu', 'test_data_norm_op', 'test_install_check', @@ -2351,7 +2349,6 @@ TETRAD_PARALLEL_JOB = [ 'test_transforms', 'test_sum_op', 'test_scatter_op', - 'test_parallel_executor_pg', 'test_mix_precision_all_reduce_fuse', 'test_tensorrt_engine_op', 'test_zeropad2d', @@ -2657,7 +2654,6 @@ TWO_PARALLEL_JOB = [ 'test_sigmoid_cross_entropy_with_logits_op', 'test_regularizer_api', 'test_lrn_op', - 'test_parallel_ssa_graph_inference_feed_partial_data', 'test_lod_reset_op', 'test_install_check', 'test_anchor_generator_op', diff --git a/tools/static_mode_white_list.py b/tools/static_mode_white_list.py index 5edb12a6d45ffe688d2f0c757fb62f6d8209496d..3d7e2654a4f6390d92fe7500dbaa501ad3f1d245 100755 --- a/tools/static_mode_white_list.py +++ b/tools/static_mode_white_list.py @@ -370,7 +370,6 @@ STATIC_MODE_TESTING_LIST = [ 'test_pairwise_distance', 'test_parallel_executor_drop_scope', 'test_parallel_executor_run_load_infer_program', - 'test_parallel_ssa_graph_inference_feed_partial_data', 'test_parameter', 'test_partial_concat_op', 'test_partial_eager_deletion_transformer', @@ -650,7 +649,6 @@ STATIC_MODE_TESTING_LIST = [ 'test_fused_multihead_matmul_op', 'test_ir_inplace_pass', 'test_mix_precision_all_reduce_fuse', - 'test_parallel_executor_pg', 'test_rank_attention_op', 'test_fleet_base', 'test_fleet_graph_executor', diff --git a/tools/windows/run_unittests.sh b/tools/windows/run_unittests.sh index 535846c4ccdd17868edbfc9b4c5dcb8399300115..20c84c778d8024a6e939e3c5b66905b4458fab8b 100644 --- a/tools/windows/run_unittests.sh +++ b/tools/windows/run_unittests.sh @@ -32,7 +32,6 @@ disable_wingpu_test="^test_model$|\ ^test_multiprocess_dataloader_iterable_dataset_dynamic$|\ ^test_parallel_executor_feed_persistable_var$|\ ^test_parallel_executor_inference_feed_partial_data$|\ -^test_parallel_ssa_graph_inference_feed_partial_data$|\ ^test_py_reader_combination$|\ ^test_py_reader_pin_memory$|\ ^test_py_reader_push_pop$|\ @@ -145,7 +144,6 @@ disable_win_inference_test="^trt_quant_int8_yolov3_r50_test$|\ ^test_py_reader_push_pop$|\ ^test_parallel_executor_feed_persistable_var$|\ ^test_parallel_executor_inference_feed_partial_data$|\ -^test_parallel_ssa_graph_inference_feed_partial_data$|\ ^test_reader_reset$|\ ^test_parallel_executor_seresnext_base_gpu$|\ ^test_py_reader_pin_memory$|\