From 9eb4d89b8db07908ed14d9f83ec6082ebd64a857 Mon Sep 17 00:00:00 2001 From: Roc <30228238+sljlp@users.noreply.github.com> Date: Fri, 26 Aug 2022 19:24:18 +0800 Subject: [PATCH] move collective tests into a collective directory (#45223) * add simple reformated ci files * update * add radme for new unitetsts * add radme for new unitetsts * add radme for new unitetsts * reset mlu * update for samples * add base api * reset some dist unit tests * add warning in grenerated cmakelists file * update readme for new dist unit tests * add all collective tests * remain base file and launcher file * Update README.md * Update README.md * fix env PYTHONPATH * Update gen_ut_cmakelists.py * add all collective tests * add docs for gen_ut_cmakelists.py * pretify codes * commont name == "name" * update for comments * update function's help * update for run type * update readme * add all collective tests * add all collective tests * mv collective test files * update for all collective tests * update * update * update * update for all tests * update for checking name * Update Cmakelists.txt * update testlist.csv * remain test_parallel_dygraph_dataparallel in unittests * set broadcast op all platforms * update * remain test_broadcast_tensors_op * fix * rm some collective files * update more colective tests * update * update * update gen_ut_supports recursion * update * update * update * update * fix nccl version * update * update * update * update * fix a bug and try to pass * update * add csv * update for timeout * remove tcp store * fix * fix * update * update * update for more dist tests * move multi node tests * update * update * update * fix for auto parallele * update * update path in python file * update * reset some test in unittests * fix * update readme * fix * update * fix port --- CMakeLists.txt | 12 + .../fluid/tests/unittests/CMakeLists.txt | 439 +-------- .../tests/unittests/collective/CMakeLists.txt | 267 +++++- .../tests/unittests/collective/README.md | 9 +- .../collective_allgather_api.py | 0 .../collective_allgather_api_dygraph.py | 0 ...collective_allgather_object_api_dygraph.py | 0 .../collective_allreduce_api.py | 0 .../collective_allreduce_new_group_api.py | 0 .../collective_allreduce_op_wait.py | 0 .../collective_alltoall_api.py | 0 .../collective_alltoall_api_dygraph.py | 0 .../collective_alltoall_single.py | 0 .../collective_barrier_api.py | 0 .../collective_batch_isend_irecv.py | 0 .../collective_broadcast_api.py | 0 .../collective_global_gather.py | 0 .../collective_global_gather_dygraph.py | 0 .../collective_global_scatter.py | 0 .../collective_global_scatter_dygraph.py | 0 .../{ => collective}/collective_reduce_api.py | 0 .../{ => collective}/collective_reduce_op.py | 0 .../collective_reduce_op_calc_stream.py | 0 .../collective_reduce_scatter.py | 0 .../collective_scatter_api.py | 0 .../{ => collective}/collective_scatter_op.py | 0 .../collective_sendrecv_api.py | 0 .../collective_sendrecv_api_dygraph.py | 0 .../collective_sendrecv_op.py | 0 .../collective_sendrecv_op_array.py | 0 .../collective_sendrecv_op_dynamic_shape.py | 0 .../column_parallel_linear_api.py | 0 .../unittests/collective/fleet/CMakeLists.txt | 865 ++++++++++++++++++ .../fleet}/auto_parallel_parallelizer.py | 0 .../{ => collective/fleet}/c_comm_init_op.py | 0 .../fleet}/dist_mnist_gradient_merge.py | 0 ...dist_mnist_gradient_merge_raw_optimizer.py | 0 .../fleet}/dygraph_group_sharded_api.py | 0 .../fleet}/dygraph_group_sharded_api_eager.py | 0 .../fleet}/dygraph_group_sharded_stage2.py | 0 .../dygraph_group_sharded_stage2_offload.py | 0 .../fleet}/dygraph_group_sharded_stage3.py | 0 .../dygraph_group_sharded_stage3_offload.py | 0 .../dygraph_sharding_optimizer_stage2.py | 0 .../fleet}/dygraph_sharding_stage2.py | 0 .../fleet}/dygraph_sharding_stage2_offload.py | 0 .../fleet}/dygraph_sharding_stage3.py | 0 .../fleet}/dygraph_sharding_stage3_offload.py | 0 .../hybrid_parallel_communicate_group.py | 0 .../hybrid_parallel_inference_helper.py | 0 .../fleet}/hybrid_parallel_mp_amp.py | 0 .../fleet}/hybrid_parallel_mp_clip_grad.py | 0 .../fleet}/hybrid_parallel_mp_fp16.py | 0 .../fleet}/hybrid_parallel_mp_layers.py | 0 .../fleet}/hybrid_parallel_mp_model.py | 0 .../fleet}/hybrid_parallel_mp_random.py | 0 .../fleet}/hybrid_parallel_pp_amp.py | 0 .../fleet}/hybrid_parallel_pp_clip_grad.py | 0 .../fleet}/hybrid_parallel_pp_embedding.py | 0 .../fleet}/hybrid_parallel_pp_fp16.py | 0 .../fleet}/hybrid_parallel_pp_recompute.py | 0 .../fleet}/hybrid_parallel_pp_save_load.py | 0 .../fleet}/hybrid_parallel_pp_transformer.py | 0 .../fleet}/hybrid_parallel_qat.py | 0 .../fleet}/hybrid_parallel_sharding_model.py | 0 .../fleet}/hybrid_parallel_shared_weight.py | 0 .../{ => collective/fleet}/new_group.py | 0 .../fleet}/parallel_class_center_sample.py | 0 ...parallel_dygraph_control_flow_different.py | 0 .../parallel_dygraph_control_flow_same.py | 0 .../fleet}/parallel_dygraph_no_sync.py | 0 .../parallel_dygraph_no_sync_control_flow.py | 0 ...parallel_dygraph_no_sync_gradient_check.py | 0 .../parallel_dygraph_no_sync_unused_params.py | 0 .../fleet}/parallel_dygraph_se_resnext.py | 0 .../parallel_dygraph_sync_batch_norm.py | 0 .../fleet}/parallel_dygraph_transformer.py | 0 .../fleet}/parallel_margin_cross_entropy.py | 0 .../{ => collective/fleet}/pipeline_mnist.py | 0 .../fleet}/pipeline_mnist_multi_device.py | 0 .../fleet}/pipeline_mnist_one_device.py | 0 .../fleet}/static_model_parallel_by_col.py | 0 .../fleet}/static_model_parallel_by_row.py | 0 .../fleet}/static_model_parallel_embedding.py | 0 .../fleet}/test_auto_parallel_parallelizer.py | 0 .../fleet}/test_c_comm_init_op.sh | 0 .../fleet}/test_communicator_half_async.py | 0 .../fleet}/test_communicator_sync.py | 0 .../fleet}/test_dgc_momentum_op.py | 0 .../{ => collective/fleet}/test_dgc_op.py | 0 .../fleet}/test_dgc_optimizer.py | 0 .../fleet}/test_dist_mnist_dgc_nccl.py | 11 +- .../fleet}/test_dist_mnist_gradient_merge.py | 0 .../fleet}/test_dist_se_resnext_dgc.py | 4 +- .../fleet}/test_distributed_strategy.py | 0 .../fleet}/test_dygraph_group_sharded_api.py | 0 ...est_dygraph_group_sharded_api_for_eager.py | 0 .../fleet}/test_dygraph_recompute.py | 0 .../test_dygraph_recompute_for_eager.py | 0 .../test_dygraph_sharding_optimizer_stage2.py | 0 .../fleet}/test_dygraph_sharding_stage2.py | 0 .../fleet}/test_dygraph_sharding_stage3.py | 0 .../test_dygraph_sharding_stage3_for_eager.py | 0 .../fleet}/test_fleet_amp_init.py | 0 .../fleet}/test_fleet_amp_meta_optimizer.py | 0 .../fleet}/test_fleet_dgc_meta_optimizer.py | 0 .../fleet}/test_fleet_distributed_strategy.py | 0 ...est_fleet_fp16_allreduce_meta_optimizer.py | 0 ...est_fleet_gradient_merge_meta_optimizer.py | 0 ...st_fleet_graph_execution_meta_optimizer.py | 0 .../fleet}/test_fleet_graph_executor.py | 0 .../test_fleet_hybrid_meta_optimizer.py | 0 .../fleet}/test_fleet_lamb_meta_optimizer.py | 0 .../fleet}/test_fleet_lars_meta_optimizer.py | 0 .../test_fleet_localsgd_meta_optimizer.py | 0 .../fleet}/test_fleet_meta_optimizer_base.py | 0 .../test_fleet_pipeline_meta_optimizer.py | 0 ..._pipeline_meta_optimizer_with_recompute.py | 0 .../fleet}/test_fleet_private_function.py | 0 .../test_fleet_raw_program_meta_optimizer.py | 0 .../test_fleet_recompute_meta_optimizer.py | 0 .../fleet}/test_fleet_rolemaker_new.py | 0 .../test_fleet_sharding_meta_optimizer.py | 0 .../fleet}/test_fleet_static_mp_layers.py | 0 .../fleet}/test_fleet_utils.py | 0 .../test_hybrid_parallel_inference_helper.py | 0 .../test_imperative_auto_mixed_precision.py | 0 ...perative_auto_mixed_precision_for_eager.py | 0 .../fleet}/test_ir_pass_pipeline.py | 0 .../fleet}/test_mixed_precision.py | 0 .../{ => collective/fleet}/test_new_group.sh | 0 .../test_parallel_class_center_sample.py | 0 .../test_parallel_dygraph_control_flow.py | 0 .../fleet}/test_parallel_dygraph_mnist.py | 36 +- .../fleet}/test_parallel_dygraph_mp_layers.py | 0 .../fleet}/test_parallel_dygraph_no_sync.py | 0 ...parallel_dygraph_no_sync_gradient_check.py | 0 ...test_parallel_dygraph_pipeline_parallel.py | 7 +- .../fleet}/test_parallel_dygraph_qat.py | 0 .../test_parallel_dygraph_se_resnext.py | 0 ...test_parallel_dygraph_sharding_parallel.py | 0 .../test_parallel_dygraph_sparse_embedding.py | 12 +- ...el_dygraph_sparse_embedding_over_height.py | 10 +- .../test_parallel_dygraph_sync_batch_norm.py | 0 .../test_parallel_dygraph_tensor_parallel.py | 0 .../test_parallel_dygraph_transformer.py | 0 .../test_parallel_dygraph_unused_variables.py | 27 +- .../test_parallel_margin_cross_entropy.py | 0 .../{ => collective/fleet}/test_pipeline.py | 0 .../fleet}/test_recv_save_op.py | 0 .../{ => collective/fleet}/test_rnn_dp.py | 0 .../fleet}/test_static_model_parallel.py | 0 .../{ => collective/fleet}/test_tcp_store.py | 0 .../unittests/collective/fleet/testslist.csv | 73 ++ .../{ => collective}/init_process_group.py | 0 .../collective/multinode/CMakeLists.txt | 48 + .../{ => collective/multinode}/common.py | 0 .../multinode}/dygraph_hybrid_dp.py | 0 .../multinode}/dygraph_hybrid_dpppmp.py | 0 .../multinode}/dygraph_hybrid_fp16.py | 0 .../multinode}/dygraph_hybrid_recompute.py | 0 .../mn_dygraph_group_sharded_stage3.py | 0 .../multinode}/mn_dygraph_sharding_stage2.py | 0 .../multinode}/multinode_dist_test.sh | 0 .../multinode}/test_collective_multi_nodes.py | 0 .../test_multinode_dygraph_hybrid_dp.py | 0 .../test_multinode_dygraph_hybrid_dpppmp.py | 0 .../test_multinode_dygraph_sharding.py | 0 .../collective/multinode/testslist.csv | 4 + .../{ => collective}/process_group_gloo.py | 0 .../{ => collective}/process_group_nccl.py | 0 .../row_parallel_linear_api.py | 0 .../test_collective_allgather_api.py | 0 .../test_collective_allgather_object_api.py | 0 .../test_collective_allreduce_api.py | 0 .../test_collective_alltoall_api.py | 0 .../test_collective_alltoall_single.py | 0 .../test_collective_barrier_api.py | 0 .../test_collective_batch_isend_irecv.py | 0 .../test_collective_broadcast_api.py | 0 .../test_collective_cpu_barrier_with_gloo.py | 0 .../test_collective_global_gather.py | 0 .../test_collective_global_scatter.py | 0 .../test_collective_optimizer.py | 0 .../test_collective_process_group.py | 0 .../test_collective_reduce.py | 0 .../test_collective_reduce_api.py | 0 .../test_collective_reduce_scatter.py | 0 .../test_collective_scatter.py | 0 .../test_collective_scatter_api.py | 0 .../test_collective_sendrecv.py | 0 .../test_collective_sendrecv_api.py | 0 .../test_collective_split_col_linear.py | 0 ...llective_split_embedding_none_divisible.py | 0 .../test_collective_split_row_linear.py | 0 .../{ => collective}/test_collective_wait.py | 0 .../{ => collective}/test_eager_dist_api.py | 0 .../{ => collective}/test_gen_nccl_id_op.py | 0 .../{ => collective}/test_new_group_api.py | 0 .../tests/unittests/collective/testslist.csv | 41 +- tools/gen_ut_cmakelists.py | 113 ++- 201 files changed, 1451 insertions(+), 527 deletions(-) rename python/paddle/fluid/tests/unittests/{ => collective}/collective_allgather_api.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective}/collective_allgather_api_dygraph.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective}/collective_allgather_object_api_dygraph.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective}/collective_allreduce_api.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective}/collective_allreduce_new_group_api.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective}/collective_allreduce_op_wait.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective}/collective_alltoall_api.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective}/collective_alltoall_api_dygraph.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective}/collective_alltoall_single.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective}/collective_barrier_api.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective}/collective_batch_isend_irecv.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective}/collective_broadcast_api.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective}/collective_global_gather.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective}/collective_global_gather_dygraph.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective}/collective_global_scatter.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective}/collective_global_scatter_dygraph.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective}/collective_reduce_api.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective}/collective_reduce_op.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective}/collective_reduce_op_calc_stream.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective}/collective_reduce_scatter.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective}/collective_scatter_api.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective}/collective_scatter_op.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective}/collective_sendrecv_api.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective}/collective_sendrecv_api_dygraph.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective}/collective_sendrecv_op.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective}/collective_sendrecv_op_array.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective}/collective_sendrecv_op_dynamic_shape.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective}/column_parallel_linear_api.py (100%) create mode 100644 python/paddle/fluid/tests/unittests/collective/fleet/CMakeLists.txt rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/auto_parallel_parallelizer.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/c_comm_init_op.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/dist_mnist_gradient_merge.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/dist_mnist_gradient_merge_raw_optimizer.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/dygraph_group_sharded_api.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/dygraph_group_sharded_api_eager.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/dygraph_group_sharded_stage2.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/dygraph_group_sharded_stage2_offload.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/dygraph_group_sharded_stage3.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/dygraph_group_sharded_stage3_offload.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/dygraph_sharding_optimizer_stage2.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/dygraph_sharding_stage2.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/dygraph_sharding_stage2_offload.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/dygraph_sharding_stage3.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/dygraph_sharding_stage3_offload.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/hybrid_parallel_communicate_group.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/hybrid_parallel_inference_helper.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/hybrid_parallel_mp_amp.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/hybrid_parallel_mp_clip_grad.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/hybrid_parallel_mp_fp16.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/hybrid_parallel_mp_layers.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/hybrid_parallel_mp_model.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/hybrid_parallel_mp_random.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/hybrid_parallel_pp_amp.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/hybrid_parallel_pp_clip_grad.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/hybrid_parallel_pp_embedding.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/hybrid_parallel_pp_fp16.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/hybrid_parallel_pp_recompute.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/hybrid_parallel_pp_save_load.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/hybrid_parallel_pp_transformer.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/hybrid_parallel_qat.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/hybrid_parallel_sharding_model.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/hybrid_parallel_shared_weight.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/new_group.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/parallel_class_center_sample.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/parallel_dygraph_control_flow_different.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/parallel_dygraph_control_flow_same.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/parallel_dygraph_no_sync.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/parallel_dygraph_no_sync_control_flow.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/parallel_dygraph_no_sync_gradient_check.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/parallel_dygraph_no_sync_unused_params.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/parallel_dygraph_se_resnext.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/parallel_dygraph_sync_batch_norm.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/parallel_dygraph_transformer.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/parallel_margin_cross_entropy.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/pipeline_mnist.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/pipeline_mnist_multi_device.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/pipeline_mnist_one_device.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/static_model_parallel_by_col.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/static_model_parallel_by_row.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/static_model_parallel_embedding.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/test_auto_parallel_parallelizer.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/test_c_comm_init_op.sh (100%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/test_communicator_half_async.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/test_communicator_sync.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/test_dgc_momentum_op.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/test_dgc_op.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/test_dgc_optimizer.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/test_dist_mnist_dgc_nccl.py (91%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/test_dist_mnist_gradient_merge.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/test_dist_se_resnext_dgc.py (94%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/test_distributed_strategy.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/test_dygraph_group_sharded_api.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/test_dygraph_group_sharded_api_for_eager.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/test_dygraph_recompute.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/test_dygraph_recompute_for_eager.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/test_dygraph_sharding_optimizer_stage2.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/test_dygraph_sharding_stage2.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/test_dygraph_sharding_stage3.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/test_dygraph_sharding_stage3_for_eager.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/test_fleet_amp_init.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/test_fleet_amp_meta_optimizer.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/test_fleet_dgc_meta_optimizer.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/test_fleet_distributed_strategy.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/test_fleet_fp16_allreduce_meta_optimizer.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/test_fleet_gradient_merge_meta_optimizer.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/test_fleet_graph_execution_meta_optimizer.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/test_fleet_graph_executor.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/test_fleet_hybrid_meta_optimizer.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/test_fleet_lamb_meta_optimizer.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/test_fleet_lars_meta_optimizer.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/test_fleet_localsgd_meta_optimizer.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/test_fleet_meta_optimizer_base.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/test_fleet_pipeline_meta_optimizer.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/test_fleet_pipeline_meta_optimizer_with_recompute.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/test_fleet_private_function.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/test_fleet_raw_program_meta_optimizer.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/test_fleet_recompute_meta_optimizer.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/test_fleet_rolemaker_new.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/test_fleet_sharding_meta_optimizer.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/test_fleet_static_mp_layers.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/test_fleet_utils.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/test_hybrid_parallel_inference_helper.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/test_imperative_auto_mixed_precision.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/test_imperative_auto_mixed_precision_for_eager.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/test_ir_pass_pipeline.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/test_mixed_precision.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/test_new_group.sh (100%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/test_parallel_class_center_sample.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/test_parallel_dygraph_control_flow.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/test_parallel_dygraph_mnist.py (75%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/test_parallel_dygraph_mp_layers.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/test_parallel_dygraph_no_sync.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/test_parallel_dygraph_no_sync_gradient_check.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/test_parallel_dygraph_pipeline_parallel.py (92%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/test_parallel_dygraph_qat.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/test_parallel_dygraph_se_resnext.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/test_parallel_dygraph_sharding_parallel.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/test_parallel_dygraph_sparse_embedding.py (86%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/test_parallel_dygraph_sparse_embedding_over_height.py (84%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/test_parallel_dygraph_sync_batch_norm.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/test_parallel_dygraph_tensor_parallel.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/test_parallel_dygraph_transformer.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/test_parallel_dygraph_unused_variables.py (76%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/test_parallel_margin_cross_entropy.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/test_pipeline.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/test_recv_save_op.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/test_rnn_dp.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/test_static_model_parallel.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/fleet}/test_tcp_store.py (100%) create mode 100644 python/paddle/fluid/tests/unittests/collective/fleet/testslist.csv rename python/paddle/fluid/tests/unittests/{ => collective}/init_process_group.py (100%) create mode 100644 python/paddle/fluid/tests/unittests/collective/multinode/CMakeLists.txt rename python/paddle/fluid/tests/unittests/{ => collective/multinode}/common.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/multinode}/dygraph_hybrid_dp.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/multinode}/dygraph_hybrid_dpppmp.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/multinode}/dygraph_hybrid_fp16.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/multinode}/dygraph_hybrid_recompute.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/multinode}/mn_dygraph_group_sharded_stage3.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/multinode}/mn_dygraph_sharding_stage2.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/multinode}/multinode_dist_test.sh (100%) rename python/paddle/fluid/tests/unittests/{ => collective/multinode}/test_collective_multi_nodes.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/multinode}/test_multinode_dygraph_hybrid_dp.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/multinode}/test_multinode_dygraph_hybrid_dpppmp.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective/multinode}/test_multinode_dygraph_sharding.py (100%) create mode 100644 python/paddle/fluid/tests/unittests/collective/multinode/testslist.csv rename python/paddle/fluid/tests/unittests/{ => collective}/process_group_gloo.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective}/process_group_nccl.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective}/row_parallel_linear_api.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective}/test_collective_allgather_api.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective}/test_collective_allgather_object_api.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective}/test_collective_allreduce_api.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective}/test_collective_alltoall_api.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective}/test_collective_alltoall_single.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective}/test_collective_barrier_api.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective}/test_collective_batch_isend_irecv.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective}/test_collective_broadcast_api.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective}/test_collective_cpu_barrier_with_gloo.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective}/test_collective_global_gather.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective}/test_collective_global_scatter.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective}/test_collective_optimizer.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective}/test_collective_process_group.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective}/test_collective_reduce.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective}/test_collective_reduce_api.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective}/test_collective_reduce_scatter.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective}/test_collective_scatter.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective}/test_collective_scatter_api.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective}/test_collective_sendrecv.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective}/test_collective_sendrecv_api.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective}/test_collective_split_col_linear.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective}/test_collective_split_embedding_none_divisible.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective}/test_collective_split_row_linear.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective}/test_collective_wait.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective}/test_eager_dist_api.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective}/test_gen_nccl_id_op.py (100%) rename python/paddle/fluid/tests/unittests/{ => collective}/test_new_group_api.py (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 762fd17909b..49ccb815c99 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -364,6 +364,18 @@ if(WIN32) endif() endif() +if(NOT WITH_TESTING AND WITH_MULTINODE_TESTING) + message( + WARNING + "Disable WITH_MULTINODE_TESTING when compiling without TESTING. Force WITH_MULTINODE_TESTING=OFF." + ) + set(WITH_MULTINODE_TESTING + OFF + CACHE STRING + "Disable WITH_MULTINODE_TESTING when compiling without TESTING" + FORCE) +endif() + if(NOT WITH_GPU AND WITH_NCCL) message( WARNING "Disable NCCL when compiling without GPU. Force WITH_NCCL=OFF.") diff --git a/python/paddle/fluid/tests/unittests/CMakeLists.txt b/python/paddle/fluid/tests/unittests/CMakeLists.txt index f05cbdebca9..d1b82387f9d 100755 --- a/python/paddle/fluid/tests/unittests/CMakeLists.txt +++ b/python/paddle/fluid/tests/unittests/CMakeLists.txt @@ -7,20 +7,11 @@ set(GC_ENVS FLAGS_eager_delete_tensor_gb=0.0 FLAGS_fast_eager_deletion_mode=1 FLAGS_memory_fraction_of_eager_deletion=1.0) set(dist_ENVS http_proxy="" https_proxy="") -file( - GLOB MULTINODE_DIST_TEST_OPS - RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" - "test_multinode_*.py") -string(REPLACE ".py" "" MULTINODE_DIST_TEST_OPS "${MULTINODE_DIST_TEST_OPS}") - file( GLOB DIST_TEST_OPS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "test_dist_*.py") list(REMOVE_ITEM DIST_TEST_OPS "test_dist_op") -if((NOT WITH_NCCL) AND (NOT WITH_RCCL)) - list(REMOVE_ITEM DIST_TEST_OPS "test_dist_mnist_dgc_nccl") -endif() string(REPLACE ".py" "" DIST_TEST_OPS "${DIST_TEST_OPS}") @@ -32,77 +23,22 @@ if((NOT WITH_GPU) list(REMOVE_ITEM DIST_TEST_OPS "test_dist_fleet_ps_gpu_ctr") list(REMOVE_ITEM DIST_TEST_OPS "test_dist_mnist_batch_merge") endif() - -list(APPEND DIST_TEST_OPS test_parallel_dygraph_mnist) -list(APPEND DIST_TEST_OPS test_pipeline) -list(APPEND DIST_TEST_OPS test_ir_pass_pipeline) -list(APPEND DIST_TEST_OPS test_static_model_parallel) +list(APPEND DIST_TEST_OPS test_parallel_dygraph_dataparallel) list(APPEND DIST_TEST_OPS test_static_model_parallel_fused_feedforward) list(APPEND DIST_TEST_OPS test_static_model_parallel_fused_attention) list(APPEND DIST_TEST_OPS test_static_model_parallel_fused_multi_transformer) -list(APPEND DIST_TEST_OPS test_parallel_dygraph_se_resnext) -list(APPEND DIST_TEST_OPS test_parallel_dygraph_sparse_embedding) -list(APPEND DIST_TEST_OPS test_parallel_dygraph_sparse_embedding_over_height) -list(APPEND DIST_TEST_OPS test_parallel_dygraph_transformer) -if(WITH_GPU - OR WITH_XPU - OR WITH_ASCEND - OR WITH_ASCEND_CL) - list(APPEND DIST_TEST_OPS test_fleet_graph_execution_meta_optimizer) - list(APPEND DIST_TEST_OPS test_fleet_pipeline_meta_optimizer) - list(APPEND DIST_TEST_OPS test_fleet_pipeline_meta_optimizer_with_recompute) - list(APPEND DIST_TEST_OPS test_fleet_raw_program_meta_optimizer) - list(APPEND DIST_TEST_OPS test_gen_nccl_id_op) - list(APPEND DIST_TEST_OPS test_rnn_dp) -endif() -list(APPEND DIST_TEST_OPS test_parallel_dygraph_unused_variables) -list(APPEND DIST_TEST_OPS test_parallel_dygraph_control_flow) -list(APPEND DIST_TEST_OPS test_parallel_dygraph_no_sync) -list(APPEND DIST_TEST_OPS test_parallel_dygraph_no_sync_gradient_check) -list(APPEND DIST_TEST_OPS test_parallel_dygraph_dataparallel) -list(APPEND DIST_TEST_OPS test_parallel_dygraph_pipeline_parallel) list(APPEND DIST_TEST_OPS test_parallel_dygraph_pipeline_parallel_with_virtual_stage) -list(APPEND DIST_TEST_OPS test_parallel_dygraph_tensor_parallel) -list(APPEND DIST_TEST_OPS test_parallel_dygraph_sharding_parallel) -list(APPEND DIST_TEST_OPS test_dygraph_sharding_optimizer_stage2) -list(APPEND DIST_TEST_OPS test_dygraph_sharding_stage2) -list(APPEND DIST_TEST_OPS test_dygraph_sharding_stage3) -list(APPEND DIST_TEST_OPS test_dygraph_sharding_stage3_for_eager) -list(APPEND DIST_TEST_OPS test_dygraph_group_sharded_api) -list(APPEND DIST_TEST_OPS test_dygraph_group_sharded_api_for_eager) -list(APPEND DIST_TEST_OPS test_auto_parallel_parallelizer) -list(APPEND DIST_TEST_OPS test_parallel_dygraph_mp_layers) -list(APPEND DIST_TEST_OPS test_hybrid_parallel_inference_helper) -list(APPEND DIST_TEST_OPS test_parallel_class_center_sample) -list(APPEND DIST_TEST_OPS test_parallel_margin_cross_entropy) list(APPEND DIST_TEST_OPS test_auto_parallel_data_unshard) list(APPEND DIST_TEST_OPS test_auto_parallel_save_load) list(APPEND DIST_TEST_OPS test_auto_parallel_autoconvert) -list(APPEND DIST_TEST_OPS test_collective_process_group) -list(APPEND DIST_TEST_OPS test_collective_alltoall_single) -list(APPEND DIST_TEST_OPS test_eager_dist_api) -list(APPEND DIST_TEST_OPS test_collective_batch_isend_irecv) -list(APPEND DIST_TEST_OPS test_collective_reduce_scatter) -list(APPEND DIST_TEST_OPS test_parallel_dygraph_qat) set(MIXED_DIST_TEST_OPS ${DIST_TEST_OPS}) #remove distribute unittests. -foreach(TEST_OP ${MULTINODE_DIST_TEST_OPS}) - list(APPEND MIXED_DIST_TEST_OPS ${TEST_OP}) -endforeach() - -list(APPEND MIXED_DIST_TEST_OPS test_dgc_op) -list(APPEND MIXED_DIST_TEST_OPS test_dgc_momentum_op) -list(APPEND MIXED_DIST_TEST_OPS test_dgc_optimizer) list(APPEND MIXED_DIST_TEST_OPS test_simple_dist_transpiler) -list(APPEND MIXED_DIST_TEST_OPS test_recv_save_op) -list(APPEND MIXED_DIST_TEST_OPS test_c_comm_init_op) list(APPEND MIXED_DIST_TEST_OPS test_communicator_async) list(APPEND MIXED_DIST_TEST_OPS test_communicator_ps_gpu) list(APPEND MIXED_DIST_TEST_OPS test_communicator_geo) -list(APPEND MIXED_DIST_TEST_OPS test_communicator_half_async) -list(APPEND MIXED_DIST_TEST_OPS test_communicator_sync) list(APPEND MIXED_DIST_TEST_OPS test_fleet_launch_ps) list(APPEND MIXED_DIST_TEST_OPS test_launch_coverage) list(APPEND MIXED_DIST_TEST_OPS test_fleetrun) @@ -113,32 +49,11 @@ list(APPEND MIXED_DIST_TEST_OPS test_fleet_launch_ascend) list(APPEND MIXED_DIST_TEST_OPS test_ascend_group) list(APPEND MIXED_DIST_TEST_OPS test_fleet_launch_nproc) list(APPEND MIXED_DIST_TEST_OPS test_fleet_api_input) -list(APPEND MIXED_DIST_TEST_OPS test_collective_optimizer) + list(APPEND MIXED_DIST_TEST_OPS test_fleet_base) list(APPEND MIXED_DIST_TEST_OPS test_fleet_base_2) list(APPEND MIXED_DIST_TEST_OPS test_fleet_base_3) -list(APPEND MIXED_DIST_TEST_OPS test_fleet_recompute_meta_optimizer) -list(APPEND MIXED_DIST_TEST_OPS test_fleet_pipeline_meta_optimizer) -list(APPEND MIXED_DIST_TEST_OPS - test_fleet_pipeline_meta_optimizer_with_recompute) -list(APPEND MIXED_DIST_TEST_OPS test_fleet_raw_program_meta_optimizer) -list(APPEND MIXED_DIST_TEST_OPS test_rnn_dp) -list(APPEND MIXED_DIST_TEST_OPS test_fleet_amp_meta_optimizer) -list(APPEND MIXED_DIST_TEST_OPS test_fleet_amp_init) -list(APPEND MIXED_DIST_TEST_OPS test_fleet_gradient_merge_meta_optimizer) -list(APPEND MIXED_DIST_TEST_OPS test_fleet_sharding_meta_optimizer) -list(APPEND MIXED_DIST_TEST_OPS test_fleet_hybrid_meta_optimizer) -list(APPEND MIXED_DIST_TEST_OPS test_fleet_localsgd_meta_optimizer) -list(APPEND MIXED_DIST_TEST_OPS test_fleet_lars_meta_optimizer) -list(APPEND MIXED_DIST_TEST_OPS test_fleet_lamb_meta_optimizer) -list(APPEND MIXED_DIST_TEST_OPS test_fleet_dgc_meta_optimizer) -list(APPEND MIXED_DIST_TEST_OPS test_fleet_fp16_allreduce_meta_optimizer) -list(APPEND MIXED_DIST_TEST_OPS test_fleet_private_function) -list(APPEND MIXED_DIST_TEST_OPS test_fleet_graph_executor) -list(APPEND MIXED_DIST_TEST_OPS test_fleet_meta_optimizer_base) -list(APPEND MIXED_DIST_TEST_OPS test_fleet_distributed_strategy) list(APPEND MIXED_DIST_TEST_OPS test_fleet_auto) -list(APPEND MIXED_DIST_TEST_OPS test_fleet_static_mp_layers) list(APPEND MIXED_DIST_TEST_OPS test_auto_parallel_partitioner) list(APPEND MIXED_DIST_TEST_OPS test_auto_parallel_partitioner_gpt) list(APPEND MIXED_DIST_TEST_OPS test_auto_parallel_searcher) @@ -148,7 +63,6 @@ list(APPEND MIXED_DIST_TEST_OPS test_auto_parallel_reshard_serial) list(APPEND MIXED_DIST_TEST_OPS test_auto_parallel_reshard_mppp) list(APPEND MIXED_DIST_TEST_OPS test_auto_parallel_reshard_dpmppp) list(APPEND MIXED_DIST_TEST_OPS test_auto_parallel_cost_model) -list(APPEND MIXED_DIST_TEST_OPS test_tcp_store) list(APPEND MIXED_DIST_TEST_OPS test_dygraph_hybrid_dp) foreach(TEST_OP ${MIXED_DIST_TEST_OPS}) list(REMOVE_ITEM TEST_OPS ${TEST_OP}) @@ -174,30 +88,8 @@ list(REMOVE_ITEM TEST_OPS test_fuse_gemm_epilogue_pass) if(((NOT WITH_ROCM) AND (NOT WITH_GPU)) OR WIN32) list(REMOVE_ITEM TEST_OPS test_c_comm_init_all_op) - list(REMOVE_ITEM TEST_OPS test_allgather) list(REMOVE_ITEM TEST_OPS test_c_embedding_op) - list(REMOVE_ITEM TEST_OPS test_collective_reduce) list(REMOVE_ITEM TEST_OPS test_pipeline_parallel) - list(REMOVE_ITEM TEST_OPS test_collective_scatter) - list(REMOVE_ITEM TEST_OPS test_collective_sendrecv) - list(REMOVE_ITEM TEST_OPS test_reducescatter) - list(REMOVE_ITEM TEST_OPS test_reducescatter_api) - list(REMOVE_ITEM TEST_OPS test_collective_split_embedding_none_divisible) - list(REMOVE_ITEM TEST_OPS test_collective_split_row_linear) - list(REMOVE_ITEM TEST_OPS test_collective_split_col_linear) - list(REMOVE_ITEM TEST_OPS test_collective_reduce_api) - list(REMOVE_ITEM TEST_OPS test_collective_scatter_api) - list(REMOVE_ITEM TEST_OPS test_collective_barrier_api) - list(REMOVE_ITEM TEST_OPS test_collective_allreduce_api) - list(REMOVE_ITEM TEST_OPS test_new_group_api) - list(REMOVE_ITEM TEST_OPS test_collective_broadcast_api) - list(REMOVE_ITEM TEST_OPS test_collective_allgather_api) - list(REMOVE_ITEM TEST_OPS test_collective_allgather_object_api) - list(REMOVE_ITEM TEST_OPS test_collective_alltoall_api) - list(REMOVE_ITEM TEST_OPS test_collective_global_gather) - list(REMOVE_ITEM TEST_OPS test_collective_global_scatter) - list(REMOVE_ITEM TEST_OPS test_collective_sendrecv_api) - list(REMOVE_ITEM TEST_OPS test_collective_wait) list(REMOVE_ITEM TEST_OPS test_memcpy_op) list(REMOVE_ITEM TEST_OPS test_raw_program_optimizer) list(REMOVE_ITEM TEST_OPS test_fleet_gradient_scale) @@ -212,7 +104,6 @@ if(((NOT WITH_ROCM) AND (NOT WITH_GPU)) OR WIN32) list(REMOVE_ITEM TEST_OPS test_fleet_exe_dist_model_tensor) endif() -# Temporally disable test_deprecated_decorator list(REMOVE_ITEM TEST_OPS test_deprecated_decorator) if(WIN32) @@ -239,19 +130,15 @@ endif() if(NOT WITH_DISTRIBUTE OR WIN32) # DISTRIBUTE related list(REMOVE_ITEM TEST_OPS test_avoid_twice_initialization) - list(REMOVE_ITEM TEST_OPS test_distributed_strategy) list(REMOVE_ITEM TEST_OPS test_fleet_metric) list(REMOVE_ITEM TEST_OPS test_fleet_ps) list(REMOVE_ITEM TEST_OPS test_fleet_rolemaker_2) - list(REMOVE_ITEM TEST_OPS test_fleet_utils) - list(REMOVE_ITEM TEST_OPS test_collective_cpu_barrier_with_gloo) list(REMOVE_ITEM TEST_OPS test_delete_c_identity_op_pass) # TODO: Fix these unittests failed on Windows list(REMOVE_ITEM TEST_OPS test_fake_init_op) endif() if(NOT WITH_DISTRIBUTE) - list(REMOVE_ITEM TEST_OPS test_fleet_rolemaker_new) list(REMOVE_ITEM TEST_OPS test_desc_clone_dist) endif() @@ -280,8 +167,8 @@ endif() list(REMOVE_ITEM TEST_OPS test_parallel_dygraph_hybrid_parallel) -list(REMOVE_ITEM TEST_OPS test_parallel_dygraph_transformer_gloo -)# NOTE: @xiongkun03, cpu is too slow, fix it in next PR +list(REMOVE_ITEM TEST_OPS test_parallel_dygraph_transformer_gloo) +# NOTE: @xiongkun03, cpu is too slow, fix it in next PR if(NOT WITH_GLOO) list(REMOVE_ITEM TEST_OPS test_parallel_dygraph_dataparallel_cpuonly) @@ -296,44 +183,15 @@ endif() if((NOT WITH_GPU) AND (NOT WITH_ROCM)) list(REMOVE_ITEM TEST_OPS test_conv2d_fusion_op) - list(REMOVE_ITEM TEST_OPS test_rank_attention_op - )# TODO(shenliang03): rank_attention_op support CPU device in future - list(REMOVE_ITEM TEST_OPS test_batch_fc_op - )# TODO(shenliang03): batch_fc_op support CPU device in future - list(REMOVE_ITEM TEST_OPS test_parallel_dygraph_mnist - )# TODO(Yancey1989): parallel dygraph support CPU device in future - list(REMOVE_ITEM TEST_OPS test_parallel_dygraph_unused_variables) - list(REMOVE_ITEM TEST_OPS test_parallel_dygraph_se_resnext) - list(REMOVE_ITEM TEST_OPS test_parallel_dygraph_sparse_embedding) - list(REMOVE_ITEM TEST_OPS test_parallel_dygraph_sparse_embedding_over_height) - list(REMOVE_ITEM TEST_OPS test_parallel_dygraph_transformer) - list(REMOVE_ITEM TEST_OPS test_parallel_dygraph_sync_batch_norm) - list(REMOVE_ITEM TEST_OPS test_parallel_dygraph_control_flow) - list(REMOVE_ITEM TEST_OPS test_parallel_dygraph_no_sync) - list(REMOVE_ITEM TEST_OPS test_parallel_dygraph_no_sync_gradient_check) + list(REMOVE_ITEM TEST_OPS test_rank_attention_op) + # TODO(shenliang03): rank_attention_op support CPU device in future + list(REMOVE_ITEM TEST_OPS test_batch_fc_op) + # TODO(shenliang03): batch_fc_op support CPU device in future + # TODO(Yancey1989): parallel dygraph support CPU device in future list(REMOVE_ITEM TEST_OPS test_parallel_dygraph_dataparallel) - list(REMOVE_ITEM TEST_OPS test_parallel_dygraph_pipeline_parallel) list(REMOVE_ITEM TEST_OPS test_parallel_dygraph_pipeline_parallel_with_virtual_stage) - list(REMOVE_ITEM TEST_OPS test_parallel_dygraph_tensor_parallel) - list(REMOVE_ITEM TEST_OPS test_parallel_dygraph_sharding_parallel) - list(REMOVE_ITEM TEST_OPS test_dygraph_sharding_optimizer_stage2) - list(REMOVE_ITEM TEST_OPS test_dygraph_sharding_stage2) - list(REMOVE_ITEM TEST_OPS test_dygraph_sharding_stage3) - list(REMOVE_ITEM TEST_OPS test_dygraph_sharding_stage3_for_eager) - list(REMOVE_ITEM TEST_OPS test_dygraph_group_sharded_api) - list(REMOVE_ITEM TEST_OPS test_dygraph_group_sharded_api_for_eager) - list(REMOVE_ITEM TEST_OPS test_auto_parallel_parallelizer) - list(REMOVE_ITEM TEST_OPS test_parallel_dygraph_mp_layers) - list(REMOVE_ITEM TEST_OPS test_imperative_auto_mixed_precision) - list(REMOVE_ITEM TEST_OPS test_imperative_auto_mixed_precision_for_eager) - list(REMOVE_ITEM TEST_OPS test_mixed_precision) list(REMOVE_ITEM TEST_OPS test_fleet_base_single) - list(REMOVE_ITEM TEST_OPS test_dygraph_recompute) - list(REMOVE_ITEM TEST_OPS test_dygraph_recompute_for_eager) - list(REMOVE_ITEM TEST_OPS test_hybrid_parallel_inference_helper) - list(REMOVE_ITEM TEST_OPS test_parallel_class_center_sample) - list(REMOVE_ITEM TEST_OPS test_parallel_margin_cross_entropy) list(REMOVE_ITEM TEST_OPS test_auto_parallel_partitioner) list(REMOVE_ITEM TEST_OPS test_auto_parallel_partitioner_gpt) list(REMOVE_ITEM TEST_OPS test_auto_parallel_searcher) @@ -346,12 +204,6 @@ if((NOT WITH_GPU) AND (NOT WITH_ROCM)) list(REMOVE_ITEM TEST_OPS test_auto_parallel_data_unshard) list(REMOVE_ITEM TEST_OPS test_auto_parallel_save_load) list(REMOVE_ITEM TEST_OPS test_auto_parallel_autoconvert) - list(REMOVE_ITEM TEST_OPS test_collective_process_group) - list(REMOVE_ITEM TEST_OPS test_collective_alltoall_single) - list(REMOVE_ITEM TEST_OPS test_eager_dist_api) - list(REMOVE_ITEM TEST_OPS test_collective_batch_isend_irecv) - list(REMOVE_ITEM TEST_OPS test_collective_reduce_scatter) - list(REMOVE_ITEM TEST_OPS test_parallel_dygraph_qat) elseif(WITH_GPU) if(${CUDNN_VERSION} VERSION_LESS 7100) @@ -359,35 +211,28 @@ elseif(WITH_GPU) endif() endif() -if(WITH_NCCL) - if(${NCCL_VERSION} VERSION_LESS 2212) - list(REMOVE_ITEM DIST_TEST_OPS test_parallel_dygraph_sparse_embedding) - list(REMOVE_ITEM DIST_TEST_OPS - test_parallel_dygraph_sparse_embedding_over_height) - list(REMOVE_ITEM DIST_TEST_OPS test_parallel_dygraph_transformer) - endif() -endif() - if((NOT WITH_NCCL) AND (NOT WITH_RCCL)) list(REMOVE_ITEM TEST_OPS test_imperative_group) - list(REMOVE_ITEM TEST_OPS test_new_group_api) endif() if(((NOT WITH_ROCM) AND (NOT WITH_GPU)) OR WIN32) list(REMOVE_ITEM TEST_OPS test_fused_gate_attention_op) list(REMOVE_ITEM TEST_OPS test_boxps) + list(REMOVE_ITEM TEST_OPS test_allgather) + list(REMOVE_ITEM TEST_OPS test_reducescatter) + list(REMOVE_ITEM TEST_OPS test_reducescatter_api) endif() -list(REMOVE_ITEM TEST_OPS test_seq_concat_op -)# FIXME(helin): https://github.com/PaddlePaddle/Paddle/issues/8290 -list(REMOVE_ITEM TEST_OPS test_lstm_unit_op -)# # FIXME(qijun) https://github.com/PaddlePaddle/Paddle/issues/5185 +list(REMOVE_ITEM TEST_OPS test_seq_concat_op) +# FIXME(helin): https://github.com/PaddlePaddle/Paddle/issues/8290 +list(REMOVE_ITEM TEST_OPS test_lstm_unit_op) +# # FIXME(qijun) https://github.com/PaddlePaddle/Paddle/issues/5185 list(REMOVE_ITEM TEST_OPS test_cond_op) # FIXME(qijun): https://github.com/PaddlePaddle/Paddle/issues/5101#issuecomment-339814957 list(REMOVE_ITEM TEST_OPS op_test) # op_test is a helper python file, not a test -list(REMOVE_ITEM TEST_OPS decorator_helper -)# decorator_helper is a helper python file, not a test +list(REMOVE_ITEM TEST_OPS decorator_helper) +# decorator_helper is a helper python file, not a test if(APPLE) if(NOT WITH_DISTRIBUTE) @@ -623,8 +468,6 @@ list(REMOVE_ITEM TEST_OPS test_fuse_bn_act_pass) list(REMOVE_ITEM TEST_OPS test_fuse_bn_add_act_pass) list(REMOVE_ITEM TEST_OPS test_imperative_static_runner_mnist) list(REMOVE_ITEM TEST_OPS test_imperative_static_runner_while) -# disable test_cumsum_op temporaily -# list(REMOVE_ITEM TEST_OPS test_cumsum_op) # disable this unittest temporarily list(REMOVE_ITEM TEST_OPS test_imperative_data_loader_exception) @@ -641,7 +484,6 @@ if(APPLE OR WIN32) list(REMOVE_ITEM TEST_OPS test_dataset) list(REMOVE_ITEM TEST_OPS test_dataset_dataloader) list(REMOVE_ITEM TEST_OPS test_imperative_data_loader_base) - # list(REMOVE_ITEM TEST_OPS test_imperative_data_loader_exception) list(REMOVE_ITEM TEST_OPS test_imperative_data_loader_process) list(REMOVE_ITEM TEST_OPS test_imperative_data_loader_fds_clear) list(REMOVE_ITEM TEST_OPS test_imperative_data_loader_exit_func) @@ -700,7 +542,6 @@ if((NOT WITH_GPU) AND (NOT WITH_XPU) AND NOT (WITH_ASCEND OR WITH_ASCEND_CL)) list(REMOVE_ITEM TEST_OPS "test_fleet_graph_execution_meta_optimizer") - list(REMOVE_ITEM TEST_OPS "test_gen_nccl_id_op") list(REMOVE_ITEM TEST_OPS "test_dist_fleet_grad_clip") list(REMOVE_ITEM TEST_OPS "test_dist_fleet_heter_ctr") list(REMOVE_ITEM TEST_OPS "test_dist_fleet_ps_gpu_ctr") @@ -814,67 +655,16 @@ if(WITH_DISTRIBUTE) list(REMOVE_ITEM DIST_TEST_OPS "test_dist_fleet_ps12") endif() - py_test_modules(test_recv_save_op MODULES test_recv_save_op ENVS ${dist_ENVS}) py_test_modules(test_communicator_async MODULES test_communicator_async ENVS ${dist_ENVS}) - # py_test_modules(test_communicator_ps_gpu MODULES test_communicator_ps_gpu - # ENVS ${dist_ENVS}) py_test_modules(test_communicator_geo MODULES test_communicator_geo ENVS ${dist_ENVS}) - py_test_modules( - test_communicator_half_async - MODULES - test_communicator_half_async - ENVS - ${dist_ENVS} - FLAGS_communicator_send_queue_size=1 - FLAGS_communicator_max_merge_var_num=1) - py_test_modules( - test_communicator_sync - MODULES - test_communicator_sync - ENVS - ${dist_ENVS} - FLAGS_communicator_send_queue_size=1 - FLAGS_communicator_max_merge_var_num=1) - py_test_modules(test_collective_optimizer MODULES test_collective_optimizer) if(NOT APPLE) py_test_modules(test_fleet_base MODULES test_fleet_base ENVS ${dist_ENVS}) py_test_modules(test_fleet_base_2 MODULES test_fleet_base_2 ENVS ${dist_ENVS}) py_test_modules(test_fleet_base_3 MODULES test_fleet_base_3 ENVS ${dist_ENVS}) - py_test_modules(test_fleet_amp_init MODULES test_fleet_amp_init ENVS - ${dist_ENVS}) - py_test_modules(test_fleet_fp16_allreduce_meta_optimizer MODULES - test_fleet_fp16_allreduce_meta_optimizer ENVS ${dist_ENVS}) - py_test_modules(test_fleet_private_function MODULES - test_fleet_private_function ENVS ${dist_ENVS}) - py_test_modules(test_fleet_meta_optimizer_base MODULES - test_fleet_meta_optimizer_base ENVS ${dist_ENVS}) - py_test_modules(test_fleet_distributed_strategy MODULES - test_fleet_distributed_strategy) - py_test_modules(test_fleet_static_mp_layers MODULES - test_fleet_static_mp_layers) - #py_test_modules(test_fleet_auto MODULES test_fleet_auto ENVS ${dist_ENVS}) - if(WITH_GPU - OR WITH_XPU - OR WITH_ASCEND - OR WITH_ASCEND_CL) - py_test_modules(test_fleet_amp_meta_optimizer MODULES - test_fleet_amp_meta_optimizer ENVS ${dist_ENVS}) - py_test_modules( - test_fleet_gradient_merge_meta_optimizer MODULES - test_fleet_gradient_merge_meta_optimizer ENVS ${dist_ENVS}) - py_test_modules(test_fleet_graph_executor MODULES - test_fleet_graph_executor ENVS ${dist_ENVS}) - py_test_modules(test_fleet_hybrid_meta_optimizer MODULES - test_fleet_hybrid_meta_optimizer ENVS ${dist_ENVS}) - py_test_modules(test_fleet_recompute_meta_optimizer MODULES - test_fleet_recompute_meta_optimizer ENVS ${dist_ENVS}) - py_test_modules(test_fleet_sharding_meta_optimizer MODULES - test_fleet_sharding_meta_optimizer ENVS ${dist_ENVS}) - endif() if(NOT WIN32) py_test_modules(test_auto_parallel_partitioner MODULES test_auto_parallel_partitioner ENVS ${dist_ENVS}) @@ -895,52 +685,16 @@ if(WITH_DISTRIBUTE) py_test_modules(test_auto_parallel_cost_model MODULES test_auto_parallel_cost_model ENVS ${dist_ENVS}) - if(WITH_GPU - OR WITH_XPU - OR WITH_ASCEND - OR WITH_ASCEND_CL) - py_test_modules(test_fleet_lamb_meta_optimizer MODULES - test_fleet_lamb_meta_optimizer ENVS ${dist_ENVS}) - py_test_modules(test_fleet_lars_meta_optimizer MODULES - test_fleet_lars_meta_optimizer ENVS ${dist_ENVS}) - py_test_modules(test_fleet_localsgd_meta_optimizer MODULES - test_fleet_localsgd_meta_optimizer ENVS ${dist_ENVS}) - - endif() endif() endif() - if(WITH_DGC) - # if with dgc, test all dgc tests. - # NOTE. dist dgc tests is already in DIST_TEST_OPS - py_test_modules(test_dgc_op MODULES test_dgc_op) - py_test_modules(test_dgc_momentum_op MODULES test_dgc_momentum_op) - py_test_modules(test_dgc_optimizer MODULES test_dgc_optimizer) - py_test_modules(test_fleet_dgc_meta_optimizer MODULES - test_fleet_dgc_meta_optimizer) - else() + if(NOT WITH_DGC) # if not with dgc, must close all dgc tests list(REMOVE_ITEM DIST_TEST_OPS "test_dist_mnist_dgc_nccl") list(REMOVE_ITEM DIST_TEST_OPS "test_dist_se_resnext_dgc") endif() - # port range (20000, 23000) is reserved for dist-ops - set(dist_ut_port 20001) - if(NOT WIN32) - bash_test_modules( - test_tcp_store - START_BASH - dist_test.sh - LABELS - "RUN_TYPE=EXCLUSIVE" - ENVS - "PADDLE_DIST_UT_PORT=${dist_ut_port}") - math(EXPR dist_ut_port "${dist_ut_port}+1") - endif() - if(NOT APPLE) if(WITH_GPU OR WITH_ROCM) - bash_test_modules(test_c_comm_init_op START_BASH test_c_comm_init_op.sh - ENVS PADDLE_BINARY_DIR=${PADDLE_BINARY_DIR}) py_test_modules(test_launch_coverage MODULES test_launch_coverage) endif() @@ -971,22 +725,8 @@ if(WITH_DISTRIBUTE) PADDLE_BINARY_DIR=${PADDLE_BINARY_DIR}) endif() - # add new dist test - if(WITH_DISTRIBUTE AND WITH_MULTINODE_TESTING) - foreach(TEST_OP ${MULTINODE_DIST_TEST_OPS}) - bash_test_modules( - ${TEST_OP} - START_BASH - multinode_dist_test.sh - LABELS - "RUN_TYPE=EXCLUSIVE" - ENVS - "PADDLE_DIST_UT_PORT=${dist_ut_port}") - endforeach() - - endif() - - # port range (20000, 23000) is reserved for dist-ops + # port range (20000, 21200) is reserved for dist-ops + set(dist_ut_port 20001) foreach(TEST_OP ${DIST_TEST_OPS}) bash_test_modules( ${TEST_OP} @@ -996,8 +736,8 @@ if(WITH_DISTRIBUTE) "RUN_TYPE=EXCLUSIVE" ENVS "PADDLE_DIST_UT_PORT=${dist_ut_port}") - math(EXPR dist_ut_port "${dist_ut_port}+20") - if(dist_ut_port GREATER_EQUAL 22998) + math(EXPR dist_ut_port "${dist_ut_port}+10") + if(dist_ut_port GREATER_EQUAL 21198) message( FATAL_ERROR "available ports have been exhausted:${dist_ut_port}") endif() @@ -1023,20 +763,6 @@ if(WITH_DISTRIBUTE) "PADDLE_DIST_UT_PORT=${dist_ut_port}" PADDLE_BINARY_DIR=${PADDLE_BINARY_DIR}) endif() - if(WITH_GPU - OR WITH_XPU - OR WITH_ASCEND - OR WITH_ASCEND_CL) - bash_test_modules( - test_new_group - START_BASH - test_new_group.sh - LABELS - "RUN_TYPE=EXCLUSIVE" - ENVS - "PADDLE_DIST_UT_PORT=${dist_ut_port}+20" - PADDLE_BINARY_DIR=${PADDLE_BINARY_DIR}) - endif() endif() endif() @@ -1230,9 +956,8 @@ endif() # dist xpu tests: if(WITH_XPU_BKCL) - #py_test(test_collective_reduce_api_xpu SRCS "test_collective_reduce_api.py") py_test(test_collective_allreduce_api_xpu - SRCS "test_collective_allreduce_api.py") + SRCS "collective/test_collective_allreduce_api.py") endif() if(WITH_HETERPS) @@ -1289,8 +1014,6 @@ set_tests_properties( test_fetch_unmerged test_buffer_shared_memory_reuse_pass PROPERTIES LABELS "RUN_TYPE=DIST") -# disable test_parallel_executor_fetch_isolated_var -# set_tests_properties(test_parallel_executor_fetch_isolated_var PROPERTIES LABELS "RUN_TYPE=DIST") set_tests_properties( test_parallel_executor_crf test_sync_batch_norm_op @@ -1311,7 +1034,6 @@ if(NOT WIN32 AND NOT APPLE) PROPERTIES LABELS "RUN_TYPE=EXCLUSIVE") set_tests_properties(test_imperative_data_loader_fds_clear PROPERTIES LABELS "RUN_TYPE=EXCLUSIVE") - # set_tests_properties(test_imperative_data_loader_exception PROPERTIES LABELS "RUN_TYPE=EXCLUSIVE") set_tests_properties(test_multiprocess_dataloader_static PROPERTIES LABELS "RUN_TYPE=EXCLUSIVE") set_tests_properties(test_multiprocess_dataloader_dynamic @@ -1341,32 +1063,16 @@ if(NOT WIN32) endif() endif() -if(WITH_DISTRIBUTE AND NOT WIN32) - set_tests_properties(test_fleet_utils PROPERTIES TIMEOUT 120) - set_tests_properties(test_collective_cpu_barrier_with_gloo PROPERTIES TIMEOUT - 40) -endif() - if(WITH_DISTRIBUTE) - set_tests_properties(test_communicator_half_async PROPERTIES TIMEOUT 120) set_tests_properties(test_dist_fleet_ctr2 PROPERTIES TIMEOUT 200) set_tests_properties(test_dist_fleet_sparse_embedding_ctr PROPERTIES TIMEOUT 200) set_tests_properties(test_dist_fleet_infer PROPERTIES TIMEOUT 200) - set_tests_properties(test_dist_fleet_raw_program_optimizer PROPERTIES TIMEOUT - 120) set_tests_properties(test_dist_fleet_raw_program_optimizer_fuse_allreduce PROPERTIES TIMEOUT 60) set_tests_properties(test_dist_dygraph_apis PROPERTIES TIMEOUT 120) endif() -if(WITH_DISTRIBUTE AND NOT APPLE) - if(WITH_GPU OR WITH_ROCM) - set_tests_properties(test_c_comm_init_op PROPERTIES TIMEOUT 120) - set_tests_properties(test_dist_mnist_gradient_merge PROPERTIES TIMEOUT 360) - endif() -endif() - # setting timeout value as 15S set_tests_properties(test_run PROPERTIES TIMEOUT 120) set_tests_properties(test_sync_batch_norm_op PROPERTIES TIMEOUT 120) @@ -1568,59 +1274,12 @@ set_tests_properties(test_graph_send_uv_op PROPERTIES TIMEOUT 60) if(WITH_DISTRIBUTE AND WITH_GPU AND WITH_NCCL) - set_tests_properties(test_parallel_dygraph_dataparallel PROPERTIES TIMEOUT - 120) - set_tests_properties(test_parallel_dygraph_mnist PROPERTIES TIMEOUT 200) - set_tests_properties(test_parallel_dygraph_se_resnext PROPERTIES TIMEOUT 200) - set_tests_properties(test_parallel_dygraph_unused_variables PROPERTIES TIMEOUT - 350) - set_tests_properties(test_parallel_dygraph_control_flow PROPERTIES TIMEOUT - 350) - set_tests_properties(test_parallel_dygraph_no_sync PROPERTIES TIMEOUT 300) - set_tests_properties(test_parallel_dygraph_no_sync_gradient_check - PROPERTIES TIMEOUT 60) - set_tests_properties(test_parallel_dygraph_pipeline_parallel - PROPERTIES TIMEOUT 500) set_tests_properties( test_parallel_dygraph_pipeline_parallel_with_virtual_stage PROPERTIES TIMEOUT 500) - set_tests_properties(test_parallel_dygraph_tensor_parallel PROPERTIES TIMEOUT - 200) - set_tests_properties(test_parallel_dygraph_sharding_parallel - PROPERTIES TIMEOUT 120) - set_tests_properties(test_dygraph_sharding_optimizer_stage2 PROPERTIES TIMEOUT - 120) - set_tests_properties(test_dygraph_sharding_stage2 PROPERTIES TIMEOUT 200) - set_tests_properties(test_dygraph_sharding_stage3 PROPERTIES TIMEOUT 350) - set_tests_properties(test_dygraph_sharding_stage3_for_eager PROPERTIES TIMEOUT - 350) - set_tests_properties(test_dygraph_group_sharded_api PROPERTIES TIMEOUT 120) - set_tests_properties(test_dygraph_group_sharded_api_for_eager - PROPERTIES TIMEOUT 120) - set_tests_properties(test_auto_parallel_parallelizer PROPERTIES TIMEOUT 120) - set_tests_properties(test_parallel_dygraph_mp_layers PROPERTIES TIMEOUT 120) - set_tests_properties(test_hybrid_parallel_inference_helper PROPERTIES TIMEOUT - 120) - set_tests_properties(test_parallel_class_center_sample PROPERTIES TIMEOUT 120) - set_tests_properties(test_parallel_margin_cross_entropy PROPERTIES TIMEOUT - 120) set_tests_properties(test_auto_parallel_data_unshard PROPERTIES TIMEOUT 120) set_tests_properties(test_auto_parallel_save_load PROPERTIES TIMEOUT 120) set_tests_properties(test_auto_parallel_autoconvert PROPERTIES TIMEOUT 120) - set_tests_properties(test_collective_process_group PROPERTIES TIMEOUT 120) - set_tests_properties(test_collective_alltoall_single PROPERTIES TIMEOUT 60) - set_tests_properties(test_eager_dist_api PROPERTIES TIMEOUT 100) - set_tests_properties(test_collective_batch_isend_irecv PROPERTIES TIMEOUT 100) - set_tests_properties(test_collective_reduce_scatter PROPERTIES TIMEOUT 100) - set_tests_properties(test_parallel_dygraph_qat PROPERTIES TIMEOUT 120) - if(${NCCL_VERSION} VERSION_GREATER_EQUAL 2212) - set_tests_properties(test_parallel_dygraph_sparse_embedding - PROPERTIES TIMEOUT 200) - set_tests_properties(test_parallel_dygraph_transformer PROPERTIES TIMEOUT - 200) - set_tests_properties(test_parallel_dygraph_sparse_embedding_over_height - PROPERTIES TIMEOUT 150) - endif() endif() if(APPLE) @@ -1633,63 +1292,23 @@ if(APPLE) endif() if((WITH_ROCM OR WITH_GPU) AND NOT WIN32) - set_tests_properties(test_collective_allgather_api PROPERTIES TIMEOUT 300) - set_tests_properties(test_collective_allgather_object_api PROPERTIES TIMEOUT - 120) - set_tests_properties(test_collective_alltoall_api PROPERTIES TIMEOUT 120) - set_tests_properties(test_collective_global_gather PROPERTIES TIMEOUT 200) - set_tests_properties(test_collective_global_scatter PROPERTIES TIMEOUT 200) - set_tests_properties(test_collective_sendrecv_api PROPERTIES TIMEOUT 120) - set_tests_properties(test_collective_broadcast_api PROPERTIES TIMEOUT 120) - set_tests_properties(test_collective_allreduce_api PROPERTIES TIMEOUT 120) if(WITH_DISTRIBUTE) - set_tests_properties(test_new_group_api PROPERTIES TIMEOUT 120) - set_tests_properties(test_pipeline PROPERTIES TIMEOUT 120) - set_tests_properties(test_ir_pass_pipeline PROPERTIES TIMEOUT 120) - set_tests_properties(test_static_model_parallel PROPERTIES TIMEOUT 240) set_tests_properties(test_static_model_parallel_fused_feedforward PROPERTIES TIMEOUT 120) set_tests_properties(test_static_model_parallel_fused_attention PROPERTIES TIMEOUT 120) set_tests_properties(test_static_model_parallel_fused_multi_transformer PROPERTIES TIMEOUT 120) - set_tests_properties( - test_collective_split_embedding_none_divisible - test_collective_split_row_linear - test_collective_split_col_linear - test_collective_scatter_api - test_collective_barrier_api - test_collective_reduce_api - test_pipeline_parallel - test_collective_allreduce_api - test_new_group_api - test_collective_broadcast_api - test_collective_allgather_api - test_collective_allgather_object_api - test_collective_alltoall_api - test_collective_global_gather - test_collective_global_scatter - PROPERTIES LABELS "RUN_TYPE=DIST") + set_tests_properties(test_pipeline_parallel PROPERTIES LABELS + "RUN_TYPE=DIST") + set_tests_properties(test_reducescatter_api PROPERTIES TIMEOUT 120) + set_tests_properties(test_reducescatter PROPERTIES TIMEOUT 120) + set_tests_properties(test_allgather PROPERTIES TIMEOUT 120) endif() set_tests_properties(test_paddle_multiprocessing PROPERTIES TIMEOUT 120) - set_tests_properties(test_reducescatter_api PROPERTIES TIMEOUT 120) - set_tests_properties(test_reducescatter PROPERTIES TIMEOUT 120) - set_tests_properties(test_collective_reduce_api PROPERTIES TIMEOUT 120) set_tests_properties(test_pipeline_parallel PROPERTIES TIMEOUT 120) - set_tests_properties(test_collective_reduce PROPERTIES TIMEOUT 120) - set_tests_properties(test_allgather PROPERTIES TIMEOUT 120) - set_tests_properties(test_collective_scatter_api PROPERTIES TIMEOUT 120) - set_tests_properties(test_collective_barrier_api PROPERTIES TIMEOUT 120) - set_tests_properties(test_collective_scatter PROPERTIES TIMEOUT 120) - set_tests_properties(test_collective_sendrecv PROPERTIES TIMEOUT 120) endif() if(WITH_GPU OR WITH_ROCM) - set_tests_properties(test_imperative_auto_mixed_precision PROPERTIES TIMEOUT - 300) - set_tests_properties(test_imperative_auto_mixed_precision_for_eager - PROPERTIES TIMEOUT 300) - set_tests_properties(test_parallel_dygraph_sync_batch_norm PROPERTIES TIMEOUT - 120) set_tests_properties(test_rank_attention_op PROPERTIES TIMEOUT 120) endif() set_tests_properties(test_inplace_addto_strategy PROPERTIES TIMEOUT 120) diff --git a/python/paddle/fluid/tests/unittests/collective/CMakeLists.txt b/python/paddle/fluid/tests/unittests/collective/CMakeLists.txt index 6775b238ed9..a69973eeb92 100644 --- a/python/paddle/fluid/tests/unittests/collective/CMakeLists.txt +++ b/python/paddle/fluid/tests/unittests/collective/CMakeLists.txt @@ -6,64 +6,271 @@ set(LOCAL_ALL_ARCH ON) set(LOCAL_ALL_PLAT ON) if((WITH_GPU OR WITH_ROCM) AND (LINUX)) py_test_modules( - test_allreduce - MODULES - test_allreduce + test_allreduce MODULES test_allreduce ENVS + "PYTHONPATH=..:${PADDLE_BINARY_DIR}/python;http_proxy=;https_proxy=") + set_tests_properties(test_allreduce PROPERTIES TIMEOUT "120" RUN_SERIAL 1) +endif() +if((WITH_GPU OR WITH_ROCM) AND (LINUX)) + py_test_modules( + test_broadcast MODULES test_broadcast ENVS + "PYTHONPATH=..:${PADDLE_BINARY_DIR}/python;http_proxy=;https_proxy=") + set_tests_properties(test_broadcast PROPERTIES TIMEOUT "120" RUN_SERIAL 1) +endif() +if((WITH_GPU OR WITH_ROCM) AND (LINUX)) + py_test_modules( + test_c_concat MODULES test_c_concat ENVS + "PYTHONPATH=..:${PADDLE_BINARY_DIR}/python;http_proxy=;https_proxy=") + set_tests_properties(test_c_concat PROPERTIES TIMEOUT "120" RUN_SERIAL 1) +endif() +if((WITH_GPU OR WITH_ROCM) AND (LINUX)) + py_test_modules( + test_c_identity MODULES test_c_identity ENVS + "PYTHONPATH=..:${PADDLE_BINARY_DIR}/python;http_proxy=;https_proxy=") + set_tests_properties(test_c_identity PROPERTIES TIMEOUT "120" RUN_SERIAL 1) +endif() +if((WITH_GPU OR WITH_ROCM) AND (LINUX)) + py_test_modules( + test_c_split MODULES test_c_split ENVS + "PYTHONPATH=..:${PADDLE_BINARY_DIR}/python;http_proxy=;https_proxy=") + set_tests_properties(test_c_split PROPERTIES TIMEOUT "120" RUN_SERIAL 1) +endif() +if((WITH_ROCM OR WITH_GPU) AND (LINUX)) + bash_test_modules( + test_collective_split_embedding + START_BASH + ../dist_test.sh + LABELS + "RUN_TYPE=DIST" ENVS - "PADDLE_DIST_UT_PORT=20071;PYTHONPATH=..:${PADDLE_BINARY_DIR}/python;http_proxy=;https_proxy=" + "PADDLE_DIST_UT_PORT=21288;PYTHONPATH=..:${PADDLE_BINARY_DIR}/python;http_proxy=;https_proxy=" ) - set_tests_properties(test_allreduce PROPERTIES TIMEOUT "120" RUN_SERIAL 1) + set_tests_properties(test_collective_split_embedding PROPERTIES TIMEOUT "300" + RUN_SERIAL 1) +endif() +if((WITH_GPU OR WITH_ROCM) AND (LINUX)) + py_test_modules( + test_collective_allgather_api MODULES test_collective_allgather_api ENVS + "http_proxy=;https_proxy=;PYTHONPATH=..:${PADDLE_BINARY_DIR}/python") + set_tests_properties(test_collective_allgather_api PROPERTIES TIMEOUT "300" + RUN_SERIAL 1) +endif() +if((WITH_GPU OR WITH_ROCM) AND (LINUX)) + py_test_modules( + test_collective_allgather_object_api MODULES + test_collective_allgather_object_api ENVS + "http_proxy=;https_proxy=;PYTHONPATH=..:${PADDLE_BINARY_DIR}/python") + set_tests_properties(test_collective_allgather_object_api + PROPERTIES TIMEOUT "120" RUN_SERIAL 1) endif() if((WITH_GPU OR WITH_ROCM) AND (LINUX)) py_test_modules( - test_broadcast - MODULES - test_broadcast + test_collective_allreduce_api MODULES test_collective_allreduce_api ENVS + "http_proxy=;https_proxy=;PYTHONPATH=..:${PADDLE_BINARY_DIR}/python") + set_tests_properties(test_collective_allreduce_api PROPERTIES TIMEOUT "120" + RUN_SERIAL 1) +endif() +if((WITH_GPU OR WITH_ROCM) AND (LINUX)) + py_test_modules( + test_collective_alltoall_api MODULES test_collective_alltoall_api ENVS + "http_proxy=;https_proxy=;PYTHONPATH=..:${PADDLE_BINARY_DIR}/python") + set_tests_properties(test_collective_alltoall_api PROPERTIES TIMEOUT "120" + RUN_SERIAL 1) +endif() +if((WITH_GPU OR WITH_ROCM) AND (LINUX)) + bash_test_modules( + test_collective_alltoall_single + START_BASH + ../dist_test.sh + LABELS + "RUN_TYPE=DIST" ENVS - "PADDLE_DIST_UT_PORT=20073;PYTHONPATH=..:${PADDLE_BINARY_DIR}/python;http_proxy=;https_proxy=" + "PADDLE_DIST_UT_PORT=21290;http_proxy=;https_proxy=;PYTHONPATH=..:${PADDLE_BINARY_DIR}/python" ) - set_tests_properties(test_broadcast PROPERTIES TIMEOUT "120" RUN_SERIAL 1) + set_tests_properties(test_collective_alltoall_single PROPERTIES TIMEOUT "350" + RUN_SERIAL 1) endif() if((WITH_GPU OR WITH_ROCM) AND (LINUX)) py_test_modules( - test_c_concat - MODULES - test_c_concat + test_collective_barrier_api MODULES test_collective_barrier_api ENVS + "http_proxy=;https_proxy=;PYTHONPATH=..:${PADDLE_BINARY_DIR}/python") + set_tests_properties(test_collective_barrier_api PROPERTIES TIMEOUT "300" + RUN_SERIAL 1) +endif() +if((WITH_GPU OR WITH_ROCM) AND (LINUX)) + bash_test_modules( + test_collective_batch_isend_irecv + START_BASH + ../dist_test.sh + LABELS + "RUN_TYPE=DIST" ENVS - "PADDLE_DIST_UT_PORT=20075;PYTHONPATH=..:${PADDLE_BINARY_DIR}/python;http_proxy=;https_proxy=" + "PADDLE_DIST_UT_PORT=21292;http_proxy=;https_proxy=;PYTHONPATH=..:${PADDLE_BINARY_DIR}/python" ) - set_tests_properties(test_c_concat PROPERTIES TIMEOUT "120" RUN_SERIAL 1) + set_tests_properties(test_collective_batch_isend_irecv + PROPERTIES TIMEOUT "350" RUN_SERIAL 1) +endif() +if((WITH_GPU OR WITH_ROCM) AND (LINUX)) + py_test_modules( + test_collective_broadcast_api MODULES test_collective_broadcast_api ENVS + "http_proxy=;https_proxy=;PYTHONPATH=..:${PADDLE_BINARY_DIR}/python") + set_tests_properties(test_collective_broadcast_api PROPERTIES TIMEOUT "120" + RUN_SERIAL 1) +endif() +if((WITH_GPU OR WITH_ROCM) AND (LINUX)) + py_test_modules( + test_collective_cpu_barrier_with_gloo MODULES + test_collective_cpu_barrier_with_gloo ENVS + "http_proxy=;https_proxy=;PYTHONPATH=..:${PADDLE_BINARY_DIR}/python") + set_tests_properties(test_collective_cpu_barrier_with_gloo + PROPERTIES TIMEOUT "300" RUN_SERIAL 1) endif() if((WITH_GPU OR WITH_ROCM) AND (LINUX)) py_test_modules( - test_c_identity - MODULES - test_c_identity + test_collective_global_gather MODULES test_collective_global_gather ENVS + "http_proxy=;https_proxy=;PYTHONPATH=..:${PADDLE_BINARY_DIR}/python") + set_tests_properties(test_collective_global_gather PROPERTIES TIMEOUT "200" + RUN_SERIAL 1) +endif() +if((WITH_GPU OR WITH_ROCM) AND (LINUX)) + py_test_modules( + test_collective_global_scatter MODULES test_collective_global_scatter ENVS + "http_proxy=;https_proxy=;PYTHONPATH=..:${PADDLE_BINARY_DIR}/python") + set_tests_properties(test_collective_global_scatter PROPERTIES TIMEOUT "200" + RUN_SERIAL 1) +endif() +if((WITH_GPU OR WITH_ROCM) AND (LINUX)) + py_test_modules( + test_collective_optimizer MODULES test_collective_optimizer ENVS + "http_proxy=;https_proxy=;PYTHONPATH=..:${PADDLE_BINARY_DIR}/python") + set_tests_properties(test_collective_optimizer PROPERTIES TIMEOUT "300" + RUN_SERIAL 1) +endif() +if((WITH_GPU OR WITH_ROCM) AND (LINUX)) + bash_test_modules( + test_collective_process_group + START_BASH + ../dist_test.sh + LABELS + "RUN_TYPE=DIST" ENVS - "PADDLE_DIST_UT_PORT=20077;PYTHONPATH=..:${PADDLE_BINARY_DIR}/python;http_proxy=;https_proxy=" + "PADDLE_DIST_UT_PORT=21294;http_proxy=;https_proxy=;PYTHONPATH=..:${PADDLE_BINARY_DIR}/python" ) - set_tests_properties(test_c_identity PROPERTIES TIMEOUT "120" RUN_SERIAL 1) + set_tests_properties(test_collective_process_group PROPERTIES TIMEOUT "350" + RUN_SERIAL 1) +endif() +if((WITH_GPU OR WITH_ROCM) AND (LINUX)) + py_test_modules( + test_collective_reduce MODULES test_collective_reduce ENVS + "http_proxy=;https_proxy=;PYTHONPATH=..:${PADDLE_BINARY_DIR}/python") + set_tests_properties(test_collective_reduce PROPERTIES TIMEOUT "300" + RUN_SERIAL 1) endif() if((WITH_GPU OR WITH_ROCM) AND (LINUX)) py_test_modules( - test_c_split - MODULES - test_c_split + test_collective_reduce_api MODULES test_collective_reduce_api ENVS + "http_proxy=;https_proxy=;PYTHONPATH=..:${PADDLE_BINARY_DIR}/python") + set_tests_properties(test_collective_reduce_api PROPERTIES TIMEOUT "300" + RUN_SERIAL 1) +endif() +if((WITH_GPU OR WITH_ROCM) AND (LINUX)) + bash_test_modules( + test_collective_reduce_scatter + START_BASH + ../dist_test.sh + LABELS + "RUN_TYPE=DIST" ENVS - "PADDLE_DIST_UT_PORT=20079;PYTHONPATH=..:${PADDLE_BINARY_DIR}/python;http_proxy=;https_proxy=" + "PADDLE_DIST_UT_PORT=21296;http_proxy=;https_proxy=;PYTHONPATH=..:${PADDLE_BINARY_DIR}/python" ) - set_tests_properties(test_c_split PROPERTIES TIMEOUT "120" RUN_SERIAL 1) + set_tests_properties(test_collective_reduce_scatter PROPERTIES TIMEOUT "350" + RUN_SERIAL 1) endif() -if((WITH_ROCM OR WITH_GPU) AND (LINUX)) +if((WITH_GPU OR WITH_ROCM) AND (LINUX)) + py_test_modules( + test_collective_scatter MODULES test_collective_scatter ENVS + "http_proxy=;https_proxy=;PYTHONPATH=..:${PADDLE_BINARY_DIR}/python") + set_tests_properties(test_collective_scatter PROPERTIES TIMEOUT "300" + RUN_SERIAL 1) +endif() +if((WITH_GPU OR WITH_ROCM) AND (LINUX)) + py_test_modules( + test_collective_scatter_api MODULES test_collective_scatter_api ENVS + "http_proxy=;https_proxy=;PYTHONPATH=..:${PADDLE_BINARY_DIR}/python") + set_tests_properties(test_collective_scatter_api PROPERTIES TIMEOUT "300" + RUN_SERIAL 1) +endif() +if((WITH_GPU OR WITH_ROCM) AND (LINUX)) + py_test_modules( + test_collective_sendrecv MODULES test_collective_sendrecv ENVS + "http_proxy=;https_proxy=;PYTHONPATH=..:${PADDLE_BINARY_DIR}/python") + set_tests_properties(test_collective_sendrecv PROPERTIES TIMEOUT "300" + RUN_SERIAL 1) +endif() +if((WITH_GPU OR WITH_ROCM) AND (LINUX)) + py_test_modules( + test_collective_sendrecv_api MODULES test_collective_sendrecv_api ENVS + "http_proxy=;https_proxy=;PYTHONPATH=..:${PADDLE_BINARY_DIR}/python") + set_tests_properties(test_collective_sendrecv_api PROPERTIES TIMEOUT "120" + RUN_SERIAL 1) +endif() +if((WITH_GPU OR WITH_ROCM) AND (LINUX)) + py_test_modules( + test_collective_split_col_linear MODULES test_collective_split_col_linear + ENVS "http_proxy=;https_proxy=;PYTHONPATH=..:${PADDLE_BINARY_DIR}/python") + set_tests_properties(test_collective_split_col_linear + PROPERTIES TIMEOUT "300" RUN_SERIAL 1) +endif() +if((WITH_GPU OR WITH_ROCM) AND (LINUX)) + py_test_modules( + test_collective_split_embedding_none_divisible MODULES + test_collective_split_embedding_none_divisible ENVS + "http_proxy=;https_proxy=;PYTHONPATH=..:${PADDLE_BINARY_DIR}/python") + set_tests_properties(test_collective_split_embedding_none_divisible + PROPERTIES TIMEOUT "300" RUN_SERIAL 1) +endif() +if((WITH_GPU OR WITH_ROCM) AND (LINUX)) + py_test_modules( + test_collective_split_row_linear MODULES test_collective_split_row_linear + ENVS "http_proxy=;https_proxy=;PYTHONPATH=..:${PADDLE_BINARY_DIR}/python") + set_tests_properties(test_collective_split_row_linear + PROPERTIES TIMEOUT "300" RUN_SERIAL 1) +endif() +if((WITH_GPU OR WITH_ROCM) AND (LINUX)) + py_test_modules( + test_collective_wait MODULES test_collective_wait ENVS + "http_proxy=;https_proxy=;PYTHONPATH=..:${PADDLE_BINARY_DIR}/python") + set_tests_properties(test_collective_wait PROPERTIES TIMEOUT "300" RUN_SERIAL + 1) +endif() +if((WITH_GPU OR WITH_ROCM) AND (LINUX)) + py_test_modules( + test_eager_dist_api MODULES test_eager_dist_api ENVS + "http_proxy=;https_proxy=;PYTHONPATH=..:${PADDLE_BINARY_DIR}/python") + set_tests_properties(test_eager_dist_api PROPERTIES TIMEOUT "120" RUN_SERIAL + 1) +endif() +if((WITH_GPU OR WITH_ROCM) AND (LINUX)) + py_test_modules( + test_new_group_api MODULES test_new_group_api ENVS + "http_proxy=;https_proxy=;PYTHONPATH=..:${PADDLE_BINARY_DIR}/python") + set_tests_properties(test_new_group_api PROPERTIES TIMEOUT "120" RUN_SERIAL 1) +endif() +if((WITH_GPU + OR WITH_ROCM + OR WITH_ASCEND + OR WITH_ASCEND_CL + ) + AND LOCAL_ALL_PLAT) bash_test_modules( - test_collective_split_embedding + test_gen_nccl_id_op START_BASH ../dist_test.sh LABELS "RUN_TYPE=DIST" ENVS - "PADDLE_DIST_UT_PORT=20081;PYTHONPATH=..:${PADDLE_BINARY_DIR}/python;http_proxy=;https_proxy=" + "PADDLE_DIST_UT_PORT=21298;http_proxy=;https_proxy=;PYTHONPATH=..:${PADDLE_BINARY_DIR}/python" ) - set_tests_properties(test_collective_split_embedding PROPERTIES TIMEOUT "300" - RUN_SERIAL 1) + set_tests_properties(test_gen_nccl_id_op PROPERTIES RUN_SERIAL 1) endif() +add_subdirectory(fleet) +add_subdirectory(multinode) diff --git a/python/paddle/fluid/tests/unittests/collective/README.md b/python/paddle/fluid/tests/unittests/collective/README.md index f819de24844..f34a177570c 100644 --- a/python/paddle/fluid/tests/unittests/collective/README.md +++ b/python/paddle/fluid/tests/unittests/collective/README.md @@ -6,16 +6,15 @@ and specify the properties for the new unit test the properties are the following: * `name`: the test's name -* `os`: The supported operator system, ignoring case. If the test run in multiple operator systems, use ";" to split systems, forexample, `apple;linux` means the test runs on both Apple and Linux. The supported values are `linux`,`win32` and `apple`. If the value is empty, this means the test runs on all opertaor systems. -* `arch`: the device's architecture. similar to `os`, multiple valuse ars splited by ";" and ignoring case. The supported architectures are `gpu`, `xpu`, `npu` and `rocm`. +* `os`: The supported operator system, ignoring case. If the test run in multiple operator systems, use ";" to split systems, for example, `apple;linux` means the test runs on both Apple and Linux. The supported values are `linux`,`win32` and `apple`. If the value is empty, this means the test runs on all opertaor systems. +* `arch`: the device's architecture. similar to `os`, multiple valuse ars splited by ";" and ignoring case. The supported architectures are `gpu`, `xpu`, `ASCEND`, `ASCEND_CL` and `rocm`. * `timeout`: timeout of a unittest, whose unit is second. * `run_type`: run_type of a unittest. Supported values are `NIGHTLY`, `EXCLUSIVE`, `CINN`, `DIST`, `GPUPS`, `INFER`, `EXCLUSIVE:NIGHTLY`, `DIST:NIGHTLY`,which are case-insensitive. * `launcher`: the test launcher.Supported values are test_runner.py, dist_test.sh and custom scripts' name. -* `dist_ut_port`: the starting port used in a distributed unit test +* `num_port`: the number os port used in a distributed unit test * `run_serial`: whether in serial mode. the value can be 1 or 0.Default (empty) is 0. * `ENVS`: required environments. multiple envirenmonts are splited by ";". -* `conditions`: extra required conditions for some tests. the value is a boolean expression in cmake programmer. - +* `conditions`: extra required conditions for some tests. The value is a list of boolean expression in cmake programmer, splited with ";". For example, the value can be `WITH_DGC;NOT WITH_NCCL` or `WITH_NCCL;${NCCL_VERSION} VERSION_GREATER_EQUAL 2212`,The relationship between these expressions is a conjunction. ### step 3. Generate CmakeLists.txt Run the cmd: diff --git a/python/paddle/fluid/tests/unittests/collective_allgather_api.py b/python/paddle/fluid/tests/unittests/collective/collective_allgather_api.py similarity index 100% rename from python/paddle/fluid/tests/unittests/collective_allgather_api.py rename to python/paddle/fluid/tests/unittests/collective/collective_allgather_api.py diff --git a/python/paddle/fluid/tests/unittests/collective_allgather_api_dygraph.py b/python/paddle/fluid/tests/unittests/collective/collective_allgather_api_dygraph.py similarity index 100% rename from python/paddle/fluid/tests/unittests/collective_allgather_api_dygraph.py rename to python/paddle/fluid/tests/unittests/collective/collective_allgather_api_dygraph.py diff --git a/python/paddle/fluid/tests/unittests/collective_allgather_object_api_dygraph.py b/python/paddle/fluid/tests/unittests/collective/collective_allgather_object_api_dygraph.py similarity index 100% rename from python/paddle/fluid/tests/unittests/collective_allgather_object_api_dygraph.py rename to python/paddle/fluid/tests/unittests/collective/collective_allgather_object_api_dygraph.py diff --git a/python/paddle/fluid/tests/unittests/collective_allreduce_api.py b/python/paddle/fluid/tests/unittests/collective/collective_allreduce_api.py similarity index 100% rename from python/paddle/fluid/tests/unittests/collective_allreduce_api.py rename to python/paddle/fluid/tests/unittests/collective/collective_allreduce_api.py diff --git a/python/paddle/fluid/tests/unittests/collective_allreduce_new_group_api.py b/python/paddle/fluid/tests/unittests/collective/collective_allreduce_new_group_api.py similarity index 100% rename from python/paddle/fluid/tests/unittests/collective_allreduce_new_group_api.py rename to python/paddle/fluid/tests/unittests/collective/collective_allreduce_new_group_api.py diff --git a/python/paddle/fluid/tests/unittests/collective_allreduce_op_wait.py b/python/paddle/fluid/tests/unittests/collective/collective_allreduce_op_wait.py similarity index 100% rename from python/paddle/fluid/tests/unittests/collective_allreduce_op_wait.py rename to python/paddle/fluid/tests/unittests/collective/collective_allreduce_op_wait.py diff --git a/python/paddle/fluid/tests/unittests/collective_alltoall_api.py b/python/paddle/fluid/tests/unittests/collective/collective_alltoall_api.py similarity index 100% rename from python/paddle/fluid/tests/unittests/collective_alltoall_api.py rename to python/paddle/fluid/tests/unittests/collective/collective_alltoall_api.py diff --git a/python/paddle/fluid/tests/unittests/collective_alltoall_api_dygraph.py b/python/paddle/fluid/tests/unittests/collective/collective_alltoall_api_dygraph.py similarity index 100% rename from python/paddle/fluid/tests/unittests/collective_alltoall_api_dygraph.py rename to python/paddle/fluid/tests/unittests/collective/collective_alltoall_api_dygraph.py diff --git a/python/paddle/fluid/tests/unittests/collective_alltoall_single.py b/python/paddle/fluid/tests/unittests/collective/collective_alltoall_single.py similarity index 100% rename from python/paddle/fluid/tests/unittests/collective_alltoall_single.py rename to python/paddle/fluid/tests/unittests/collective/collective_alltoall_single.py diff --git a/python/paddle/fluid/tests/unittests/collective_barrier_api.py b/python/paddle/fluid/tests/unittests/collective/collective_barrier_api.py similarity index 100% rename from python/paddle/fluid/tests/unittests/collective_barrier_api.py rename to python/paddle/fluid/tests/unittests/collective/collective_barrier_api.py diff --git a/python/paddle/fluid/tests/unittests/collective_batch_isend_irecv.py b/python/paddle/fluid/tests/unittests/collective/collective_batch_isend_irecv.py similarity index 100% rename from python/paddle/fluid/tests/unittests/collective_batch_isend_irecv.py rename to python/paddle/fluid/tests/unittests/collective/collective_batch_isend_irecv.py diff --git a/python/paddle/fluid/tests/unittests/collective_broadcast_api.py b/python/paddle/fluid/tests/unittests/collective/collective_broadcast_api.py similarity index 100% rename from python/paddle/fluid/tests/unittests/collective_broadcast_api.py rename to python/paddle/fluid/tests/unittests/collective/collective_broadcast_api.py diff --git a/python/paddle/fluid/tests/unittests/collective_global_gather.py b/python/paddle/fluid/tests/unittests/collective/collective_global_gather.py similarity index 100% rename from python/paddle/fluid/tests/unittests/collective_global_gather.py rename to python/paddle/fluid/tests/unittests/collective/collective_global_gather.py diff --git a/python/paddle/fluid/tests/unittests/collective_global_gather_dygraph.py b/python/paddle/fluid/tests/unittests/collective/collective_global_gather_dygraph.py similarity index 100% rename from python/paddle/fluid/tests/unittests/collective_global_gather_dygraph.py rename to python/paddle/fluid/tests/unittests/collective/collective_global_gather_dygraph.py diff --git a/python/paddle/fluid/tests/unittests/collective_global_scatter.py b/python/paddle/fluid/tests/unittests/collective/collective_global_scatter.py similarity index 100% rename from python/paddle/fluid/tests/unittests/collective_global_scatter.py rename to python/paddle/fluid/tests/unittests/collective/collective_global_scatter.py diff --git a/python/paddle/fluid/tests/unittests/collective_global_scatter_dygraph.py b/python/paddle/fluid/tests/unittests/collective/collective_global_scatter_dygraph.py similarity index 100% rename from python/paddle/fluid/tests/unittests/collective_global_scatter_dygraph.py rename to python/paddle/fluid/tests/unittests/collective/collective_global_scatter_dygraph.py diff --git a/python/paddle/fluid/tests/unittests/collective_reduce_api.py b/python/paddle/fluid/tests/unittests/collective/collective_reduce_api.py similarity index 100% rename from python/paddle/fluid/tests/unittests/collective_reduce_api.py rename to python/paddle/fluid/tests/unittests/collective/collective_reduce_api.py diff --git a/python/paddle/fluid/tests/unittests/collective_reduce_op.py b/python/paddle/fluid/tests/unittests/collective/collective_reduce_op.py similarity index 100% rename from python/paddle/fluid/tests/unittests/collective_reduce_op.py rename to python/paddle/fluid/tests/unittests/collective/collective_reduce_op.py diff --git a/python/paddle/fluid/tests/unittests/collective_reduce_op_calc_stream.py b/python/paddle/fluid/tests/unittests/collective/collective_reduce_op_calc_stream.py similarity index 100% rename from python/paddle/fluid/tests/unittests/collective_reduce_op_calc_stream.py rename to python/paddle/fluid/tests/unittests/collective/collective_reduce_op_calc_stream.py diff --git a/python/paddle/fluid/tests/unittests/collective_reduce_scatter.py b/python/paddle/fluid/tests/unittests/collective/collective_reduce_scatter.py similarity index 100% rename from python/paddle/fluid/tests/unittests/collective_reduce_scatter.py rename to python/paddle/fluid/tests/unittests/collective/collective_reduce_scatter.py diff --git a/python/paddle/fluid/tests/unittests/collective_scatter_api.py b/python/paddle/fluid/tests/unittests/collective/collective_scatter_api.py similarity index 100% rename from python/paddle/fluid/tests/unittests/collective_scatter_api.py rename to python/paddle/fluid/tests/unittests/collective/collective_scatter_api.py diff --git a/python/paddle/fluid/tests/unittests/collective_scatter_op.py b/python/paddle/fluid/tests/unittests/collective/collective_scatter_op.py similarity index 100% rename from python/paddle/fluid/tests/unittests/collective_scatter_op.py rename to python/paddle/fluid/tests/unittests/collective/collective_scatter_op.py diff --git a/python/paddle/fluid/tests/unittests/collective_sendrecv_api.py b/python/paddle/fluid/tests/unittests/collective/collective_sendrecv_api.py similarity index 100% rename from python/paddle/fluid/tests/unittests/collective_sendrecv_api.py rename to python/paddle/fluid/tests/unittests/collective/collective_sendrecv_api.py diff --git a/python/paddle/fluid/tests/unittests/collective_sendrecv_api_dygraph.py b/python/paddle/fluid/tests/unittests/collective/collective_sendrecv_api_dygraph.py similarity index 100% rename from python/paddle/fluid/tests/unittests/collective_sendrecv_api_dygraph.py rename to python/paddle/fluid/tests/unittests/collective/collective_sendrecv_api_dygraph.py diff --git a/python/paddle/fluid/tests/unittests/collective_sendrecv_op.py b/python/paddle/fluid/tests/unittests/collective/collective_sendrecv_op.py similarity index 100% rename from python/paddle/fluid/tests/unittests/collective_sendrecv_op.py rename to python/paddle/fluid/tests/unittests/collective/collective_sendrecv_op.py diff --git a/python/paddle/fluid/tests/unittests/collective_sendrecv_op_array.py b/python/paddle/fluid/tests/unittests/collective/collective_sendrecv_op_array.py similarity index 100% rename from python/paddle/fluid/tests/unittests/collective_sendrecv_op_array.py rename to python/paddle/fluid/tests/unittests/collective/collective_sendrecv_op_array.py diff --git a/python/paddle/fluid/tests/unittests/collective_sendrecv_op_dynamic_shape.py b/python/paddle/fluid/tests/unittests/collective/collective_sendrecv_op_dynamic_shape.py similarity index 100% rename from python/paddle/fluid/tests/unittests/collective_sendrecv_op_dynamic_shape.py rename to python/paddle/fluid/tests/unittests/collective/collective_sendrecv_op_dynamic_shape.py diff --git a/python/paddle/fluid/tests/unittests/column_parallel_linear_api.py b/python/paddle/fluid/tests/unittests/collective/column_parallel_linear_api.py similarity index 100% rename from python/paddle/fluid/tests/unittests/column_parallel_linear_api.py rename to python/paddle/fluid/tests/unittests/collective/column_parallel_linear_api.py diff --git a/python/paddle/fluid/tests/unittests/collective/fleet/CMakeLists.txt b/python/paddle/fluid/tests/unittests/collective/fleet/CMakeLists.txt new file mode 100644 index 00000000000..1d1555839a0 --- /dev/null +++ b/python/paddle/fluid/tests/unittests/collective/fleet/CMakeLists.txt @@ -0,0 +1,865 @@ +# This file is generated by ${PADDLE_ROOT}/tools/gen_ut_cmakelists.py. +# Please don't modify this file manually. +# If you need to change unittests in this file, please modify testslist.csv in the current directory +# and then run the command `python3 ${PADDLE_ROOT}/tools/gen_ut_cmakelists.py -f ${CURRENT_DIRECTORY}/testslist.csv` +set(LOCAL_ALL_ARCH ON) +set(LOCAL_ALL_PLAT ON) +if((WITH_GPU + OR WITH_XPU + OR WITH_ASCEND + OR WITH_ASCEND_CL + ) + AND LOCAL_ALL_PLAT) + py_test_modules( + test_fleet_sharding_meta_optimizer MODULES + test_fleet_sharding_meta_optimizer ENVS + "http_proxy=;https_proxy=;PYTHONPATH=../..:${PADDLE_BINARY_DIR}/python") + set_tests_properties(test_fleet_sharding_meta_optimizer + PROPERTIES TIMEOUT "350" RUN_SERIAL 1) +endif() +if(LOCAL_ALL_ARCH AND (LINUX OR WIN32)) + py_test_modules( + test_fleet_static_mp_layers MODULES test_fleet_static_mp_layers ENVS + "http_proxy=;https_proxy=;PYTHONPATH=../..:${PADDLE_BINARY_DIR}/python") + set_tests_properties(test_fleet_static_mp_layers PROPERTIES RUN_SERIAL 1) +endif() +if(WITH_DGC) + if(LOCAL_ALL_ARCH AND LOCAL_ALL_PLAT) + py_test_modules( + test_dgc_op MODULES test_dgc_op ENVS + "http_proxy=;https_proxy=;PYTHONPATH=../..:${PADDLE_BINARY_DIR}/python") + set_tests_properties(test_dgc_op PROPERTIES RUN_SERIAL 1) + endif() +endif() +if(WITH_DGC) + if(LOCAL_ALL_ARCH AND LOCAL_ALL_PLAT) + py_test_modules( + test_dgc_optimizer MODULES test_dgc_optimizer ENVS + "http_proxy=;https_proxy=;PYTHONPATH=../..:${PADDLE_BINARY_DIR}/python") + set_tests_properties(test_dgc_optimizer PROPERTIES RUN_SERIAL 1) + endif() +endif() +if(WITH_NCCL) + if((WITH_GPU) AND LOCAL_ALL_PLAT) + bash_test_modules( + test_parallel_margin_cross_entropy + START_BASH + ../../dist_test.sh + LABELS + "RUN_TYPE=DIST" + ENVS + "PADDLE_DIST_UT_PORT=21200;http_proxy=;https_proxy=;PYTHONPATH=../..:${PADDLE_BINARY_DIR}/python" + ) + set_tests_properties(test_parallel_margin_cross_entropy + PROPERTIES TIMEOUT "120" RUN_SERIAL 1) + endif() +endif() +if(WITH_NCCL) + if((WITH_GPU) AND LOCAL_ALL_PLAT) + bash_test_modules( + test_dygraph_sharding_stage3 + START_BASH + ../../dist_test.sh + LABELS + "RUN_TYPE=DIST" + ENVS + "PADDLE_DIST_UT_PORT=21202;http_proxy=;https_proxy=;PYTHONPATH=../..:${PADDLE_BINARY_DIR}/python" + ) + set_tests_properties(test_dygraph_sharding_stage3 PROPERTIES TIMEOUT "350" + RUN_SERIAL 1) + endif() +endif() +if(WITH_NCCL) + if(${NCCL_VERSION} VERSION_GREATER_EQUAL 2212) + if((WITH_GPU) AND LOCAL_ALL_PLAT) + bash_test_modules( + test_parallel_dygraph_transformer + START_BASH + ../../dist_test.sh + LABELS + "RUN_TYPE=DIST" + ENVS + "PADDLE_DIST_UT_PORT=21204;http_proxy=;https_proxy=;PYTHONPATH=../..:${PADDLE_BINARY_DIR}/python" + ) + set_tests_properties(test_parallel_dygraph_transformer + PROPERTIES RUN_SERIAL 1) + endif() + endif() +endif() +if((WITH_ROCM) AND LOCAL_ALL_PLAT) + bash_test_modules( + test_parallel_dygraph_transformer + START_BASH + ../../dist_test.sh + LABELS + "RUN_TYPE=DIST" + ENVS + "PADDLE_DIST_UT_PORT=21206;http_proxy=;https_proxy=;PYTHONPATH=../..:${PADDLE_BINARY_DIR}/python" + ) + set_tests_properties(test_parallel_dygraph_transformer PROPERTIES RUN_SERIAL + 1) +endif() +if(LOCAL_ALL_ARCH AND (LINUX OR WIN32)) + py_test_modules( + test_fleet_fp16_allreduce_meta_optimizer MODULES + test_fleet_fp16_allreduce_meta_optimizer ENVS + "http_proxy=;https_proxy=;PYTHONPATH=../..:${PADDLE_BINARY_DIR}/python") + set_tests_properties(test_fleet_fp16_allreduce_meta_optimizer + PROPERTIES RUN_SERIAL 1) +endif() +if((WITH_GPU + OR WITH_XPU + OR WITH_ASCEND + OR WITH_ASCEND_CL + ) + AND LOCAL_ALL_PLAT) + bash_test_modules( + test_rnn_dp + START_BASH + ../../dist_test.sh + LABELS + "RUN_TYPE=DIST" + ENVS + "PADDLE_DIST_UT_PORT=21208;http_proxy=;https_proxy=;PYTHONPATH=../..:${PADDLE_BINARY_DIR}/python" + ) + set_tests_properties(test_rnn_dp PROPERTIES RUN_SERIAL 1) +endif() +if(WITH_NCCL) + if((WITH_GPU) AND LOCAL_ALL_PLAT) + bash_test_modules( + test_parallel_dygraph_mp_layers + START_BASH + ../../dist_test.sh + LABELS + "RUN_TYPE=DIST" + ENVS + "PADDLE_DIST_UT_PORT=21210;http_proxy=;https_proxy=;PYTHONPATH=../..:${PADDLE_BINARY_DIR}/python" + ) + set_tests_properties(test_parallel_dygraph_mp_layers + PROPERTIES TIMEOUT "120" RUN_SERIAL 1) + endif() +endif() +if(LOCAL_ALL_ARCH AND (LINUX OR APPLE)) + bash_test_modules( + test_tcp_store + START_BASH + ../../dist_test.sh + LABELS + "RUN_TYPE=DIST" + ENVS + "PADDLE_DIST_UT_PORT=21212;http_proxy=;https_proxy=;PYTHONPATH=../..:${PADDLE_BINARY_DIR}/python" + ) + set_tests_properties(test_tcp_store PROPERTIES RUN_SERIAL 1) +endif() +if(LOCAL_ALL_ARCH AND LOCAL_ALL_PLAT) + bash_test_modules( + test_dygraph_sharding_stage3_for_eager + START_BASH + ../../dist_test.sh + LABELS + "RUN_TYPE=DIST" + ENVS + "PADDLE_DIST_UT_PORT=21214;http_proxy=;https_proxy=;PYTHONPATH=../..:${PADDLE_BINARY_DIR}/python" + ) + set_tests_properties(test_dygraph_sharding_stage3_for_eager + PROPERTIES TIMEOUT "350" RUN_SERIAL 1) +endif() +if((WITH_GPU + OR WITH_XPU + OR WITH_ASCEND + OR WITH_ASCEND_CL + ) + AND LOCAL_ALL_PLAT) + bash_test_modules( + test_fleet_graph_execution_meta_optimizer + START_BASH + ../../dist_test.sh + LABELS + "RUN_TYPE=DIST" + ENVS + "PADDLE_DIST_UT_PORT=21216;http_proxy=;https_proxy=;PYTHONPATH=../..:${PADDLE_BINARY_DIR}/python" + ) + set_tests_properties(test_fleet_graph_execution_meta_optimizer + PROPERTIES RUN_SERIAL 1) +endif() +if(WITH_NCCL) + if(LOCAL_ALL_ARCH AND LOCAL_ALL_PLAT) + py_test_modules( + test_communicator_half_async + MODULES + test_communicator_half_async + ENVS + "FLAGS_communicator_send_queue_size=1;FLAGS_communicator_max_merge_var_num=1;http_proxy=;https_proxy=;PYTHONPATH=../..:${PADDLE_BINARY_DIR}/python" + ) + set_tests_properties(test_communicator_half_async PROPERTIES TIMEOUT "120" + RUN_SERIAL 1) + endif() +endif() +if((WITH_GPU + OR WITH_XPU + OR WITH_ASCEND + OR WITH_ASCEND_CL + ) + AND LOCAL_ALL_PLAT) + py_test_modules( + test_fleet_graph_executor MODULES test_fleet_graph_executor ENVS + "http_proxy=;https_proxy=;PYTHONPATH=../..:${PADDLE_BINARY_DIR}/python") + set_tests_properties(test_fleet_graph_executor PROPERTIES RUN_SERIAL 1) +endif() +if((WITH_GPU) AND LOCAL_ALL_PLAT) + bash_test_modules( + test_parallel_dygraph_pipeline_parallel + START_BASH + ../../dist_test.sh + LABELS + "RUN_TYPE=DIST" + ENVS + "PADDLE_DIST_UT_PORT=21218;http_proxy=;https_proxy=;PYTHONPATH=../..:${PADDLE_BINARY_DIR}/python" + ) + set_tests_properties(test_parallel_dygraph_pipeline_parallel + PROPERTIES TIMEOUT "500" RUN_SERIAL 1) +endif() +if((WITH_GPU + OR WITH_XPU + OR WITH_ASCEND + OR WITH_ASCEND_CL + ) + AND (LINUX)) + py_test_modules( + test_fleet_localsgd_meta_optimizer MODULES + test_fleet_localsgd_meta_optimizer ENVS + "http_proxy=;https_proxy=;PYTHONPATH=../..:${PADDLE_BINARY_DIR}/python") + set_tests_properties(test_fleet_localsgd_meta_optimizer PROPERTIES RUN_SERIAL + 1) +endif() +if(WITH_NCCL) + if((WITH_GPU) AND LOCAL_ALL_PLAT) + bash_test_modules( + test_parallel_class_center_sample + START_BASH + ../../dist_test.sh + LABELS + "RUN_TYPE=DIST" + ENVS + "PADDLE_DIST_UT_PORT=21220;http_proxy=;https_proxy=;PYTHONPATH=../..:${PADDLE_BINARY_DIR}/python" + ) + set_tests_properties(test_parallel_class_center_sample + PROPERTIES TIMEOUT "120" RUN_SERIAL 1) + endif() +endif() +if(LOCAL_ALL_ARCH AND LOCAL_ALL_PLAT) + bash_test_modules( + test_pipeline + START_BASH + ../../dist_test.sh + LABELS + "RUN_TYPE=DIST" + ENVS + "PADDLE_DIST_UT_PORT=21222;http_proxy=;https_proxy=;PYTHONPATH=../..:${PADDLE_BINARY_DIR}/python" + ) + set_tests_properties(test_pipeline PROPERTIES TIMEOUT "120" RUN_SERIAL 1) +endif() +if(LOCAL_ALL_ARCH AND (LINUX OR APPLE)) + py_test_modules( + test_fleet_utils MODULES test_fleet_utils ENVS + "http_proxy=;https_proxy=;PYTHONPATH=../..:${PADDLE_BINARY_DIR}/python") + set_tests_properties(test_fleet_utils PROPERTIES TIMEOUT "120" RUN_SERIAL 1) +endif() +if(LOCAL_ALL_ARCH AND LOCAL_ALL_PLAT) + bash_test_modules( + test_static_model_parallel + START_BASH + ../../dist_test.sh + LABELS + "RUN_TYPE=DIST" + ENVS + "PADDLE_DIST_UT_PORT=21224;http_proxy=;https_proxy=;PYTHONPATH=../..:${PADDLE_BINARY_DIR}/python" + ) + set_tests_properties(test_static_model_parallel PROPERTIES TIMEOUT "240" + RUN_SERIAL 1) +endif() +if(WITH_NCCL) + if((WITH_GPU) AND LOCAL_ALL_PLAT) + bash_test_modules( + test_parallel_dygraph_no_sync + START_BASH + ../../dist_test.sh + LABELS + "RUN_TYPE=DIST" + ENVS + "PADDLE_DIST_UT_PORT=21226;http_proxy=;https_proxy=;PYTHONPATH=../..:${PADDLE_BINARY_DIR}/python" + ) + set_tests_properties(test_parallel_dygraph_no_sync PROPERTIES TIMEOUT "300" + RUN_SERIAL 1) + endif() +endif() +if(LOCAL_ALL_ARCH AND LOCAL_ALL_PLAT) + bash_test_modules( + test_dygraph_sharding_stage2 + START_BASH + ../../dist_test.sh + LABELS + "RUN_TYPE=DIST" + ENVS + "PADDLE_DIST_UT_PORT=21228;http_proxy=;https_proxy=;PYTHONPATH=../..:${PADDLE_BINARY_DIR}/python" + ) + set_tests_properties(test_dygraph_sharding_stage2 PROPERTIES TIMEOUT "200" + RUN_SERIAL 1) +endif() +if(LOCAL_ALL_ARCH AND LOCAL_ALL_PLAT) + bash_test_modules( + test_parallel_dygraph_control_flow + START_BASH + ../../dist_test.sh + LABELS + "RUN_TYPE=DIST" + ENVS + "PADDLE_DIST_UT_PORT=21230;http_proxy=;https_proxy=;PYTHONPATH=../..:${PADDLE_BINARY_DIR}/python" + ) + set_tests_properties(test_parallel_dygraph_control_flow + PROPERTIES TIMEOUT "350" RUN_SERIAL 1) +endif() +if((WITH_GPU + OR WITH_XPU + OR WITH_ASCEND + OR WITH_ASCEND_CL + ) + AND LOCAL_ALL_PLAT) + bash_test_modules( + test_fleet_lars_meta_optimizer + START_BASH + ../../dist_test.sh + LABELS + "RUN_TYPE=DIST" + ENVS + "PADDLE_DIST_UT_PORT=21232;http_proxy=;https_proxy=;PYTHONPATH=../..:${PADDLE_BINARY_DIR}/python" + ) + set_tests_properties(test_fleet_lars_meta_optimizer PROPERTIES RUN_SERIAL 1) +endif() +if(LOCAL_ALL_ARCH AND LOCAL_ALL_PLAT) + bash_test_modules( + test_hybrid_parallel_inference_helper + START_BASH + ../../dist_test.sh + LABELS + "RUN_TYPE=DIST" + ENVS + "PADDLE_DIST_UT_PORT=21234;http_proxy=;https_proxy=;PYTHONPATH=../..:${PADDLE_BINARY_DIR}/python" + ) + set_tests_properties(test_hybrid_parallel_inference_helper + PROPERTIES TIMEOUT "120" RUN_SERIAL 1) +endif() +if(LOCAL_ALL_ARCH AND LOCAL_ALL_PLAT) + py_test_modules( + test_fleet_rolemaker_new MODULES test_fleet_rolemaker_new ENVS + "http_proxy=;https_proxy=;PYTHONPATH=../..:${PADDLE_BINARY_DIR}/python") + set_tests_properties(test_fleet_rolemaker_new PROPERTIES RUN_SERIAL 1) +endif() +if((WITH_GPU OR WITH_ROCM) AND (LINUX OR WIN32)) + py_test_modules( + test_dist_mnist_gradient_merge MODULES test_dist_mnist_gradient_merge ENVS + "http_proxy=;https_proxy=;PYTHONPATH=../..:${PADDLE_BINARY_DIR}/python") + set_tests_properties(test_dist_mnist_gradient_merge PROPERTIES TIMEOUT "360" + RUN_SERIAL 1) +endif() +if(LOCAL_ALL_ARCH AND LOCAL_ALL_PLAT) + py_test_modules( + test_recv_save_op MODULES test_recv_save_op ENVS + "http_proxy=;https_proxy=;PYTHONPATH=../..:${PADDLE_BINARY_DIR}/python") + set_tests_properties(test_recv_save_op PROPERTIES RUN_SERIAL 1) +endif() +if(LOCAL_ALL_ARCH AND LOCAL_ALL_PLAT) + py_test_modules( + test_communicator_sync + MODULES + test_communicator_sync + ENVS + "FLAGS_communicator_send_queue_size=1;FLAGS_communicator_max_merge_var_num=1;http_proxy=;https_proxy=;PYTHONPATH=../..:${PADDLE_BINARY_DIR}/python" + ) + set_tests_properties(test_communicator_sync PROPERTIES RUN_SERIAL 1) +endif() +if((WITH_GPU + OR WITH_XPU + OR WITH_ASCEND + OR WITH_ASCEND_CL + ) + AND LOCAL_ALL_PLAT) + bash_test_modules( + test_fleet_pipeline_meta_optimizer + START_BASH + ../../dist_test.sh + LABELS + "RUN_TYPE=DIST" + ENVS + "PADDLE_DIST_UT_PORT=21236;http_proxy=;https_proxy=;PYTHONPATH=../..:${PADDLE_BINARY_DIR}/python" + ) + set_tests_properties(test_fleet_pipeline_meta_optimizer PROPERTIES RUN_SERIAL + 1) +endif() +if((WITH_GPU + OR WITH_XPU + OR WITH_ASCEND + OR WITH_ASCEND_CL + ) + AND LOCAL_ALL_PLAT) + py_test_modules( + test_fleet_gradient_merge_meta_optimizer MODULES + test_fleet_gradient_merge_meta_optimizer ENVS + "http_proxy=;https_proxy=;PYTHONPATH=../..:${PADDLE_BINARY_DIR}/python") + set_tests_properties(test_fleet_gradient_merge_meta_optimizer + PROPERTIES RUN_SERIAL 1) +endif() +if(LOCAL_ALL_ARCH AND (LINUX OR WIN32)) + py_test_modules( + test_fleet_amp_init MODULES test_fleet_amp_init ENVS + "http_proxy=;https_proxy=;PYTHONPATH=../..:${PADDLE_BINARY_DIR}/python") + set_tests_properties(test_fleet_amp_init PROPERTIES RUN_SERIAL 1) +endif() +if(LOCAL_ALL_ARCH AND LOCAL_ALL_PLAT) + bash_test_modules( + test_dygraph_sharding_optimizer_stage2 + START_BASH + ../../dist_test.sh + LABELS + "RUN_TYPE=DIST" + ENVS + "PADDLE_DIST_UT_PORT=21238;http_proxy=;https_proxy=;PYTHONPATH=../..:${PADDLE_BINARY_DIR}/python" + ) + set_tests_properties(test_dygraph_sharding_optimizer_stage2 + PROPERTIES TIMEOUT "120" RUN_SERIAL 1) +endif() +if(LOCAL_ALL_ARCH AND (LINUX OR WIN32)) + py_test_modules( + test_fleet_meta_optimizer_base MODULES test_fleet_meta_optimizer_base ENVS + "http_proxy=;https_proxy=;PYTHONPATH=../..:${PADDLE_BINARY_DIR}/python") + set_tests_properties(test_fleet_meta_optimizer_base PROPERTIES RUN_SERIAL 1) +endif() +if((WITH_GPU + OR WITH_XPU + OR WITH_ASCEND + OR WITH_ASCEND_CL + ) + AND LOCAL_ALL_PLAT) + bash_test_modules( + test_fleet_raw_program_meta_optimizer + START_BASH + ../../dist_test.sh + LABELS + "RUN_TYPE=DIST" + ENVS + "PADDLE_DIST_UT_PORT=21240;http_proxy=;https_proxy=;PYTHONPATH=../..:${PADDLE_BINARY_DIR}/python" + ) + set_tests_properties(test_fleet_raw_program_meta_optimizer + PROPERTIES RUN_SERIAL 1) +endif() +if(LOCAL_ALL_ARCH AND LOCAL_ALL_PLAT) + bash_test_modules( + test_parallel_dygraph_sharding_parallel + START_BASH + ../../dist_test.sh + LABELS + "RUN_TYPE=DIST" + ENVS + "PADDLE_DIST_UT_PORT=21242;http_proxy=;https_proxy=;PYTHONPATH=../..:${PADDLE_BINARY_DIR}/python" + ) + set_tests_properties(test_parallel_dygraph_sharding_parallel + PROPERTIES TIMEOUT "120" RUN_SERIAL 1) +endif() +if(LOCAL_ALL_ARCH AND LOCAL_ALL_PLAT) + bash_test_modules( + test_parallel_dygraph_tensor_parallel + START_BASH + ../../dist_test.sh + LABELS + "RUN_TYPE=DIST" + ENVS + "PADDLE_DIST_UT_PORT=21244;http_proxy=;https_proxy=;PYTHONPATH=../..:${PADDLE_BINARY_DIR}/python" + ) + set_tests_properties(test_parallel_dygraph_tensor_parallel + PROPERTIES TIMEOUT "200" RUN_SERIAL 1) +endif() +if(LOCAL_ALL_ARCH AND LOCAL_ALL_PLAT) + bash_test_modules( + test_dygraph_group_sharded_api_for_eager + START_BASH + ../../dist_test.sh + LABELS + "RUN_TYPE=DIST" + ENVS + "PADDLE_DIST_UT_PORT=21246;http_proxy=;https_proxy=;PYTHONPATH=../..:${PADDLE_BINARY_DIR}/python" + ) + set_tests_properties(test_dygraph_group_sharded_api_for_eager + PROPERTIES TIMEOUT "120" RUN_SERIAL 1) +endif() +if(LOCAL_ALL_ARCH AND (LINUX OR WIN32)) + py_test_modules( + test_fleet_distributed_strategy MODULES test_fleet_distributed_strategy + ENVS + "http_proxy=;https_proxy=;PYTHONPATH=../..:${PADDLE_BINARY_DIR}/python") + set_tests_properties(test_fleet_distributed_strategy PROPERTIES RUN_SERIAL 1) +endif() +if(WITH_DGC) + if(LOCAL_ALL_ARCH AND LOCAL_ALL_PLAT) + py_test_modules( + test_fleet_dgc_meta_optimizer MODULES test_fleet_dgc_meta_optimizer ENVS + "http_proxy=;https_proxy=;PYTHONPATH=../..:${PADDLE_BINARY_DIR}/python") + set_tests_properties(test_fleet_dgc_meta_optimizer PROPERTIES RUN_SERIAL 1) + endif() +endif() +if(LOCAL_ALL_ARCH AND LOCAL_ALL_PLAT) + bash_test_modules( + test_parallel_dygraph_unused_variables + START_BASH + ../../dist_test.sh + LABELS + "RUN_TYPE=DIST" + ENVS + "PADDLE_DIST_UT_PORT=21248;http_proxy=;https_proxy=;PYTHONPATH=../..:${PADDLE_BINARY_DIR}/python" + ) + set_tests_properties(test_parallel_dygraph_unused_variables + PROPERTIES TIMEOUT "350" RUN_SERIAL 1) +endif() +if((WITH_GPU + OR WITH_XPU + OR WITH_ASCEND + OR WITH_ASCEND_CL + ) + AND (LINUX)) + py_test_modules( + test_fleet_lamb_meta_optimizer MODULES test_fleet_lamb_meta_optimizer ENVS + "http_proxy=;https_proxy=;PYTHONPATH=../..:${PADDLE_BINARY_DIR}/python") + set_tests_properties(test_fleet_lamb_meta_optimizer PROPERTIES RUN_SERIAL 1) +endif() +if(WITH_DGC) + if(LOCAL_ALL_ARCH AND LOCAL_ALL_PLAT) + py_test_modules( + test_dgc_momentum_op MODULES test_dgc_momentum_op ENVS + "http_proxy=;https_proxy=;PYTHONPATH=../..:${PADDLE_BINARY_DIR}/python") + set_tests_properties(test_dgc_momentum_op PROPERTIES RUN_SERIAL 1) + endif() +endif() +if(LOCAL_ALL_ARCH AND LOCAL_ALL_PLAT) + bash_test_modules( + test_parallel_dygraph_no_sync_gradient_check + START_BASH + ../../dist_test.sh + LABELS + "RUN_TYPE=DIST" + ENVS + "PADDLE_DIST_UT_PORT=21250;http_proxy=;https_proxy=;PYTHONPATH=../..:${PADDLE_BINARY_DIR}/python" + ) + set_tests_properties(test_parallel_dygraph_no_sync_gradient_check + PROPERTIES TIMEOUT "60" RUN_SERIAL 1) +endif() +if((WITH_GPU + OR WITH_XPU + OR WITH_ASCEND + OR WITH_ASCEND_CL + ) + AND LOCAL_ALL_PLAT) + bash_test_modules( + test_fleet_pipeline_meta_optimizer_with_recompute + START_BASH + ../../dist_test.sh + LABELS + "RUN_TYPE=DIST" + ENVS + "PADDLE_DIST_UT_PORT=21252;http_proxy=;https_proxy=;PYTHONPATH=../..:${PADDLE_BINARY_DIR}/python" + ) + set_tests_properties(test_fleet_pipeline_meta_optimizer_with_recompute + PROPERTIES RUN_SERIAL 1) +endif() +if((WITH_GPU + OR WITH_XPU + OR WITH_ASCEND + OR WITH_ASCEND_CL + ) + AND (WIN32 OR LINUX)) + py_test_modules( + test_fleet_hybrid_meta_optimizer MODULES test_fleet_hybrid_meta_optimizer + ENVS + "http_proxy=;https_proxy=;PYTHONPATH=../..:${PADDLE_BINARY_DIR}/python") + set_tests_properties(test_fleet_hybrid_meta_optimizer PROPERTIES RUN_SERIAL 1) +endif() +if(LOCAL_ALL_ARCH AND LOCAL_ALL_PLAT) + bash_test_modules( + test_parallel_dygraph_qat + START_BASH + ../../dist_test.sh + LABELS + "RUN_TYPE=DIST" + ENVS + "PADDLE_DIST_UT_PORT=21254;http_proxy=;https_proxy=;PYTHONPATH=../..:${PADDLE_BINARY_DIR}/python" + ) + set_tests_properties(test_parallel_dygraph_qat PROPERTIES TIMEOUT "120" + RUN_SERIAL 1) +endif() +if(WITH_NCCL) + if(${NCCL_VERSION} VERSION_GREATER_EQUAL 2212) + if((WITH_GPU) AND LOCAL_ALL_PLAT) + bash_test_modules( + test_parallel_dygraph_sparse_embedding + START_BASH + ../../dist_test.sh + LABELS + "RUN_TYPE=DIST" + ENVS + "PADDLE_DIST_UT_PORT=21256;http_proxy=;https_proxy=;PYTHONPATH=../..:${PADDLE_BINARY_DIR}/python" + ) + set_tests_properties(test_parallel_dygraph_sparse_embedding + PROPERTIES TIMEOUT "200" RUN_SERIAL 1) + endif() + endif() +endif() +if((WITH_ROCM) AND LOCAL_ALL_PLAT) + bash_test_modules( + test_parallel_dygraph_sparse_embedding + START_BASH + ../../dist_test.sh + LABELS + "RUN_TYPE=DIST" + ENVS + "PADDLE_DIST_UT_PORT=21258;http_proxy=;https_proxy=;PYTHONPATH=../..:${PADDLE_BINARY_DIR}/python" + ) + set_tests_properties(test_parallel_dygraph_sparse_embedding + PROPERTIES TIMEOUT "200" RUN_SERIAL 1) +endif() +if((WITH_GPU + OR WITH_XPU + OR WITH_ASCEND + OR WITH_ASCEND_CL + ) + AND LOCAL_ALL_PLAT) + py_test_modules( + test_fleet_amp_meta_optimizer MODULES test_fleet_amp_meta_optimizer ENVS + "http_proxy=;https_proxy=;PYTHONPATH=../..:${PADDLE_BINARY_DIR}/python") + set_tests_properties(test_fleet_amp_meta_optimizer PROPERTIES RUN_SERIAL 1) +endif() +if(WITH_NCCL) + if(${NCCL_VERSION} VERSION_GREATER_EQUAL 2212) + if((WITH_GPU) AND LOCAL_ALL_PLAT) + bash_test_modules( + test_parallel_dygraph_sparse_embedding_over_height + START_BASH + ../../dist_test.sh + LABELS + "RUN_TYPE=DIST" + ENVS + "PADDLE_DIST_UT_PORT=21260;http_proxy=;https_proxy=;PYTHONPATH=../..:${PADDLE_BINARY_DIR}/python" + ) + set_tests_properties(test_parallel_dygraph_sparse_embedding_over_height + PROPERTIES TIMEOUT "150" RUN_SERIAL 1) + endif() + endif() +endif() +if((WITH_ROCM) AND LOCAL_ALL_PLAT) + bash_test_modules( + test_parallel_dygraph_sparse_embedding_over_height + START_BASH + ../../dist_test.sh + LABELS + "RUN_TYPE=DIST" + ENVS + "PADDLE_DIST_UT_PORT=21262;http_proxy=;https_proxy=;PYTHONPATH=../..:${PADDLE_BINARY_DIR}/python" + ) + set_tests_properties(test_parallel_dygraph_sparse_embedding_over_height + PROPERTIES TIMEOUT "350" RUN_SERIAL 1) +endif() +if(LOCAL_ALL_ARCH AND (LINUX OR APPLE)) + py_test_modules( + test_distributed_strategy MODULES test_distributed_strategy ENVS + "http_proxy=;https_proxy=;PYTHONPATH=../..:${PADDLE_BINARY_DIR}/python") + set_tests_properties(test_distributed_strategy PROPERTIES RUN_SERIAL 1) +endif() +if(LOCAL_ALL_ARCH AND LOCAL_ALL_PLAT) + bash_test_modules( + test_auto_parallel_parallelizer + START_BASH + ../../dist_test.sh + LABELS + "RUN_TYPE=DIST" + ENVS + "PADDLE_DIST_UT_PORT=21264;http_proxy=;https_proxy=;PYTHONPATH=../..:${PADDLE_BINARY_DIR}/python" + ) + set_tests_properties(test_auto_parallel_parallelizer PROPERTIES TIMEOUT "120" + RUN_SERIAL 1) +endif() +if((WITH_GPU + OR WITH_XPU + OR WITH_ASCEND + OR WITH_ASCEND_CL + ) + AND (LINUX OR WIN32)) + py_test_modules( + test_fleet_recompute_meta_optimizer MODULES + test_fleet_recompute_meta_optimizer ENVS + "http_proxy=;https_proxy=;PYTHONPATH=../..:${PADDLE_BINARY_DIR}/python") + set_tests_properties(test_fleet_recompute_meta_optimizer PROPERTIES RUN_SERIAL + 1) +endif() +if(LOCAL_ALL_ARCH AND LOCAL_ALL_PLAT) + bash_test_modules( + test_dygraph_group_sharded_api + START_BASH + ../../dist_test.sh + LABELS + "RUN_TYPE=DIST" + ENVS + "PADDLE_DIST_UT_PORT=21266;http_proxy=;https_proxy=;PYTHONPATH=../..:${PADDLE_BINARY_DIR}/python" + ) + set_tests_properties(test_dygraph_group_sharded_api PROPERTIES TIMEOUT "120" + RUN_SERIAL 1) +endif() +if(LOCAL_ALL_ARCH AND (LINUX OR WIN32)) + py_test_modules( + test_fleet_private_function MODULES test_fleet_private_function ENVS + "http_proxy=;https_proxy=;PYTHONPATH=../..:${PADDLE_BINARY_DIR}/python") + set_tests_properties(test_fleet_private_function PROPERTIES RUN_SERIAL 1) +endif() +if((WITH_GPU + OR WITH_XPU + OR WITH_ASCEND + OR WITH_ASCEND_CL + ) + AND LOCAL_ALL_PLAT) + bash_test_modules( + test_new_group + START_BASH + test_new_group.sh + LABELS + "RUN_TYPE=DIST" + ENVS + "PADDLE_DIST_UT_PORT=21268;http_proxy=;https_proxy=") + set_tests_properties(test_new_group PROPERTIES RUN_SERIAL 1) +endif() +if((WITH_GPU + OR WITH_XPU + OR WITH_ASCEND + OR WITH_ASCEND_CL + ) + AND (LINUX)) + bash_test_modules( + test_c_comm_init_op + START_BASH + test_c_comm_init_op.sh + LABELS + "RUN_TYPE=DIST" + ENVS + "PADDLE_DIST_UT_PORT=21270;http_proxy=;https_proxy=") + set_tests_properties(test_c_comm_init_op PROPERTIES TIMEOUT "120" RUN_SERIAL + 1) +endif() +if(LOCAL_ALL_ARCH AND LOCAL_ALL_PLAT) + bash_test_modules( + test_ir_pass_pipeline + START_BASH + ../../dist_test.sh + LABELS + "RUN_TYPE=DIST" + ENVS + "PADDLE_DIST_UT_PORT=21272;http_proxy=;https_proxy=;PYTHONPATH=../..:${PADDLE_BINARY_DIR}/python" + ) + set_tests_properties(test_ir_pass_pipeline PROPERTIES TIMEOUT "120" + RUN_SERIAL 1) +endif() +if((WITH_GPU OR WITH_ROCM) AND LOCAL_ALL_PLAT) + bash_test_modules( + test_parallel_dygraph_mnist + START_BASH + ../../dist_test.sh + LABELS + "RUN_TYPE=DIST" + ENVS + "PADDLE_DIST_UT_PORT=21274;http_proxy=;https_proxy=;PYTHONPATH=../..:${PADDLE_BINARY_DIR}/python" + ) + set_tests_properties(test_parallel_dygraph_mnist PROPERTIES TIMEOUT "200" + RUN_SERIAL 1) +endif() +if((WITH_GPU OR WITH_ROCM) AND LOCAL_ALL_PLAT) + bash_test_modules( + test_parallel_dygraph_se_resnext + START_BASH + ../../dist_test.sh + LABELS + "RUN_TYPE=DIST" + ENVS + "PADDLE_DIST_UT_PORT=21276;http_proxy=;https_proxy=;PYTHONPATH=../..:${PADDLE_BINARY_DIR}/python" + ) + set_tests_properties(test_parallel_dygraph_se_resnext + PROPERTIES TIMEOUT "200" RUN_SERIAL 1) +endif() +if((WITH_GPU OR WITH_ROCM) AND LOCAL_ALL_PLAT) + py_test_modules( + test_parallel_dygraph_sync_batch_norm MODULES + test_parallel_dygraph_sync_batch_norm ENVS + "http_proxy=;https_proxy=;PYTHONPATH=../..:${PADDLE_BINARY_DIR}/python") + set_tests_properties(test_parallel_dygraph_sync_batch_norm + PROPERTIES TIMEOUT "120" RUN_SERIAL 1) +endif() +if((WITH_GPU OR WITH_ROCM) AND LOCAL_ALL_PLAT) + py_test_modules( + test_imperative_auto_mixed_precision MODULES + test_imperative_auto_mixed_precision ENVS + "http_proxy=;https_proxy=;PYTHONPATH=../..:${PADDLE_BINARY_DIR}/python") + set_tests_properties(test_imperative_auto_mixed_precision + PROPERTIES TIMEOUT "300" RUN_SERIAL 1) +endif() +if((WITH_GPU OR WITH_ROCM) AND LOCAL_ALL_PLAT) + py_test_modules( + test_imperative_auto_mixed_precision_for_eager MODULES + test_imperative_auto_mixed_precision_for_eager ENVS + "http_proxy=;https_proxy=;PYTHONPATH=../..:${PADDLE_BINARY_DIR}/python") + set_tests_properties(test_imperative_auto_mixed_precision_for_eager + PROPERTIES TIMEOUT "300" RUN_SERIAL 1) +endif() +if((WITH_GPU OR WITH_ROCM) AND LOCAL_ALL_PLAT) + py_test_modules( + test_mixed_precision MODULES test_mixed_precision ENVS + "http_proxy=;https_proxy=;PYTHONPATH=../..:${PADDLE_BINARY_DIR}/python") + set_tests_properties(test_mixed_precision PROPERTIES RUN_SERIAL 1) +endif() +if((WITH_GPU OR WITH_ROCM) AND LOCAL_ALL_PLAT) + py_test_modules( + test_dygraph_recompute MODULES test_dygraph_recompute ENVS + "http_proxy=;https_proxy=;PYTHONPATH=../..:${PADDLE_BINARY_DIR}/python") + set_tests_properties(test_dygraph_recompute PROPERTIES RUN_SERIAL 1) +endif() +if((WITH_GPU OR WITH_ROCM) AND LOCAL_ALL_PLAT) + py_test_modules( + test_dygraph_recompute_for_eager MODULES test_dygraph_recompute_for_eager + ENVS + "http_proxy=;https_proxy=;PYTHONPATH=../..:${PADDLE_BINARY_DIR}/python") + set_tests_properties(test_dygraph_recompute_for_eager PROPERTIES RUN_SERIAL 1) +endif() +if(WITH_NCCL OR WITH_RCCL) + if(WITH_DGC) + if(LOCAL_ALL_ARCH AND LOCAL_ALL_PLAT) + bash_test_modules( + test_dist_mnist_dgc_nccl + START_BASH + ../../dist_test.sh + LABELS + "RUN_TYPE=DIST" + ENVS + "PADDLE_DIST_UT_PORT=21278;http_proxy=;https_proxy=;PYTHONPATH=../..:${PADDLE_BINARY_DIR}/python" + ) + set_tests_properties(test_dist_mnist_dgc_nccl PROPERTIES RUN_SERIAL 1) + endif() + endif() +endif() +if(WITH_NCCL OR WITH_RCCL) + if(WITH_DGC) + if(LOCAL_ALL_ARCH AND LOCAL_ALL_PLAT) + bash_test_modules( + test_dist_se_resnext_dgc + START_BASH + ../../dist_test.sh + LABELS + "RUN_TYPE=DIST" + ENVS + "PADDLE_DIST_UT_PORT=21280;http_proxy=;https_proxy=;PYTHONPATH=../..:${PADDLE_BINARY_DIR}/python" + ) + set_tests_properties(test_dist_se_resnext_dgc PROPERTIES RUN_SERIAL 1) + endif() + endif() +endif() diff --git a/python/paddle/fluid/tests/unittests/auto_parallel_parallelizer.py b/python/paddle/fluid/tests/unittests/collective/fleet/auto_parallel_parallelizer.py similarity index 100% rename from python/paddle/fluid/tests/unittests/auto_parallel_parallelizer.py rename to python/paddle/fluid/tests/unittests/collective/fleet/auto_parallel_parallelizer.py diff --git a/python/paddle/fluid/tests/unittests/c_comm_init_op.py b/python/paddle/fluid/tests/unittests/collective/fleet/c_comm_init_op.py similarity index 100% rename from python/paddle/fluid/tests/unittests/c_comm_init_op.py rename to python/paddle/fluid/tests/unittests/collective/fleet/c_comm_init_op.py diff --git a/python/paddle/fluid/tests/unittests/dist_mnist_gradient_merge.py b/python/paddle/fluid/tests/unittests/collective/fleet/dist_mnist_gradient_merge.py similarity index 100% rename from python/paddle/fluid/tests/unittests/dist_mnist_gradient_merge.py rename to python/paddle/fluid/tests/unittests/collective/fleet/dist_mnist_gradient_merge.py diff --git a/python/paddle/fluid/tests/unittests/dist_mnist_gradient_merge_raw_optimizer.py b/python/paddle/fluid/tests/unittests/collective/fleet/dist_mnist_gradient_merge_raw_optimizer.py similarity index 100% rename from python/paddle/fluid/tests/unittests/dist_mnist_gradient_merge_raw_optimizer.py rename to python/paddle/fluid/tests/unittests/collective/fleet/dist_mnist_gradient_merge_raw_optimizer.py diff --git a/python/paddle/fluid/tests/unittests/dygraph_group_sharded_api.py b/python/paddle/fluid/tests/unittests/collective/fleet/dygraph_group_sharded_api.py similarity index 100% rename from python/paddle/fluid/tests/unittests/dygraph_group_sharded_api.py rename to python/paddle/fluid/tests/unittests/collective/fleet/dygraph_group_sharded_api.py diff --git a/python/paddle/fluid/tests/unittests/dygraph_group_sharded_api_eager.py b/python/paddle/fluid/tests/unittests/collective/fleet/dygraph_group_sharded_api_eager.py similarity index 100% rename from python/paddle/fluid/tests/unittests/dygraph_group_sharded_api_eager.py rename to python/paddle/fluid/tests/unittests/collective/fleet/dygraph_group_sharded_api_eager.py diff --git a/python/paddle/fluid/tests/unittests/dygraph_group_sharded_stage2.py b/python/paddle/fluid/tests/unittests/collective/fleet/dygraph_group_sharded_stage2.py similarity index 100% rename from python/paddle/fluid/tests/unittests/dygraph_group_sharded_stage2.py rename to python/paddle/fluid/tests/unittests/collective/fleet/dygraph_group_sharded_stage2.py diff --git a/python/paddle/fluid/tests/unittests/dygraph_group_sharded_stage2_offload.py b/python/paddle/fluid/tests/unittests/collective/fleet/dygraph_group_sharded_stage2_offload.py similarity index 100% rename from python/paddle/fluid/tests/unittests/dygraph_group_sharded_stage2_offload.py rename to python/paddle/fluid/tests/unittests/collective/fleet/dygraph_group_sharded_stage2_offload.py diff --git a/python/paddle/fluid/tests/unittests/dygraph_group_sharded_stage3.py b/python/paddle/fluid/tests/unittests/collective/fleet/dygraph_group_sharded_stage3.py similarity index 100% rename from python/paddle/fluid/tests/unittests/dygraph_group_sharded_stage3.py rename to python/paddle/fluid/tests/unittests/collective/fleet/dygraph_group_sharded_stage3.py diff --git a/python/paddle/fluid/tests/unittests/dygraph_group_sharded_stage3_offload.py b/python/paddle/fluid/tests/unittests/collective/fleet/dygraph_group_sharded_stage3_offload.py similarity index 100% rename from python/paddle/fluid/tests/unittests/dygraph_group_sharded_stage3_offload.py rename to python/paddle/fluid/tests/unittests/collective/fleet/dygraph_group_sharded_stage3_offload.py diff --git a/python/paddle/fluid/tests/unittests/dygraph_sharding_optimizer_stage2.py b/python/paddle/fluid/tests/unittests/collective/fleet/dygraph_sharding_optimizer_stage2.py similarity index 100% rename from python/paddle/fluid/tests/unittests/dygraph_sharding_optimizer_stage2.py rename to python/paddle/fluid/tests/unittests/collective/fleet/dygraph_sharding_optimizer_stage2.py diff --git a/python/paddle/fluid/tests/unittests/dygraph_sharding_stage2.py b/python/paddle/fluid/tests/unittests/collective/fleet/dygraph_sharding_stage2.py similarity index 100% rename from python/paddle/fluid/tests/unittests/dygraph_sharding_stage2.py rename to python/paddle/fluid/tests/unittests/collective/fleet/dygraph_sharding_stage2.py diff --git a/python/paddle/fluid/tests/unittests/dygraph_sharding_stage2_offload.py b/python/paddle/fluid/tests/unittests/collective/fleet/dygraph_sharding_stage2_offload.py similarity index 100% rename from python/paddle/fluid/tests/unittests/dygraph_sharding_stage2_offload.py rename to python/paddle/fluid/tests/unittests/collective/fleet/dygraph_sharding_stage2_offload.py diff --git a/python/paddle/fluid/tests/unittests/dygraph_sharding_stage3.py b/python/paddle/fluid/tests/unittests/collective/fleet/dygraph_sharding_stage3.py similarity index 100% rename from python/paddle/fluid/tests/unittests/dygraph_sharding_stage3.py rename to python/paddle/fluid/tests/unittests/collective/fleet/dygraph_sharding_stage3.py diff --git a/python/paddle/fluid/tests/unittests/dygraph_sharding_stage3_offload.py b/python/paddle/fluid/tests/unittests/collective/fleet/dygraph_sharding_stage3_offload.py similarity index 100% rename from python/paddle/fluid/tests/unittests/dygraph_sharding_stage3_offload.py rename to python/paddle/fluid/tests/unittests/collective/fleet/dygraph_sharding_stage3_offload.py diff --git a/python/paddle/fluid/tests/unittests/hybrid_parallel_communicate_group.py b/python/paddle/fluid/tests/unittests/collective/fleet/hybrid_parallel_communicate_group.py similarity index 100% rename from python/paddle/fluid/tests/unittests/hybrid_parallel_communicate_group.py rename to python/paddle/fluid/tests/unittests/collective/fleet/hybrid_parallel_communicate_group.py diff --git a/python/paddle/fluid/tests/unittests/hybrid_parallel_inference_helper.py b/python/paddle/fluid/tests/unittests/collective/fleet/hybrid_parallel_inference_helper.py similarity index 100% rename from python/paddle/fluid/tests/unittests/hybrid_parallel_inference_helper.py rename to python/paddle/fluid/tests/unittests/collective/fleet/hybrid_parallel_inference_helper.py diff --git a/python/paddle/fluid/tests/unittests/hybrid_parallel_mp_amp.py b/python/paddle/fluid/tests/unittests/collective/fleet/hybrid_parallel_mp_amp.py similarity index 100% rename from python/paddle/fluid/tests/unittests/hybrid_parallel_mp_amp.py rename to python/paddle/fluid/tests/unittests/collective/fleet/hybrid_parallel_mp_amp.py diff --git a/python/paddle/fluid/tests/unittests/hybrid_parallel_mp_clip_grad.py b/python/paddle/fluid/tests/unittests/collective/fleet/hybrid_parallel_mp_clip_grad.py similarity index 100% rename from python/paddle/fluid/tests/unittests/hybrid_parallel_mp_clip_grad.py rename to python/paddle/fluid/tests/unittests/collective/fleet/hybrid_parallel_mp_clip_grad.py diff --git a/python/paddle/fluid/tests/unittests/hybrid_parallel_mp_fp16.py b/python/paddle/fluid/tests/unittests/collective/fleet/hybrid_parallel_mp_fp16.py similarity index 100% rename from python/paddle/fluid/tests/unittests/hybrid_parallel_mp_fp16.py rename to python/paddle/fluid/tests/unittests/collective/fleet/hybrid_parallel_mp_fp16.py diff --git a/python/paddle/fluid/tests/unittests/hybrid_parallel_mp_layers.py b/python/paddle/fluid/tests/unittests/collective/fleet/hybrid_parallel_mp_layers.py similarity index 100% rename from python/paddle/fluid/tests/unittests/hybrid_parallel_mp_layers.py rename to python/paddle/fluid/tests/unittests/collective/fleet/hybrid_parallel_mp_layers.py diff --git a/python/paddle/fluid/tests/unittests/hybrid_parallel_mp_model.py b/python/paddle/fluid/tests/unittests/collective/fleet/hybrid_parallel_mp_model.py similarity index 100% rename from python/paddle/fluid/tests/unittests/hybrid_parallel_mp_model.py rename to python/paddle/fluid/tests/unittests/collective/fleet/hybrid_parallel_mp_model.py diff --git a/python/paddle/fluid/tests/unittests/hybrid_parallel_mp_random.py b/python/paddle/fluid/tests/unittests/collective/fleet/hybrid_parallel_mp_random.py similarity index 100% rename from python/paddle/fluid/tests/unittests/hybrid_parallel_mp_random.py rename to python/paddle/fluid/tests/unittests/collective/fleet/hybrid_parallel_mp_random.py diff --git a/python/paddle/fluid/tests/unittests/hybrid_parallel_pp_amp.py b/python/paddle/fluid/tests/unittests/collective/fleet/hybrid_parallel_pp_amp.py similarity index 100% rename from python/paddle/fluid/tests/unittests/hybrid_parallel_pp_amp.py rename to python/paddle/fluid/tests/unittests/collective/fleet/hybrid_parallel_pp_amp.py diff --git a/python/paddle/fluid/tests/unittests/hybrid_parallel_pp_clip_grad.py b/python/paddle/fluid/tests/unittests/collective/fleet/hybrid_parallel_pp_clip_grad.py similarity index 100% rename from python/paddle/fluid/tests/unittests/hybrid_parallel_pp_clip_grad.py rename to python/paddle/fluid/tests/unittests/collective/fleet/hybrid_parallel_pp_clip_grad.py diff --git a/python/paddle/fluid/tests/unittests/hybrid_parallel_pp_embedding.py b/python/paddle/fluid/tests/unittests/collective/fleet/hybrid_parallel_pp_embedding.py similarity index 100% rename from python/paddle/fluid/tests/unittests/hybrid_parallel_pp_embedding.py rename to python/paddle/fluid/tests/unittests/collective/fleet/hybrid_parallel_pp_embedding.py diff --git a/python/paddle/fluid/tests/unittests/hybrid_parallel_pp_fp16.py b/python/paddle/fluid/tests/unittests/collective/fleet/hybrid_parallel_pp_fp16.py similarity index 100% rename from python/paddle/fluid/tests/unittests/hybrid_parallel_pp_fp16.py rename to python/paddle/fluid/tests/unittests/collective/fleet/hybrid_parallel_pp_fp16.py diff --git a/python/paddle/fluid/tests/unittests/hybrid_parallel_pp_recompute.py b/python/paddle/fluid/tests/unittests/collective/fleet/hybrid_parallel_pp_recompute.py similarity index 100% rename from python/paddle/fluid/tests/unittests/hybrid_parallel_pp_recompute.py rename to python/paddle/fluid/tests/unittests/collective/fleet/hybrid_parallel_pp_recompute.py diff --git a/python/paddle/fluid/tests/unittests/hybrid_parallel_pp_save_load.py b/python/paddle/fluid/tests/unittests/collective/fleet/hybrid_parallel_pp_save_load.py similarity index 100% rename from python/paddle/fluid/tests/unittests/hybrid_parallel_pp_save_load.py rename to python/paddle/fluid/tests/unittests/collective/fleet/hybrid_parallel_pp_save_load.py diff --git a/python/paddle/fluid/tests/unittests/hybrid_parallel_pp_transformer.py b/python/paddle/fluid/tests/unittests/collective/fleet/hybrid_parallel_pp_transformer.py similarity index 100% rename from python/paddle/fluid/tests/unittests/hybrid_parallel_pp_transformer.py rename to python/paddle/fluid/tests/unittests/collective/fleet/hybrid_parallel_pp_transformer.py diff --git a/python/paddle/fluid/tests/unittests/hybrid_parallel_qat.py b/python/paddle/fluid/tests/unittests/collective/fleet/hybrid_parallel_qat.py similarity index 100% rename from python/paddle/fluid/tests/unittests/hybrid_parallel_qat.py rename to python/paddle/fluid/tests/unittests/collective/fleet/hybrid_parallel_qat.py diff --git a/python/paddle/fluid/tests/unittests/hybrid_parallel_sharding_model.py b/python/paddle/fluid/tests/unittests/collective/fleet/hybrid_parallel_sharding_model.py similarity index 100% rename from python/paddle/fluid/tests/unittests/hybrid_parallel_sharding_model.py rename to python/paddle/fluid/tests/unittests/collective/fleet/hybrid_parallel_sharding_model.py diff --git a/python/paddle/fluid/tests/unittests/hybrid_parallel_shared_weight.py b/python/paddle/fluid/tests/unittests/collective/fleet/hybrid_parallel_shared_weight.py similarity index 100% rename from python/paddle/fluid/tests/unittests/hybrid_parallel_shared_weight.py rename to python/paddle/fluid/tests/unittests/collective/fleet/hybrid_parallel_shared_weight.py diff --git a/python/paddle/fluid/tests/unittests/new_group.py b/python/paddle/fluid/tests/unittests/collective/fleet/new_group.py similarity index 100% rename from python/paddle/fluid/tests/unittests/new_group.py rename to python/paddle/fluid/tests/unittests/collective/fleet/new_group.py diff --git a/python/paddle/fluid/tests/unittests/parallel_class_center_sample.py b/python/paddle/fluid/tests/unittests/collective/fleet/parallel_class_center_sample.py similarity index 100% rename from python/paddle/fluid/tests/unittests/parallel_class_center_sample.py rename to python/paddle/fluid/tests/unittests/collective/fleet/parallel_class_center_sample.py diff --git a/python/paddle/fluid/tests/unittests/parallel_dygraph_control_flow_different.py b/python/paddle/fluid/tests/unittests/collective/fleet/parallel_dygraph_control_flow_different.py similarity index 100% rename from python/paddle/fluid/tests/unittests/parallel_dygraph_control_flow_different.py rename to python/paddle/fluid/tests/unittests/collective/fleet/parallel_dygraph_control_flow_different.py diff --git a/python/paddle/fluid/tests/unittests/parallel_dygraph_control_flow_same.py b/python/paddle/fluid/tests/unittests/collective/fleet/parallel_dygraph_control_flow_same.py similarity index 100% rename from python/paddle/fluid/tests/unittests/parallel_dygraph_control_flow_same.py rename to python/paddle/fluid/tests/unittests/collective/fleet/parallel_dygraph_control_flow_same.py diff --git a/python/paddle/fluid/tests/unittests/parallel_dygraph_no_sync.py b/python/paddle/fluid/tests/unittests/collective/fleet/parallel_dygraph_no_sync.py similarity index 100% rename from python/paddle/fluid/tests/unittests/parallel_dygraph_no_sync.py rename to python/paddle/fluid/tests/unittests/collective/fleet/parallel_dygraph_no_sync.py diff --git a/python/paddle/fluid/tests/unittests/parallel_dygraph_no_sync_control_flow.py b/python/paddle/fluid/tests/unittests/collective/fleet/parallel_dygraph_no_sync_control_flow.py similarity index 100% rename from python/paddle/fluid/tests/unittests/parallel_dygraph_no_sync_control_flow.py rename to python/paddle/fluid/tests/unittests/collective/fleet/parallel_dygraph_no_sync_control_flow.py diff --git a/python/paddle/fluid/tests/unittests/parallel_dygraph_no_sync_gradient_check.py b/python/paddle/fluid/tests/unittests/collective/fleet/parallel_dygraph_no_sync_gradient_check.py similarity index 100% rename from python/paddle/fluid/tests/unittests/parallel_dygraph_no_sync_gradient_check.py rename to python/paddle/fluid/tests/unittests/collective/fleet/parallel_dygraph_no_sync_gradient_check.py diff --git a/python/paddle/fluid/tests/unittests/parallel_dygraph_no_sync_unused_params.py b/python/paddle/fluid/tests/unittests/collective/fleet/parallel_dygraph_no_sync_unused_params.py similarity index 100% rename from python/paddle/fluid/tests/unittests/parallel_dygraph_no_sync_unused_params.py rename to python/paddle/fluid/tests/unittests/collective/fleet/parallel_dygraph_no_sync_unused_params.py diff --git a/python/paddle/fluid/tests/unittests/parallel_dygraph_se_resnext.py b/python/paddle/fluid/tests/unittests/collective/fleet/parallel_dygraph_se_resnext.py similarity index 100% rename from python/paddle/fluid/tests/unittests/parallel_dygraph_se_resnext.py rename to python/paddle/fluid/tests/unittests/collective/fleet/parallel_dygraph_se_resnext.py diff --git a/python/paddle/fluid/tests/unittests/parallel_dygraph_sync_batch_norm.py b/python/paddle/fluid/tests/unittests/collective/fleet/parallel_dygraph_sync_batch_norm.py similarity index 100% rename from python/paddle/fluid/tests/unittests/parallel_dygraph_sync_batch_norm.py rename to python/paddle/fluid/tests/unittests/collective/fleet/parallel_dygraph_sync_batch_norm.py diff --git a/python/paddle/fluid/tests/unittests/parallel_dygraph_transformer.py b/python/paddle/fluid/tests/unittests/collective/fleet/parallel_dygraph_transformer.py similarity index 100% rename from python/paddle/fluid/tests/unittests/parallel_dygraph_transformer.py rename to python/paddle/fluid/tests/unittests/collective/fleet/parallel_dygraph_transformer.py diff --git a/python/paddle/fluid/tests/unittests/parallel_margin_cross_entropy.py b/python/paddle/fluid/tests/unittests/collective/fleet/parallel_margin_cross_entropy.py similarity index 100% rename from python/paddle/fluid/tests/unittests/parallel_margin_cross_entropy.py rename to python/paddle/fluid/tests/unittests/collective/fleet/parallel_margin_cross_entropy.py diff --git a/python/paddle/fluid/tests/unittests/pipeline_mnist.py b/python/paddle/fluid/tests/unittests/collective/fleet/pipeline_mnist.py similarity index 100% rename from python/paddle/fluid/tests/unittests/pipeline_mnist.py rename to python/paddle/fluid/tests/unittests/collective/fleet/pipeline_mnist.py diff --git a/python/paddle/fluid/tests/unittests/pipeline_mnist_multi_device.py b/python/paddle/fluid/tests/unittests/collective/fleet/pipeline_mnist_multi_device.py similarity index 100% rename from python/paddle/fluid/tests/unittests/pipeline_mnist_multi_device.py rename to python/paddle/fluid/tests/unittests/collective/fleet/pipeline_mnist_multi_device.py diff --git a/python/paddle/fluid/tests/unittests/pipeline_mnist_one_device.py b/python/paddle/fluid/tests/unittests/collective/fleet/pipeline_mnist_one_device.py similarity index 100% rename from python/paddle/fluid/tests/unittests/pipeline_mnist_one_device.py rename to python/paddle/fluid/tests/unittests/collective/fleet/pipeline_mnist_one_device.py diff --git a/python/paddle/fluid/tests/unittests/static_model_parallel_by_col.py b/python/paddle/fluid/tests/unittests/collective/fleet/static_model_parallel_by_col.py similarity index 100% rename from python/paddle/fluid/tests/unittests/static_model_parallel_by_col.py rename to python/paddle/fluid/tests/unittests/collective/fleet/static_model_parallel_by_col.py diff --git a/python/paddle/fluid/tests/unittests/static_model_parallel_by_row.py b/python/paddle/fluid/tests/unittests/collective/fleet/static_model_parallel_by_row.py similarity index 100% rename from python/paddle/fluid/tests/unittests/static_model_parallel_by_row.py rename to python/paddle/fluid/tests/unittests/collective/fleet/static_model_parallel_by_row.py diff --git a/python/paddle/fluid/tests/unittests/static_model_parallel_embedding.py b/python/paddle/fluid/tests/unittests/collective/fleet/static_model_parallel_embedding.py similarity index 100% rename from python/paddle/fluid/tests/unittests/static_model_parallel_embedding.py rename to python/paddle/fluid/tests/unittests/collective/fleet/static_model_parallel_embedding.py diff --git a/python/paddle/fluid/tests/unittests/test_auto_parallel_parallelizer.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_auto_parallel_parallelizer.py similarity index 100% rename from python/paddle/fluid/tests/unittests/test_auto_parallel_parallelizer.py rename to python/paddle/fluid/tests/unittests/collective/fleet/test_auto_parallel_parallelizer.py diff --git a/python/paddle/fluid/tests/unittests/test_c_comm_init_op.sh b/python/paddle/fluid/tests/unittests/collective/fleet/test_c_comm_init_op.sh similarity index 100% rename from python/paddle/fluid/tests/unittests/test_c_comm_init_op.sh rename to python/paddle/fluid/tests/unittests/collective/fleet/test_c_comm_init_op.sh diff --git a/python/paddle/fluid/tests/unittests/test_communicator_half_async.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_communicator_half_async.py similarity index 100% rename from python/paddle/fluid/tests/unittests/test_communicator_half_async.py rename to python/paddle/fluid/tests/unittests/collective/fleet/test_communicator_half_async.py diff --git a/python/paddle/fluid/tests/unittests/test_communicator_sync.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_communicator_sync.py similarity index 100% rename from python/paddle/fluid/tests/unittests/test_communicator_sync.py rename to python/paddle/fluid/tests/unittests/collective/fleet/test_communicator_sync.py diff --git a/python/paddle/fluid/tests/unittests/test_dgc_momentum_op.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_dgc_momentum_op.py similarity index 100% rename from python/paddle/fluid/tests/unittests/test_dgc_momentum_op.py rename to python/paddle/fluid/tests/unittests/collective/fleet/test_dgc_momentum_op.py diff --git a/python/paddle/fluid/tests/unittests/test_dgc_op.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_dgc_op.py similarity index 100% rename from python/paddle/fluid/tests/unittests/test_dgc_op.py rename to python/paddle/fluid/tests/unittests/collective/fleet/test_dgc_op.py diff --git a/python/paddle/fluid/tests/unittests/test_dgc_optimizer.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_dgc_optimizer.py similarity index 100% rename from python/paddle/fluid/tests/unittests/test_dgc_optimizer.py rename to python/paddle/fluid/tests/unittests/collective/fleet/test_dgc_optimizer.py diff --git a/python/paddle/fluid/tests/unittests/test_dist_mnist_dgc_nccl.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_dist_mnist_dgc_nccl.py similarity index 91% rename from python/paddle/fluid/tests/unittests/test_dist_mnist_dgc_nccl.py rename to python/paddle/fluid/tests/unittests/collective/fleet/test_dist_mnist_dgc_nccl.py index ec9c0e96805..80a2bbad461 100644 --- a/python/paddle/fluid/tests/unittests/test_dist_mnist_dgc_nccl.py +++ b/python/paddle/fluid/tests/unittests/collective/fleet/test_dist_mnist_dgc_nccl.py @@ -49,7 +49,7 @@ class TestDistMnistNCCL2DGC(TestDistBase): def test_dist_train(self): import paddle.fluid as fluid if fluid.core.is_compiled_with_cuda(): - self.check_with_place("dist_mnist.py", + self.check_with_place(os.path.abspath("../../dist_mnist.py"), delta=1e-5, check_error_log=True, log_name=flag_name) @@ -80,10 +80,11 @@ class TestDistMnistNCCL2DGCMultiCards(TestDistBase): def test_dist_train(self): import paddle.fluid as fluid if fluid.core.is_compiled_with_cuda(): - self.check_with_place_multi_cards("dist_mnist.py", - delta=1e-5, - check_error_log=True, - log_name=flag_name) + self.check_with_place_multi_cards( + os.path.abspath("../../dist_mnist.py"), + delta=1e-5, + check_error_log=True, + log_name=flag_name) def tearDown(self): import paddle.fluid as fluid diff --git a/python/paddle/fluid/tests/unittests/test_dist_mnist_gradient_merge.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_dist_mnist_gradient_merge.py similarity index 100% rename from python/paddle/fluid/tests/unittests/test_dist_mnist_gradient_merge.py rename to python/paddle/fluid/tests/unittests/collective/fleet/test_dist_mnist_gradient_merge.py diff --git a/python/paddle/fluid/tests/unittests/test_dist_se_resnext_dgc.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_dist_se_resnext_dgc.py similarity index 94% rename from python/paddle/fluid/tests/unittests/test_dist_se_resnext_dgc.py rename to python/paddle/fluid/tests/unittests/collective/fleet/test_dist_se_resnext_dgc.py index 86101cf9fe4..af5495b1619 100644 --- a/python/paddle/fluid/tests/unittests/test_dist_se_resnext_dgc.py +++ b/python/paddle/fluid/tests/unittests/collective/fleet/test_dist_se_resnext_dgc.py @@ -17,8 +17,6 @@ import unittest from test_dist_base import TestDistBase import os -import os - flag_name = os.path.splitext(__file__)[0] @@ -35,7 +33,7 @@ class TestDistSeResnetNCCL2DGC(TestDistBase): def test_dist_train(self): import paddle.fluid as fluid if fluid.core.is_compiled_with_cuda(): - self.check_with_place("dist_se_resnext.py", + self.check_with_place(os.path.abspath("../../dist_se_resnext.py"), delta=30, check_error_log=True, log_name=flag_name) diff --git a/python/paddle/fluid/tests/unittests/test_distributed_strategy.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_distributed_strategy.py similarity index 100% rename from python/paddle/fluid/tests/unittests/test_distributed_strategy.py rename to python/paddle/fluid/tests/unittests/collective/fleet/test_distributed_strategy.py diff --git a/python/paddle/fluid/tests/unittests/test_dygraph_group_sharded_api.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_dygraph_group_sharded_api.py similarity index 100% rename from python/paddle/fluid/tests/unittests/test_dygraph_group_sharded_api.py rename to python/paddle/fluid/tests/unittests/collective/fleet/test_dygraph_group_sharded_api.py diff --git a/python/paddle/fluid/tests/unittests/test_dygraph_group_sharded_api_for_eager.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_dygraph_group_sharded_api_for_eager.py similarity index 100% rename from python/paddle/fluid/tests/unittests/test_dygraph_group_sharded_api_for_eager.py rename to python/paddle/fluid/tests/unittests/collective/fleet/test_dygraph_group_sharded_api_for_eager.py diff --git a/python/paddle/fluid/tests/unittests/test_dygraph_recompute.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_dygraph_recompute.py similarity index 100% rename from python/paddle/fluid/tests/unittests/test_dygraph_recompute.py rename to python/paddle/fluid/tests/unittests/collective/fleet/test_dygraph_recompute.py diff --git a/python/paddle/fluid/tests/unittests/test_dygraph_recompute_for_eager.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_dygraph_recompute_for_eager.py similarity index 100% rename from python/paddle/fluid/tests/unittests/test_dygraph_recompute_for_eager.py rename to python/paddle/fluid/tests/unittests/collective/fleet/test_dygraph_recompute_for_eager.py diff --git a/python/paddle/fluid/tests/unittests/test_dygraph_sharding_optimizer_stage2.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_dygraph_sharding_optimizer_stage2.py similarity index 100% rename from python/paddle/fluid/tests/unittests/test_dygraph_sharding_optimizer_stage2.py rename to python/paddle/fluid/tests/unittests/collective/fleet/test_dygraph_sharding_optimizer_stage2.py diff --git a/python/paddle/fluid/tests/unittests/test_dygraph_sharding_stage2.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_dygraph_sharding_stage2.py similarity index 100% rename from python/paddle/fluid/tests/unittests/test_dygraph_sharding_stage2.py rename to python/paddle/fluid/tests/unittests/collective/fleet/test_dygraph_sharding_stage2.py diff --git a/python/paddle/fluid/tests/unittests/test_dygraph_sharding_stage3.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_dygraph_sharding_stage3.py similarity index 100% rename from python/paddle/fluid/tests/unittests/test_dygraph_sharding_stage3.py rename to python/paddle/fluid/tests/unittests/collective/fleet/test_dygraph_sharding_stage3.py diff --git a/python/paddle/fluid/tests/unittests/test_dygraph_sharding_stage3_for_eager.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_dygraph_sharding_stage3_for_eager.py similarity index 100% rename from python/paddle/fluid/tests/unittests/test_dygraph_sharding_stage3_for_eager.py rename to python/paddle/fluid/tests/unittests/collective/fleet/test_dygraph_sharding_stage3_for_eager.py diff --git a/python/paddle/fluid/tests/unittests/test_fleet_amp_init.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_fleet_amp_init.py similarity index 100% rename from python/paddle/fluid/tests/unittests/test_fleet_amp_init.py rename to python/paddle/fluid/tests/unittests/collective/fleet/test_fleet_amp_init.py diff --git a/python/paddle/fluid/tests/unittests/test_fleet_amp_meta_optimizer.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_fleet_amp_meta_optimizer.py similarity index 100% rename from python/paddle/fluid/tests/unittests/test_fleet_amp_meta_optimizer.py rename to python/paddle/fluid/tests/unittests/collective/fleet/test_fleet_amp_meta_optimizer.py diff --git a/python/paddle/fluid/tests/unittests/test_fleet_dgc_meta_optimizer.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_fleet_dgc_meta_optimizer.py similarity index 100% rename from python/paddle/fluid/tests/unittests/test_fleet_dgc_meta_optimizer.py rename to python/paddle/fluid/tests/unittests/collective/fleet/test_fleet_dgc_meta_optimizer.py diff --git a/python/paddle/fluid/tests/unittests/test_fleet_distributed_strategy.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_fleet_distributed_strategy.py similarity index 100% rename from python/paddle/fluid/tests/unittests/test_fleet_distributed_strategy.py rename to python/paddle/fluid/tests/unittests/collective/fleet/test_fleet_distributed_strategy.py diff --git a/python/paddle/fluid/tests/unittests/test_fleet_fp16_allreduce_meta_optimizer.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_fleet_fp16_allreduce_meta_optimizer.py similarity index 100% rename from python/paddle/fluid/tests/unittests/test_fleet_fp16_allreduce_meta_optimizer.py rename to python/paddle/fluid/tests/unittests/collective/fleet/test_fleet_fp16_allreduce_meta_optimizer.py diff --git a/python/paddle/fluid/tests/unittests/test_fleet_gradient_merge_meta_optimizer.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_fleet_gradient_merge_meta_optimizer.py similarity index 100% rename from python/paddle/fluid/tests/unittests/test_fleet_gradient_merge_meta_optimizer.py rename to python/paddle/fluid/tests/unittests/collective/fleet/test_fleet_gradient_merge_meta_optimizer.py diff --git a/python/paddle/fluid/tests/unittests/test_fleet_graph_execution_meta_optimizer.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_fleet_graph_execution_meta_optimizer.py similarity index 100% rename from python/paddle/fluid/tests/unittests/test_fleet_graph_execution_meta_optimizer.py rename to python/paddle/fluid/tests/unittests/collective/fleet/test_fleet_graph_execution_meta_optimizer.py diff --git a/python/paddle/fluid/tests/unittests/test_fleet_graph_executor.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_fleet_graph_executor.py similarity index 100% rename from python/paddle/fluid/tests/unittests/test_fleet_graph_executor.py rename to python/paddle/fluid/tests/unittests/collective/fleet/test_fleet_graph_executor.py diff --git a/python/paddle/fluid/tests/unittests/test_fleet_hybrid_meta_optimizer.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_fleet_hybrid_meta_optimizer.py similarity index 100% rename from python/paddle/fluid/tests/unittests/test_fleet_hybrid_meta_optimizer.py rename to python/paddle/fluid/tests/unittests/collective/fleet/test_fleet_hybrid_meta_optimizer.py diff --git a/python/paddle/fluid/tests/unittests/test_fleet_lamb_meta_optimizer.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_fleet_lamb_meta_optimizer.py similarity index 100% rename from python/paddle/fluid/tests/unittests/test_fleet_lamb_meta_optimizer.py rename to python/paddle/fluid/tests/unittests/collective/fleet/test_fleet_lamb_meta_optimizer.py diff --git a/python/paddle/fluid/tests/unittests/test_fleet_lars_meta_optimizer.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_fleet_lars_meta_optimizer.py similarity index 100% rename from python/paddle/fluid/tests/unittests/test_fleet_lars_meta_optimizer.py rename to python/paddle/fluid/tests/unittests/collective/fleet/test_fleet_lars_meta_optimizer.py diff --git a/python/paddle/fluid/tests/unittests/test_fleet_localsgd_meta_optimizer.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_fleet_localsgd_meta_optimizer.py similarity index 100% rename from python/paddle/fluid/tests/unittests/test_fleet_localsgd_meta_optimizer.py rename to python/paddle/fluid/tests/unittests/collective/fleet/test_fleet_localsgd_meta_optimizer.py diff --git a/python/paddle/fluid/tests/unittests/test_fleet_meta_optimizer_base.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_fleet_meta_optimizer_base.py similarity index 100% rename from python/paddle/fluid/tests/unittests/test_fleet_meta_optimizer_base.py rename to python/paddle/fluid/tests/unittests/collective/fleet/test_fleet_meta_optimizer_base.py diff --git a/python/paddle/fluid/tests/unittests/test_fleet_pipeline_meta_optimizer.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_fleet_pipeline_meta_optimizer.py similarity index 100% rename from python/paddle/fluid/tests/unittests/test_fleet_pipeline_meta_optimizer.py rename to python/paddle/fluid/tests/unittests/collective/fleet/test_fleet_pipeline_meta_optimizer.py diff --git a/python/paddle/fluid/tests/unittests/test_fleet_pipeline_meta_optimizer_with_recompute.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_fleet_pipeline_meta_optimizer_with_recompute.py similarity index 100% rename from python/paddle/fluid/tests/unittests/test_fleet_pipeline_meta_optimizer_with_recompute.py rename to python/paddle/fluid/tests/unittests/collective/fleet/test_fleet_pipeline_meta_optimizer_with_recompute.py diff --git a/python/paddle/fluid/tests/unittests/test_fleet_private_function.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_fleet_private_function.py similarity index 100% rename from python/paddle/fluid/tests/unittests/test_fleet_private_function.py rename to python/paddle/fluid/tests/unittests/collective/fleet/test_fleet_private_function.py diff --git a/python/paddle/fluid/tests/unittests/test_fleet_raw_program_meta_optimizer.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_fleet_raw_program_meta_optimizer.py similarity index 100% rename from python/paddle/fluid/tests/unittests/test_fleet_raw_program_meta_optimizer.py rename to python/paddle/fluid/tests/unittests/collective/fleet/test_fleet_raw_program_meta_optimizer.py diff --git a/python/paddle/fluid/tests/unittests/test_fleet_recompute_meta_optimizer.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_fleet_recompute_meta_optimizer.py similarity index 100% rename from python/paddle/fluid/tests/unittests/test_fleet_recompute_meta_optimizer.py rename to python/paddle/fluid/tests/unittests/collective/fleet/test_fleet_recompute_meta_optimizer.py diff --git a/python/paddle/fluid/tests/unittests/test_fleet_rolemaker_new.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_fleet_rolemaker_new.py similarity index 100% rename from python/paddle/fluid/tests/unittests/test_fleet_rolemaker_new.py rename to python/paddle/fluid/tests/unittests/collective/fleet/test_fleet_rolemaker_new.py diff --git a/python/paddle/fluid/tests/unittests/test_fleet_sharding_meta_optimizer.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_fleet_sharding_meta_optimizer.py similarity index 100% rename from python/paddle/fluid/tests/unittests/test_fleet_sharding_meta_optimizer.py rename to python/paddle/fluid/tests/unittests/collective/fleet/test_fleet_sharding_meta_optimizer.py diff --git a/python/paddle/fluid/tests/unittests/test_fleet_static_mp_layers.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_fleet_static_mp_layers.py similarity index 100% rename from python/paddle/fluid/tests/unittests/test_fleet_static_mp_layers.py rename to python/paddle/fluid/tests/unittests/collective/fleet/test_fleet_static_mp_layers.py diff --git a/python/paddle/fluid/tests/unittests/test_fleet_utils.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_fleet_utils.py similarity index 100% rename from python/paddle/fluid/tests/unittests/test_fleet_utils.py rename to python/paddle/fluid/tests/unittests/collective/fleet/test_fleet_utils.py diff --git a/python/paddle/fluid/tests/unittests/test_hybrid_parallel_inference_helper.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_hybrid_parallel_inference_helper.py similarity index 100% rename from python/paddle/fluid/tests/unittests/test_hybrid_parallel_inference_helper.py rename to python/paddle/fluid/tests/unittests/collective/fleet/test_hybrid_parallel_inference_helper.py diff --git a/python/paddle/fluid/tests/unittests/test_imperative_auto_mixed_precision.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_imperative_auto_mixed_precision.py similarity index 100% rename from python/paddle/fluid/tests/unittests/test_imperative_auto_mixed_precision.py rename to python/paddle/fluid/tests/unittests/collective/fleet/test_imperative_auto_mixed_precision.py diff --git a/python/paddle/fluid/tests/unittests/test_imperative_auto_mixed_precision_for_eager.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_imperative_auto_mixed_precision_for_eager.py similarity index 100% rename from python/paddle/fluid/tests/unittests/test_imperative_auto_mixed_precision_for_eager.py rename to python/paddle/fluid/tests/unittests/collective/fleet/test_imperative_auto_mixed_precision_for_eager.py diff --git a/python/paddle/fluid/tests/unittests/test_ir_pass_pipeline.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_ir_pass_pipeline.py similarity index 100% rename from python/paddle/fluid/tests/unittests/test_ir_pass_pipeline.py rename to python/paddle/fluid/tests/unittests/collective/fleet/test_ir_pass_pipeline.py diff --git a/python/paddle/fluid/tests/unittests/test_mixed_precision.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_mixed_precision.py similarity index 100% rename from python/paddle/fluid/tests/unittests/test_mixed_precision.py rename to python/paddle/fluid/tests/unittests/collective/fleet/test_mixed_precision.py diff --git a/python/paddle/fluid/tests/unittests/test_new_group.sh b/python/paddle/fluid/tests/unittests/collective/fleet/test_new_group.sh similarity index 100% rename from python/paddle/fluid/tests/unittests/test_new_group.sh rename to python/paddle/fluid/tests/unittests/collective/fleet/test_new_group.sh diff --git a/python/paddle/fluid/tests/unittests/test_parallel_class_center_sample.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_parallel_class_center_sample.py similarity index 100% rename from python/paddle/fluid/tests/unittests/test_parallel_class_center_sample.py rename to python/paddle/fluid/tests/unittests/collective/fleet/test_parallel_class_center_sample.py diff --git a/python/paddle/fluid/tests/unittests/test_parallel_dygraph_control_flow.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_parallel_dygraph_control_flow.py similarity index 100% rename from python/paddle/fluid/tests/unittests/test_parallel_dygraph_control_flow.py rename to python/paddle/fluid/tests/unittests/collective/fleet/test_parallel_dygraph_control_flow.py diff --git a/python/paddle/fluid/tests/unittests/test_parallel_dygraph_mnist.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_parallel_dygraph_mnist.py similarity index 75% rename from python/paddle/fluid/tests/unittests/test_parallel_dygraph_mnist.py rename to python/paddle/fluid/tests/unittests/collective/fleet/test_parallel_dygraph_mnist.py index e25a74863e4..78df9976031 100644 --- a/python/paddle/fluid/tests/unittests/test_parallel_dygraph_mnist.py +++ b/python/paddle/fluid/tests/unittests/collective/fleet/test_parallel_dygraph_mnist.py @@ -36,10 +36,11 @@ class TestParallelDygraphMnist(TestDistBase): def test_mnist(self): if fluid.core.is_compiled_with_cuda(): - self.check_with_place("parallel_dygraph_mnist.py", - delta=1e-5, - check_error_log=True, - log_name=flag_name) + self.check_with_place( + os.path.abspath("../../parallel_dygraph_mnist.py"), + delta=1e-5, + check_error_log=True, + log_name=flag_name) #TODO(liuyuhui): Multi-Card Baidu Kunlun XPU training exist accuracy problems @@ -55,10 +56,11 @@ class TestParallelDygraphMnistXPU(TestDistBase): def test_mnist_xpu(self): if fluid.core.is_compiled_with_xpu(): - self.check_with_place("parallel_dygraph_mnist.py", - delta=1e-4, - check_error_log=True, - log_name=flag_name) + self.check_with_place( + os.path.abspath("../../parallel_dygraph_mnist.py"), + delta=1e-4, + check_error_log=True, + log_name=flag_name) class TestParallelDygraphMnistSpawn(TestDistSpawnRunner): @@ -80,10 +82,11 @@ class TestParallelDygraphMnistAccGrad(TestDistBase): def test_mnist(self): if fluid.core.is_compiled_with_cuda(): - self.check_with_place("parallel_dygraph_mnist.py", - delta=1e-5, - check_error_log=True, - log_name=flag_name) + self.check_with_place( + os.path.abspath("../../parallel_dygraph_mnist.py"), + delta=1e-5, + check_error_log=True, + log_name=flag_name) class TestFleetDygraphMnistXPU(TestDistBase): @@ -97,10 +100,11 @@ class TestFleetDygraphMnistXPU(TestDistBase): def test_mnist(self): if fluid.core.is_compiled_with_xpu(): - self.check_with_place("parallel_dygraph_mnist.py", - delta=1e-4, - check_error_log=True, - log_name=flag_name) + self.check_with_place( + os.path.abspath("../../parallel_dygraph_mnist.py"), + delta=1e-4, + check_error_log=True, + log_name=flag_name) if __name__ == "__main__": diff --git a/python/paddle/fluid/tests/unittests/test_parallel_dygraph_mp_layers.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_parallel_dygraph_mp_layers.py similarity index 100% rename from python/paddle/fluid/tests/unittests/test_parallel_dygraph_mp_layers.py rename to python/paddle/fluid/tests/unittests/collective/fleet/test_parallel_dygraph_mp_layers.py diff --git a/python/paddle/fluid/tests/unittests/test_parallel_dygraph_no_sync.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_parallel_dygraph_no_sync.py similarity index 100% rename from python/paddle/fluid/tests/unittests/test_parallel_dygraph_no_sync.py rename to python/paddle/fluid/tests/unittests/collective/fleet/test_parallel_dygraph_no_sync.py diff --git a/python/paddle/fluid/tests/unittests/test_parallel_dygraph_no_sync_gradient_check.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_parallel_dygraph_no_sync_gradient_check.py similarity index 100% rename from python/paddle/fluid/tests/unittests/test_parallel_dygraph_no_sync_gradient_check.py rename to python/paddle/fluid/tests/unittests/collective/fleet/test_parallel_dygraph_no_sync_gradient_check.py diff --git a/python/paddle/fluid/tests/unittests/test_parallel_dygraph_pipeline_parallel.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_parallel_dygraph_pipeline_parallel.py similarity index 92% rename from python/paddle/fluid/tests/unittests/test_parallel_dygraph_pipeline_parallel.py rename to python/paddle/fluid/tests/unittests/collective/fleet/test_parallel_dygraph_pipeline_parallel.py index 5357a6a132a..9bbae0928a7 100644 --- a/python/paddle/fluid/tests/unittests/test_parallel_dygraph_pipeline_parallel.py +++ b/python/paddle/fluid/tests/unittests/collective/fleet/test_parallel_dygraph_pipeline_parallel.py @@ -24,8 +24,11 @@ from test_parallel_dygraph_dataparallel import TestMultipleGpus class TestHybridPipeParallel(TestMultipleGpus): def test_hybrid_parallel_pp_layer(self): - self.run_mnist_2gpu('hybrid_parallel_pp_layer.py') - self.run_mnist_2gpu('hybrid_parallel_pp_layer.py', eager_mode=False) + self.run_mnist_2gpu( + os.path.abspath('../../hybrid_parallel_pp_layer.py')) + self.run_mnist_2gpu( + os.path.abspath('../../hybrid_parallel_pp_layer.py'), + eager_mode=False) def test_hybrid_parallel_pp_tuple_inputs(self): self.run_mnist_2gpu('hybrid_parallel_pp_embedding.py') diff --git a/python/paddle/fluid/tests/unittests/test_parallel_dygraph_qat.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_parallel_dygraph_qat.py similarity index 100% rename from python/paddle/fluid/tests/unittests/test_parallel_dygraph_qat.py rename to python/paddle/fluid/tests/unittests/collective/fleet/test_parallel_dygraph_qat.py diff --git a/python/paddle/fluid/tests/unittests/test_parallel_dygraph_se_resnext.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_parallel_dygraph_se_resnext.py similarity index 100% rename from python/paddle/fluid/tests/unittests/test_parallel_dygraph_se_resnext.py rename to python/paddle/fluid/tests/unittests/collective/fleet/test_parallel_dygraph_se_resnext.py diff --git a/python/paddle/fluid/tests/unittests/test_parallel_dygraph_sharding_parallel.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_parallel_dygraph_sharding_parallel.py similarity index 100% rename from python/paddle/fluid/tests/unittests/test_parallel_dygraph_sharding_parallel.py rename to python/paddle/fluid/tests/unittests/collective/fleet/test_parallel_dygraph_sharding_parallel.py diff --git a/python/paddle/fluid/tests/unittests/test_parallel_dygraph_sparse_embedding.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_parallel_dygraph_sparse_embedding.py similarity index 86% rename from python/paddle/fluid/tests/unittests/test_parallel_dygraph_sparse_embedding.py rename to python/paddle/fluid/tests/unittests/collective/fleet/test_parallel_dygraph_sparse_embedding.py index ae65b545a95..e38a8e57858 100644 --- a/python/paddle/fluid/tests/unittests/test_parallel_dygraph_sparse_embedding.py +++ b/python/paddle/fluid/tests/unittests/collective/fleet/test_parallel_dygraph_sparse_embedding.py @@ -36,10 +36,11 @@ class TestParallelDygraphSparseEmdedding(TestDistBase): def test_sparse_embedding(self): if fluid.core.is_compiled_with_cuda(): - self.check_with_place("parallel_dygraph_sparse_embedding.py", - delta=1e-5, - check_error_log=True, - log_name=flag_name) + self.check_with_place( + os.path.abspath("../../parallel_dygraph_sparse_embedding.py"), + delta=1e-5, + check_error_log=True, + log_name=flag_name) class TestParallelDygraphSparseEmdeddingFP64(TestDistBase): @@ -51,7 +52,8 @@ class TestParallelDygraphSparseEmdeddingFP64(TestDistBase): def test_sparse_embedding_fp64(self): if fluid.core.is_compiled_with_cuda(): - self.check_with_place("parallel_dygraph_sparse_embedding_fp64.py", + self.check_with_place(os.path.abspath( + "../../parallel_dygraph_sparse_embedding_fp64.py"), delta=1e-5, check_error_log=True, log_name=flag_name) diff --git a/python/paddle/fluid/tests/unittests/test_parallel_dygraph_sparse_embedding_over_height.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_parallel_dygraph_sparse_embedding_over_height.py similarity index 84% rename from python/paddle/fluid/tests/unittests/test_parallel_dygraph_sparse_embedding_over_height.py rename to python/paddle/fluid/tests/unittests/collective/fleet/test_parallel_dygraph_sparse_embedding_over_height.py index 7b1cd0efcdf..d7a28d241ff 100644 --- a/python/paddle/fluid/tests/unittests/test_parallel_dygraph_sparse_embedding_over_height.py +++ b/python/paddle/fluid/tests/unittests/collective/fleet/test_parallel_dygraph_sparse_embedding_over_height.py @@ -35,11 +35,11 @@ class TestParallelDygraphSparseEmdeddingOverHeight(TestDistBase): def test_sparse_embedding(self): if fluid.core.is_compiled_with_cuda(): - self.check_with_place( - "parallel_dygraph_sparse_embedding_over_height.py", - delta=1e-5, - check_error_log=True, - log_name=flag_name) + self.check_with_place(os.path.abspath( + "../../parallel_dygraph_sparse_embedding_over_height.py"), + delta=1e-5, + check_error_log=True, + log_name=flag_name) class TestParallelDygraphSparseEmdeddingOverHeightSpawn(TestDistSpawnRunner): diff --git a/python/paddle/fluid/tests/unittests/test_parallel_dygraph_sync_batch_norm.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_parallel_dygraph_sync_batch_norm.py similarity index 100% rename from python/paddle/fluid/tests/unittests/test_parallel_dygraph_sync_batch_norm.py rename to python/paddle/fluid/tests/unittests/collective/fleet/test_parallel_dygraph_sync_batch_norm.py diff --git a/python/paddle/fluid/tests/unittests/test_parallel_dygraph_tensor_parallel.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_parallel_dygraph_tensor_parallel.py similarity index 100% rename from python/paddle/fluid/tests/unittests/test_parallel_dygraph_tensor_parallel.py rename to python/paddle/fluid/tests/unittests/collective/fleet/test_parallel_dygraph_tensor_parallel.py diff --git a/python/paddle/fluid/tests/unittests/test_parallel_dygraph_transformer.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_parallel_dygraph_transformer.py similarity index 100% rename from python/paddle/fluid/tests/unittests/test_parallel_dygraph_transformer.py rename to python/paddle/fluid/tests/unittests/collective/fleet/test_parallel_dygraph_transformer.py diff --git a/python/paddle/fluid/tests/unittests/test_parallel_dygraph_unused_variables.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_parallel_dygraph_unused_variables.py similarity index 76% rename from python/paddle/fluid/tests/unittests/test_parallel_dygraph_unused_variables.py rename to python/paddle/fluid/tests/unittests/collective/fleet/test_parallel_dygraph_unused_variables.py index 1f71514cc73..172cab2acfd 100644 --- a/python/paddle/fluid/tests/unittests/test_parallel_dygraph_unused_variables.py +++ b/python/paddle/fluid/tests/unittests/collective/fleet/test_parallel_dygraph_unused_variables.py @@ -35,10 +35,11 @@ class TestParallelDygraphUnusedVar(TestDistBase): def test_net(self): if fluid.core.is_compiled_with_cuda(): - self.check_with_place("parallel_dygraph_unused_variables.py", - delta=1e-5, - check_error_log=True, - log_name=flag_name) + self.check_with_place( + os.path.abspath("../../parallel_dygraph_unused_variables.py"), + delta=1e-5, + check_error_log=True, + log_name=flag_name) class TestFleetDygraphUnusedVar(TestParallelDygraphUnusedVar): @@ -67,10 +68,11 @@ class TestParallelDygraphNoVar(TestDistBase): def test_net(self): if fluid.core.is_compiled_with_cuda(): - self.check_with_place("parallel_dygraph_none_var.py", - delta=1e-5, - check_error_log=True, - log_name=flag_name) + self.check_with_place( + os.path.abspath("../../parallel_dygraph_none_var.py"), + delta=1e-5, + check_error_log=True, + log_name=flag_name) class TestParallelDygraphSharedUnusedVariables(TestDistBase): @@ -82,10 +84,11 @@ class TestParallelDygraphSharedUnusedVariables(TestDistBase): def test_mnist(self): if fluid.core.is_compiled_with_cuda(): - self.check_with_place("parallel_dygraph_shared_unused_var.py", - delta=1e-5, - check_error_log=True, - log_name=flag_name) + self.check_with_place( + os.path.abspath("../../parallel_dygraph_shared_unused_var.py"), + delta=1e-5, + check_error_log=True, + log_name=flag_name) if __name__ == "__main__": diff --git a/python/paddle/fluid/tests/unittests/test_parallel_margin_cross_entropy.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_parallel_margin_cross_entropy.py similarity index 100% rename from python/paddle/fluid/tests/unittests/test_parallel_margin_cross_entropy.py rename to python/paddle/fluid/tests/unittests/collective/fleet/test_parallel_margin_cross_entropy.py diff --git a/python/paddle/fluid/tests/unittests/test_pipeline.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_pipeline.py similarity index 100% rename from python/paddle/fluid/tests/unittests/test_pipeline.py rename to python/paddle/fluid/tests/unittests/collective/fleet/test_pipeline.py diff --git a/python/paddle/fluid/tests/unittests/test_recv_save_op.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_recv_save_op.py similarity index 100% rename from python/paddle/fluid/tests/unittests/test_recv_save_op.py rename to python/paddle/fluid/tests/unittests/collective/fleet/test_recv_save_op.py diff --git a/python/paddle/fluid/tests/unittests/test_rnn_dp.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_rnn_dp.py similarity index 100% rename from python/paddle/fluid/tests/unittests/test_rnn_dp.py rename to python/paddle/fluid/tests/unittests/collective/fleet/test_rnn_dp.py diff --git a/python/paddle/fluid/tests/unittests/test_static_model_parallel.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_static_model_parallel.py similarity index 100% rename from python/paddle/fluid/tests/unittests/test_static_model_parallel.py rename to python/paddle/fluid/tests/unittests/collective/fleet/test_static_model_parallel.py diff --git a/python/paddle/fluid/tests/unittests/test_tcp_store.py b/python/paddle/fluid/tests/unittests/collective/fleet/test_tcp_store.py similarity index 100% rename from python/paddle/fluid/tests/unittests/test_tcp_store.py rename to python/paddle/fluid/tests/unittests/collective/fleet/test_tcp_store.py diff --git a/python/paddle/fluid/tests/unittests/collective/fleet/testslist.csv b/python/paddle/fluid/tests/unittests/collective/fleet/testslist.csv new file mode 100644 index 00000000000..71ba94a02b6 --- /dev/null +++ b/python/paddle/fluid/tests/unittests/collective/fleet/testslist.csv @@ -0,0 +1,73 @@ +name,os,arch,timeout,run_type,launcher,num_port,run_serial,envs,conditions +test_fleet_sharding_meta_optimizer,,GPU;XPU;ASCEND;ASCEND_CL,350,DIST,test_runner.py,2,1,http_proxy=;https_proxy=;PYTHONPATH=../.., +test_fleet_static_mp_layers,linux;win32,,,DIST,test_runner.py,2,1,http_proxy=;https_proxy=;PYTHONPATH=../.., +test_dgc_op,,,,DIST,test_runner.py,2,1,http_proxy=;https_proxy=;PYTHONPATH=../..,WITH_DGC +test_dgc_optimizer,,,,DIST,test_runner.py,2,1,http_proxy=;https_proxy=;PYTHONPATH=../..,WITH_DGC +test_parallel_margin_cross_entropy,,GPU,120,DIST,../../dist_test.sh,2,1,http_proxy=;https_proxy=;PYTHONPATH=../..,WITH_NCCL +test_dygraph_sharding_stage3,,GPU,350,DIST,../../dist_test.sh,2,1,http_proxy=;https_proxy=;PYTHONPATH=../..,WITH_NCCL +test_parallel_dygraph_transformer,,GPU,,DIST,../../dist_test.sh,2,1,http_proxy=;https_proxy=;PYTHONPATH=../..,WITH_NCCL;${NCCL_VERSION} VERSION_GREATER_EQUAL 2212 +test_parallel_dygraph_transformer,,ROCM,,DIST,../../dist_test.sh,2,1,http_proxy=;https_proxy=;PYTHONPATH=../.., +test_fleet_fp16_allreduce_meta_optimizer,LINUX;WIN32,,,DIST,test_runner.py,2,1,http_proxy=;https_proxy=;PYTHONPATH=../.., +test_rnn_dp,,GPU;XPU;ASCEND;ASCEND_CL,,DIST,../../dist_test.sh,2,1,http_proxy=;https_proxy=;PYTHONPATH=../.., +test_parallel_dygraph_mp_layers,,GPU,120,DIST,../../dist_test.sh,2,1,http_proxy=;https_proxy=;PYTHONPATH=../..,WITH_NCCL +test_tcp_store,LINUX;APPLE,,,DIST,../../dist_test.sh,2,1,http_proxy=;https_proxy=;PYTHONPATH=../.., +test_dygraph_sharding_stage3_for_eager,,,350,DIST,../../dist_test.sh,2,1,http_proxy=;https_proxy=;PYTHONPATH=../.., +test_fleet_graph_execution_meta_optimizer,,GPU;XPU;ASCEND;ASCEND_CL,,DIST,../../dist_test.sh,2,1,http_proxy=;https_proxy=;PYTHONPATH=../.., +test_communicator_half_async,,,120,DIST,test_runner.py,2,1,FLAGS_communicator_send_queue_size=1;FLAGS_communicator_max_merge_var_num=1;http_proxy=;https_proxy=;PYTHONPATH=../..,WITH_NCCL +test_fleet_graph_executor,,GPU;XPU;ASCEND;ASCEND_CL,,DIST,test_runner.py,2,1,http_proxy=;https_proxy=;PYTHONPATH=../.., +test_parallel_dygraph_pipeline_parallel,,GPU,500,DIST,../../dist_test.sh,2,1,http_proxy=;https_proxy=;PYTHONPATH=../.., +test_fleet_localsgd_meta_optimizer,LINUX,GPU;XPU;ASCEND;ASCEND_CL,,DIST,test_runner.py,2,1,http_proxy=;https_proxy=;PYTHONPATH=../.., +test_parallel_class_center_sample,,GPU,120,DIST,../../dist_test.sh,2,1,http_proxy=;https_proxy=;PYTHONPATH=../..,WITH_NCCL +test_pipeline,,,120,DIST,../../dist_test.sh,2,1,http_proxy=;https_proxy=;PYTHONPATH=../.., +test_fleet_utils,LINUX;APPLE,,120,DIST,test_runner.py,2,1,http_proxy=;https_proxy=;PYTHONPATH=../.., +test_static_model_parallel,,,240,DIST,../../dist_test.sh,2,1,http_proxy=;https_proxy=;PYTHONPATH=../.., +test_parallel_dygraph_no_sync,,GPU,300,DIST,../../dist_test.sh,2,1,http_proxy=;https_proxy=;PYTHONPATH=../..,WITH_NCCL +test_dygraph_sharding_stage2,,,200,DIST,../../dist_test.sh,2,1,http_proxy=;https_proxy=;PYTHONPATH=../.., +test_parallel_dygraph_control_flow,,,350,DIST,../../dist_test.sh,2,1,http_proxy=;https_proxy=;PYTHONPATH=../.., +test_fleet_lars_meta_optimizer,,GPU;XPU;ASCEND;ASCEND_CL,,DIST,../../dist_test.sh,2,1,http_proxy=;https_proxy=;PYTHONPATH=../.., +test_hybrid_parallel_inference_helper,,,120,DIST,../../dist_test.sh,2,1,http_proxy=;https_proxy=;PYTHONPATH=../.., +test_fleet_rolemaker_new,,,,DIST,test_runner.py,2,1,http_proxy=;https_proxy=;PYTHONPATH=../.., +test_dist_mnist_gradient_merge,LINUX;WIN32,GPU;ROCM,360,DIST,test_runner.py,2,1,http_proxy=;https_proxy=;PYTHONPATH=../.., +test_recv_save_op,,,,DIST,test_runner.py,2,1,http_proxy=;https_proxy=;PYTHONPATH=../.., +test_communicator_sync,,,,DIST,test_runner.py,2,1,FLAGS_communicator_send_queue_size=1;FLAGS_communicator_max_merge_var_num=1;http_proxy=;https_proxy=;PYTHONPATH=../.., +test_fleet_pipeline_meta_optimizer,,GPU;XPU;ASCEND;ASCEND_CL,,DIST,../../dist_test.sh,2,1,http_proxy=;https_proxy=;PYTHONPATH=../.., +test_fleet_gradient_merge_meta_optimizer,,GPU;XPU;ASCEND;ASCEND_CL,,DIST,test_runner.py,2,1,http_proxy=;https_proxy=;PYTHONPATH=../.., +test_fleet_amp_init,linux;win32,,,DIST,test_runner.py,2,1,http_proxy=;https_proxy=;PYTHONPATH=../.., +test_dygraph_sharding_optimizer_stage2,,,120,DIST,../../dist_test.sh,2,1,http_proxy=;https_proxy=;PYTHONPATH=../.., +test_fleet_meta_optimizer_base,linux;win32,,,DIST,test_runner.py,2,1,http_proxy=;https_proxy=;PYTHONPATH=../.., +test_fleet_raw_program_meta_optimizer,,GPU;XPU;ASCEND;ASCEND_CL,,DIST,../../dist_test.sh,2,1,http_proxy=;https_proxy=;PYTHONPATH=../.., +test_parallel_dygraph_sharding_parallel,,,120,DIST,../../dist_test.sh,2,1,http_proxy=;https_proxy=;PYTHONPATH=../.., +test_parallel_dygraph_tensor_parallel,,,200,DIST,../../dist_test.sh,2,1,http_proxy=;https_proxy=;PYTHONPATH=../.., +test_dygraph_group_sharded_api_for_eager,,,120,DIST,../../dist_test.sh,2,1,http_proxy=;https_proxy=;PYTHONPATH=../.., +test_fleet_distributed_strategy,linux;win32,,,DIST,test_runner.py,2,1,http_proxy=;https_proxy=;PYTHONPATH=../.., +test_fleet_dgc_meta_optimizer,,,,DIST,test_runner.py,2,1,http_proxy=;https_proxy=;PYTHONPATH=../..,WITH_DGC +test_parallel_dygraph_unused_variables,,,350,DIST,../../dist_test.sh,2,1,http_proxy=;https_proxy=;PYTHONPATH=../.., +test_fleet_lamb_meta_optimizer,linux,GPU;XPU;ASCEND;ASCEND_CL,,DIST,test_runner.py,2,1,http_proxy=;https_proxy=;PYTHONPATH=../.., +test_dgc_momentum_op,,,,DIST,test_runner.py,2,1,http_proxy=;https_proxy=;PYTHONPATH=../..,WITH_DGC +test_parallel_dygraph_no_sync_gradient_check,,,60,DIST,../../dist_test.sh,2,1,http_proxy=;https_proxy=;PYTHONPATH=../.., +test_fleet_pipeline_meta_optimizer_with_recompute,,GPU;XPU;ASCEND;ASCEND_CL,,DIST,../../dist_test.sh,2,1,http_proxy=;https_proxy=;PYTHONPATH=../.., +test_fleet_hybrid_meta_optimizer,WIN32;LINUX,GPU;XPU;ASCEND;ASCEND_CL,,DIST,test_runner.py,2,1,http_proxy=;https_proxy=;PYTHONPATH=../.., +test_parallel_dygraph_qat,,,120,DIST,../../dist_test.sh,2,1,http_proxy=;https_proxy=;PYTHONPATH=../.., +test_parallel_dygraph_sparse_embedding,,GPU,200,DIST,../../dist_test.sh,2,1,http_proxy=;https_proxy=;PYTHONPATH=../..,WITH_NCCL;${NCCL_VERSION} VERSION_GREATER_EQUAL 2212 +test_parallel_dygraph_sparse_embedding,,ROCM,200,DIST,../../dist_test.sh,2,1,http_proxy=;https_proxy=;PYTHONPATH=../.., +test_fleet_amp_meta_optimizer,,GPU;XPU;ASCEND;ASCEND_CL,,DIST,test_runner.py,2,1,http_proxy=;https_proxy=;PYTHONPATH=../.., +test_parallel_dygraph_sparse_embedding_over_height,,GPU,150,DIST,../../dist_test.sh,2,1,http_proxy=;https_proxy=;PYTHONPATH=../..,WITH_NCCL;${NCCL_VERSION} VERSION_GREATER_EQUAL 2212 +test_parallel_dygraph_sparse_embedding_over_height,,ROCM,350,DIST,../../dist_test.sh,2,1,http_proxy=;https_proxy=;PYTHONPATH=../.., +test_distributed_strategy,LINUX;APPLE,,,DIST,test_runner.py,2,1,http_proxy=;https_proxy=;PYTHONPATH=../.., +test_auto_parallel_parallelizer,,,120,DIST,../../dist_test.sh,2,1,http_proxy=;https_proxy=;PYTHONPATH=../.., +test_fleet_recompute_meta_optimizer,linux;win32,GPU;XPU;ASCEND;ASCEND_CL,,DIST,test_runner.py,2,1,http_proxy=;https_proxy=;PYTHONPATH=../.., +test_dygraph_group_sharded_api,,,120,DIST,../../dist_test.sh,2,1,http_proxy=;https_proxy=;PYTHONPATH=../.., +test_fleet_private_function,linux;win32,,,DIST,test_runner.py,2,1,http_proxy=;https_proxy=;PYTHONPATH=../.., +test_new_group,,GPU;XPU;ASCEND;ASCEND_CL,,DIST,test_new_group.sh,2,1,http_proxy=;https_proxy=, +test_c_comm_init_op,linux,GPU;XPU;ASCEND;ASCEND_CL,120,DIST,test_c_comm_init_op.sh,2,1,http_proxy=;https_proxy=, +test_ir_pass_pipeline,,,120,DIST,../../dist_test.sh,2,1,http_proxy=;https_proxy=;PYTHONPATH=../.., +test_parallel_dygraph_mnist,,GPU;ROCM,200,DIST,../../dist_test.sh,2,1,http_proxy=;https_proxy=;PYTHONPATH=../.., +test_parallel_dygraph_se_resnext,,GPU;ROCM,200,DIST,../../dist_test.sh,2,1,http_proxy=;https_proxy=;PYTHONPATH=../.., +test_parallel_dygraph_sync_batch_norm,,GPU;ROCM,120,DIST,test_runner.py,2,1,http_proxy=;https_proxy=;PYTHONPATH=../.., +test_imperative_auto_mixed_precision,,GPU;ROCM,300,DIST,test_runner.py,2,1,http_proxy=;https_proxy=;PYTHONPATH=../.., +test_imperative_auto_mixed_precision_for_eager,,GPU;ROCM,300,DIST,test_runner.py,2,1,http_proxy=;https_proxy=;PYTHONPATH=../.., +test_mixed_precision,,GPU;ROCM,,DIST,test_runner.py,2,1,http_proxy=;https_proxy=;PYTHONPATH=../.., +test_dygraph_recompute,,GPU;ROCM,,DIST,test_runner.py,2,1,http_proxy=;https_proxy=;PYTHONPATH=../.., +test_dygraph_recompute_for_eager,,GPU;ROCM,,DIST,test_runner.py,2,1,http_proxy=;https_proxy=;PYTHONPATH=../.., +test_dist_mnist_dgc_nccl,,,,DIST,../../dist_test.sh,2,1,http_proxy=;https_proxy=;PYTHONPATH=../..,WITH_NCCL OR WITH_RCCL;WITH_DGC +test_dist_se_resnext_dgc,,,,DIST,../../dist_test.sh,2,1,http_proxy=;https_proxy=;PYTHONPATH=../..,WITH_NCCL OR WITH_RCCL;WITH_DGC diff --git a/python/paddle/fluid/tests/unittests/init_process_group.py b/python/paddle/fluid/tests/unittests/collective/init_process_group.py similarity index 100% rename from python/paddle/fluid/tests/unittests/init_process_group.py rename to python/paddle/fluid/tests/unittests/collective/init_process_group.py diff --git a/python/paddle/fluid/tests/unittests/collective/multinode/CMakeLists.txt b/python/paddle/fluid/tests/unittests/collective/multinode/CMakeLists.txt new file mode 100644 index 00000000000..6947c89a2a2 --- /dev/null +++ b/python/paddle/fluid/tests/unittests/collective/multinode/CMakeLists.txt @@ -0,0 +1,48 @@ +# This file is generated by ${PADDLE_ROOT}/tools/gen_ut_cmakelists.py. +# Please don't modify this file manually. +# If you need to change unittests in this file, please modify testslist.csv in the current directory +# and then run the command `python3 ${PADDLE_ROOT}/tools/gen_ut_cmakelists.py -f ${CURRENT_DIRECTORY}/testslist.csv` +set(LOCAL_ALL_ARCH ON) +set(LOCAL_ALL_PLAT ON) +if(WITH_MULTINODE_TESTING) + if((WITH_GPU) AND (LINUX)) + bash_test_modules( + test_multinode_dygraph_hybrid_dpppmp + START_BASH + multinode_dist_test.sh + LABELS + "RUN_TYPE=DIST" + ENVS + "PADDLE_DIST_UT_PORT=21282;http_proxy=;https_proxy=") + set_tests_properties(test_multinode_dygraph_hybrid_dpppmp + PROPERTIES TIMEOUT "120" RUN_SERIAL 1) + endif() +endif() +if(WITH_MULTINODE_TESTING) + if((WITH_GPU) AND (LINUX)) + bash_test_modules( + test_multinode_dygraph_hybrid_dp + START_BASH + multinode_dist_test.sh + LABELS + "RUN_TYPE=DIST" + ENVS + "PADDLE_DIST_UT_PORT=21284;http_proxy=;https_proxy=") + set_tests_properties(test_multinode_dygraph_hybrid_dp + PROPERTIES TIMEOUT "120" RUN_SERIAL 1) + endif() +endif() +if(WITH_MULTINODE_TESTING) + if((WITH_GPU) AND (LINUX)) + bash_test_modules( + test_multinode_dygraph_sharding + START_BASH + multinode_dist_test.sh + LABELS + "RUN_TYPE=DIST" + ENVS + "PADDLE_DIST_UT_PORT=21286;http_proxy=;https_proxy=") + set_tests_properties(test_multinode_dygraph_sharding + PROPERTIES TIMEOUT "120" RUN_SERIAL 1) + endif() +endif() diff --git a/python/paddle/fluid/tests/unittests/common.py b/python/paddle/fluid/tests/unittests/collective/multinode/common.py similarity index 100% rename from python/paddle/fluid/tests/unittests/common.py rename to python/paddle/fluid/tests/unittests/collective/multinode/common.py diff --git a/python/paddle/fluid/tests/unittests/dygraph_hybrid_dp.py b/python/paddle/fluid/tests/unittests/collective/multinode/dygraph_hybrid_dp.py similarity index 100% rename from python/paddle/fluid/tests/unittests/dygraph_hybrid_dp.py rename to python/paddle/fluid/tests/unittests/collective/multinode/dygraph_hybrid_dp.py diff --git a/python/paddle/fluid/tests/unittests/dygraph_hybrid_dpppmp.py b/python/paddle/fluid/tests/unittests/collective/multinode/dygraph_hybrid_dpppmp.py similarity index 100% rename from python/paddle/fluid/tests/unittests/dygraph_hybrid_dpppmp.py rename to python/paddle/fluid/tests/unittests/collective/multinode/dygraph_hybrid_dpppmp.py diff --git a/python/paddle/fluid/tests/unittests/dygraph_hybrid_fp16.py b/python/paddle/fluid/tests/unittests/collective/multinode/dygraph_hybrid_fp16.py similarity index 100% rename from python/paddle/fluid/tests/unittests/dygraph_hybrid_fp16.py rename to python/paddle/fluid/tests/unittests/collective/multinode/dygraph_hybrid_fp16.py diff --git a/python/paddle/fluid/tests/unittests/dygraph_hybrid_recompute.py b/python/paddle/fluid/tests/unittests/collective/multinode/dygraph_hybrid_recompute.py similarity index 100% rename from python/paddle/fluid/tests/unittests/dygraph_hybrid_recompute.py rename to python/paddle/fluid/tests/unittests/collective/multinode/dygraph_hybrid_recompute.py diff --git a/python/paddle/fluid/tests/unittests/mn_dygraph_group_sharded_stage3.py b/python/paddle/fluid/tests/unittests/collective/multinode/mn_dygraph_group_sharded_stage3.py similarity index 100% rename from python/paddle/fluid/tests/unittests/mn_dygraph_group_sharded_stage3.py rename to python/paddle/fluid/tests/unittests/collective/multinode/mn_dygraph_group_sharded_stage3.py diff --git a/python/paddle/fluid/tests/unittests/mn_dygraph_sharding_stage2.py b/python/paddle/fluid/tests/unittests/collective/multinode/mn_dygraph_sharding_stage2.py similarity index 100% rename from python/paddle/fluid/tests/unittests/mn_dygraph_sharding_stage2.py rename to python/paddle/fluid/tests/unittests/collective/multinode/mn_dygraph_sharding_stage2.py diff --git a/python/paddle/fluid/tests/unittests/multinode_dist_test.sh b/python/paddle/fluid/tests/unittests/collective/multinode/multinode_dist_test.sh similarity index 100% rename from python/paddle/fluid/tests/unittests/multinode_dist_test.sh rename to python/paddle/fluid/tests/unittests/collective/multinode/multinode_dist_test.sh diff --git a/python/paddle/fluid/tests/unittests/test_collective_multi_nodes.py b/python/paddle/fluid/tests/unittests/collective/multinode/test_collective_multi_nodes.py similarity index 100% rename from python/paddle/fluid/tests/unittests/test_collective_multi_nodes.py rename to python/paddle/fluid/tests/unittests/collective/multinode/test_collective_multi_nodes.py diff --git a/python/paddle/fluid/tests/unittests/test_multinode_dygraph_hybrid_dp.py b/python/paddle/fluid/tests/unittests/collective/multinode/test_multinode_dygraph_hybrid_dp.py similarity index 100% rename from python/paddle/fluid/tests/unittests/test_multinode_dygraph_hybrid_dp.py rename to python/paddle/fluid/tests/unittests/collective/multinode/test_multinode_dygraph_hybrid_dp.py diff --git a/python/paddle/fluid/tests/unittests/test_multinode_dygraph_hybrid_dpppmp.py b/python/paddle/fluid/tests/unittests/collective/multinode/test_multinode_dygraph_hybrid_dpppmp.py similarity index 100% rename from python/paddle/fluid/tests/unittests/test_multinode_dygraph_hybrid_dpppmp.py rename to python/paddle/fluid/tests/unittests/collective/multinode/test_multinode_dygraph_hybrid_dpppmp.py diff --git a/python/paddle/fluid/tests/unittests/test_multinode_dygraph_sharding.py b/python/paddle/fluid/tests/unittests/collective/multinode/test_multinode_dygraph_sharding.py similarity index 100% rename from python/paddle/fluid/tests/unittests/test_multinode_dygraph_sharding.py rename to python/paddle/fluid/tests/unittests/collective/multinode/test_multinode_dygraph_sharding.py diff --git a/python/paddle/fluid/tests/unittests/collective/multinode/testslist.csv b/python/paddle/fluid/tests/unittests/collective/multinode/testslist.csv new file mode 100644 index 00000000000..8ada8ed0be3 --- /dev/null +++ b/python/paddle/fluid/tests/unittests/collective/multinode/testslist.csv @@ -0,0 +1,4 @@ +name,os,arch,timeout,run_type,launcher,num_port,run_serial,ENVS,conditions +test_multinode_dygraph_hybrid_dpppmp,linux,gpu,120,DIST,multinode_dist_test.sh,8,1,http_proxy=;https_proxy=,WITH_MULTINODE_TESTING +test_multinode_dygraph_hybrid_dp,linux,gpu,120,DIST,multinode_dist_test.sh,8,1,http_proxy=;https_proxy=,WITH_MULTINODE_TESTING +test_multinode_dygraph_sharding,linux,gpu,120,DIST,multinode_dist_test.sh,8,1,http_proxy=;https_proxy=,WITH_MULTINODE_TESTING diff --git a/python/paddle/fluid/tests/unittests/process_group_gloo.py b/python/paddle/fluid/tests/unittests/collective/process_group_gloo.py similarity index 100% rename from python/paddle/fluid/tests/unittests/process_group_gloo.py rename to python/paddle/fluid/tests/unittests/collective/process_group_gloo.py diff --git a/python/paddle/fluid/tests/unittests/process_group_nccl.py b/python/paddle/fluid/tests/unittests/collective/process_group_nccl.py similarity index 100% rename from python/paddle/fluid/tests/unittests/process_group_nccl.py rename to python/paddle/fluid/tests/unittests/collective/process_group_nccl.py diff --git a/python/paddle/fluid/tests/unittests/row_parallel_linear_api.py b/python/paddle/fluid/tests/unittests/collective/row_parallel_linear_api.py similarity index 100% rename from python/paddle/fluid/tests/unittests/row_parallel_linear_api.py rename to python/paddle/fluid/tests/unittests/collective/row_parallel_linear_api.py diff --git a/python/paddle/fluid/tests/unittests/test_collective_allgather_api.py b/python/paddle/fluid/tests/unittests/collective/test_collective_allgather_api.py similarity index 100% rename from python/paddle/fluid/tests/unittests/test_collective_allgather_api.py rename to python/paddle/fluid/tests/unittests/collective/test_collective_allgather_api.py diff --git a/python/paddle/fluid/tests/unittests/test_collective_allgather_object_api.py b/python/paddle/fluid/tests/unittests/collective/test_collective_allgather_object_api.py similarity index 100% rename from python/paddle/fluid/tests/unittests/test_collective_allgather_object_api.py rename to python/paddle/fluid/tests/unittests/collective/test_collective_allgather_object_api.py diff --git a/python/paddle/fluid/tests/unittests/test_collective_allreduce_api.py b/python/paddle/fluid/tests/unittests/collective/test_collective_allreduce_api.py similarity index 100% rename from python/paddle/fluid/tests/unittests/test_collective_allreduce_api.py rename to python/paddle/fluid/tests/unittests/collective/test_collective_allreduce_api.py diff --git a/python/paddle/fluid/tests/unittests/test_collective_alltoall_api.py b/python/paddle/fluid/tests/unittests/collective/test_collective_alltoall_api.py similarity index 100% rename from python/paddle/fluid/tests/unittests/test_collective_alltoall_api.py rename to python/paddle/fluid/tests/unittests/collective/test_collective_alltoall_api.py diff --git a/python/paddle/fluid/tests/unittests/test_collective_alltoall_single.py b/python/paddle/fluid/tests/unittests/collective/test_collective_alltoall_single.py similarity index 100% rename from python/paddle/fluid/tests/unittests/test_collective_alltoall_single.py rename to python/paddle/fluid/tests/unittests/collective/test_collective_alltoall_single.py diff --git a/python/paddle/fluid/tests/unittests/test_collective_barrier_api.py b/python/paddle/fluid/tests/unittests/collective/test_collective_barrier_api.py similarity index 100% rename from python/paddle/fluid/tests/unittests/test_collective_barrier_api.py rename to python/paddle/fluid/tests/unittests/collective/test_collective_barrier_api.py diff --git a/python/paddle/fluid/tests/unittests/test_collective_batch_isend_irecv.py b/python/paddle/fluid/tests/unittests/collective/test_collective_batch_isend_irecv.py similarity index 100% rename from python/paddle/fluid/tests/unittests/test_collective_batch_isend_irecv.py rename to python/paddle/fluid/tests/unittests/collective/test_collective_batch_isend_irecv.py diff --git a/python/paddle/fluid/tests/unittests/test_collective_broadcast_api.py b/python/paddle/fluid/tests/unittests/collective/test_collective_broadcast_api.py similarity index 100% rename from python/paddle/fluid/tests/unittests/test_collective_broadcast_api.py rename to python/paddle/fluid/tests/unittests/collective/test_collective_broadcast_api.py diff --git a/python/paddle/fluid/tests/unittests/test_collective_cpu_barrier_with_gloo.py b/python/paddle/fluid/tests/unittests/collective/test_collective_cpu_barrier_with_gloo.py similarity index 100% rename from python/paddle/fluid/tests/unittests/test_collective_cpu_barrier_with_gloo.py rename to python/paddle/fluid/tests/unittests/collective/test_collective_cpu_barrier_with_gloo.py diff --git a/python/paddle/fluid/tests/unittests/test_collective_global_gather.py b/python/paddle/fluid/tests/unittests/collective/test_collective_global_gather.py similarity index 100% rename from python/paddle/fluid/tests/unittests/test_collective_global_gather.py rename to python/paddle/fluid/tests/unittests/collective/test_collective_global_gather.py diff --git a/python/paddle/fluid/tests/unittests/test_collective_global_scatter.py b/python/paddle/fluid/tests/unittests/collective/test_collective_global_scatter.py similarity index 100% rename from python/paddle/fluid/tests/unittests/test_collective_global_scatter.py rename to python/paddle/fluid/tests/unittests/collective/test_collective_global_scatter.py diff --git a/python/paddle/fluid/tests/unittests/test_collective_optimizer.py b/python/paddle/fluid/tests/unittests/collective/test_collective_optimizer.py similarity index 100% rename from python/paddle/fluid/tests/unittests/test_collective_optimizer.py rename to python/paddle/fluid/tests/unittests/collective/test_collective_optimizer.py diff --git a/python/paddle/fluid/tests/unittests/test_collective_process_group.py b/python/paddle/fluid/tests/unittests/collective/test_collective_process_group.py similarity index 100% rename from python/paddle/fluid/tests/unittests/test_collective_process_group.py rename to python/paddle/fluid/tests/unittests/collective/test_collective_process_group.py diff --git a/python/paddle/fluid/tests/unittests/test_collective_reduce.py b/python/paddle/fluid/tests/unittests/collective/test_collective_reduce.py similarity index 100% rename from python/paddle/fluid/tests/unittests/test_collective_reduce.py rename to python/paddle/fluid/tests/unittests/collective/test_collective_reduce.py diff --git a/python/paddle/fluid/tests/unittests/test_collective_reduce_api.py b/python/paddle/fluid/tests/unittests/collective/test_collective_reduce_api.py similarity index 100% rename from python/paddle/fluid/tests/unittests/test_collective_reduce_api.py rename to python/paddle/fluid/tests/unittests/collective/test_collective_reduce_api.py diff --git a/python/paddle/fluid/tests/unittests/test_collective_reduce_scatter.py b/python/paddle/fluid/tests/unittests/collective/test_collective_reduce_scatter.py similarity index 100% rename from python/paddle/fluid/tests/unittests/test_collective_reduce_scatter.py rename to python/paddle/fluid/tests/unittests/collective/test_collective_reduce_scatter.py diff --git a/python/paddle/fluid/tests/unittests/test_collective_scatter.py b/python/paddle/fluid/tests/unittests/collective/test_collective_scatter.py similarity index 100% rename from python/paddle/fluid/tests/unittests/test_collective_scatter.py rename to python/paddle/fluid/tests/unittests/collective/test_collective_scatter.py diff --git a/python/paddle/fluid/tests/unittests/test_collective_scatter_api.py b/python/paddle/fluid/tests/unittests/collective/test_collective_scatter_api.py similarity index 100% rename from python/paddle/fluid/tests/unittests/test_collective_scatter_api.py rename to python/paddle/fluid/tests/unittests/collective/test_collective_scatter_api.py diff --git a/python/paddle/fluid/tests/unittests/test_collective_sendrecv.py b/python/paddle/fluid/tests/unittests/collective/test_collective_sendrecv.py similarity index 100% rename from python/paddle/fluid/tests/unittests/test_collective_sendrecv.py rename to python/paddle/fluid/tests/unittests/collective/test_collective_sendrecv.py diff --git a/python/paddle/fluid/tests/unittests/test_collective_sendrecv_api.py b/python/paddle/fluid/tests/unittests/collective/test_collective_sendrecv_api.py similarity index 100% rename from python/paddle/fluid/tests/unittests/test_collective_sendrecv_api.py rename to python/paddle/fluid/tests/unittests/collective/test_collective_sendrecv_api.py diff --git a/python/paddle/fluid/tests/unittests/test_collective_split_col_linear.py b/python/paddle/fluid/tests/unittests/collective/test_collective_split_col_linear.py similarity index 100% rename from python/paddle/fluid/tests/unittests/test_collective_split_col_linear.py rename to python/paddle/fluid/tests/unittests/collective/test_collective_split_col_linear.py diff --git a/python/paddle/fluid/tests/unittests/test_collective_split_embedding_none_divisible.py b/python/paddle/fluid/tests/unittests/collective/test_collective_split_embedding_none_divisible.py similarity index 100% rename from python/paddle/fluid/tests/unittests/test_collective_split_embedding_none_divisible.py rename to python/paddle/fluid/tests/unittests/collective/test_collective_split_embedding_none_divisible.py diff --git a/python/paddle/fluid/tests/unittests/test_collective_split_row_linear.py b/python/paddle/fluid/tests/unittests/collective/test_collective_split_row_linear.py similarity index 100% rename from python/paddle/fluid/tests/unittests/test_collective_split_row_linear.py rename to python/paddle/fluid/tests/unittests/collective/test_collective_split_row_linear.py diff --git a/python/paddle/fluid/tests/unittests/test_collective_wait.py b/python/paddle/fluid/tests/unittests/collective/test_collective_wait.py similarity index 100% rename from python/paddle/fluid/tests/unittests/test_collective_wait.py rename to python/paddle/fluid/tests/unittests/collective/test_collective_wait.py diff --git a/python/paddle/fluid/tests/unittests/test_eager_dist_api.py b/python/paddle/fluid/tests/unittests/collective/test_eager_dist_api.py similarity index 100% rename from python/paddle/fluid/tests/unittests/test_eager_dist_api.py rename to python/paddle/fluid/tests/unittests/collective/test_eager_dist_api.py diff --git a/python/paddle/fluid/tests/unittests/test_gen_nccl_id_op.py b/python/paddle/fluid/tests/unittests/collective/test_gen_nccl_id_op.py similarity index 100% rename from python/paddle/fluid/tests/unittests/test_gen_nccl_id_op.py rename to python/paddle/fluid/tests/unittests/collective/test_gen_nccl_id_op.py diff --git a/python/paddle/fluid/tests/unittests/test_new_group_api.py b/python/paddle/fluid/tests/unittests/collective/test_new_group_api.py similarity index 100% rename from python/paddle/fluid/tests/unittests/test_new_group_api.py rename to python/paddle/fluid/tests/unittests/collective/test_new_group_api.py diff --git a/python/paddle/fluid/tests/unittests/collective/testslist.csv b/python/paddle/fluid/tests/unittests/collective/testslist.csv index 01ff66c8386..1243fc0f63f 100644 --- a/python/paddle/fluid/tests/unittests/collective/testslist.csv +++ b/python/paddle/fluid/tests/unittests/collective/testslist.csv @@ -1,7 +1,34 @@ -name,os,arch,timeout,run_type,launcher,dist_ut_port,run_serial,ENVS,conditions -test_allreduce,linux,gpu;rocm,120,DIST,test_runner.py,20071,1,PYTHONPATH=..;http_proxy=;https_proxy=, -test_broadcast,linux,gpu;rocm,120,DIST,test_runner.py,20073,1,PYTHONPATH=..;http_proxy=;https_proxy=, -test_c_concat,linux,gpu;rocm,120,DIST,test_runner.py,20075,1,PYTHONPATH=..;http_proxy=;https_proxy=, -test_c_identity,linux,gpu;rocm,120,DIST,test_runner.py,20077,1,PYTHONPATH=..;http_proxy=;https_proxy=, -test_c_split,linux,gpu;rocm,120,DIST,test_runner.py,20079,1,PYTHONPATH=..;http_proxy=;https_proxy=, -test_collective_split_embedding,linux,rocm;gpu,300,DIST,../dist_test.sh,20081,1,PYTHONPATH=..;http_proxy=;https_proxy=, +name,os,arch,timeout,run_type,launcher,num_port,run_serial,ENVS,conditions +test_allreduce,linux,gpu;rocm,120,DIST,test_runner.py,2,1,PYTHONPATH=..;http_proxy=;https_proxy=, +test_broadcast,linux,gpu;rocm,120,DIST,test_runner.py,2,1,PYTHONPATH=..;http_proxy=;https_proxy=, +test_c_concat,linux,gpu;rocm,120,DIST,test_runner.py,2,1,PYTHONPATH=..;http_proxy=;https_proxy=, +test_c_identity,linux,gpu;rocm,120,DIST,test_runner.py,2,1,PYTHONPATH=..;http_proxy=;https_proxy=, +test_c_split,linux,gpu;rocm,120,DIST,test_runner.py,2,1,PYTHONPATH=..;http_proxy=;https_proxy=, +test_collective_split_embedding,linux,rocm;gpu,300,DIST,../dist_test.sh,2,1,PYTHONPATH=..;http_proxy=;https_proxy=, +test_collective_allgather_api,linux,gpu;rocm,300,DIST,test_runner.py,2,1,http_proxy=;https_proxy=;PYTHONPATH=.., +test_collective_allgather_object_api,linux,gpu;rocm,120,DIST,test_runner.py,2,1,http_proxy=;https_proxy=;PYTHONPATH=.., +test_collective_allreduce_api,linux,gpu;rocm,120,DIST,test_runner.py,2,1,http_proxy=;https_proxy=;PYTHONPATH=.., +test_collective_alltoall_api,linux,gpu;rocm,120,DIST,test_runner.py,2,1,http_proxy=;https_proxy=;PYTHONPATH=.., +test_collective_alltoall_single,linux,gpu;rocm,350,DIST,../dist_test.sh,2,1,http_proxy=;https_proxy=;PYTHONPATH=.., +test_collective_barrier_api,linux,gpu;rocm,300,DIST,test_runner.py,2,1,http_proxy=;https_proxy=;PYTHONPATH=.., +test_collective_batch_isend_irecv,linux,gpu;rocm,350,DIST,../dist_test.sh,2,1,http_proxy=;https_proxy=;PYTHONPATH=.., +test_collective_broadcast_api,linux,gpu;rocm,120,DIST,test_runner.py,2,1,http_proxy=;https_proxy=;PYTHONPATH=.., +test_collective_cpu_barrier_with_gloo,linux,gpu;rocm,300,DIST,test_runner.py,2,1,http_proxy=;https_proxy=;PYTHONPATH=.., +test_collective_global_gather,linux,gpu;rocm,200,DIST,test_runner.py,2,1,http_proxy=;https_proxy=;PYTHONPATH=.., +test_collective_global_scatter,linux,gpu;rocm,200,DIST,test_runner.py,2,1,http_proxy=;https_proxy=;PYTHONPATH=.., +test_collective_optimizer,linux,gpu;rocm,300,DIST,test_runner.py,2,1,http_proxy=;https_proxy=;PYTHONPATH=.., +test_collective_process_group,linux,gpu;rocm,350,DIST,../dist_test.sh,2,1,http_proxy=;https_proxy=;PYTHONPATH=.., +test_collective_reduce,linux,gpu;rocm,300,DIST,test_runner.py,2,1,http_proxy=;https_proxy=;PYTHONPATH=.., +test_collective_reduce_api,linux,gpu;rocm,300,DIST,test_runner.py,2,1,http_proxy=;https_proxy=;PYTHONPATH=.., +test_collective_reduce_scatter,linux,gpu;rocm,350,DIST,../dist_test.sh,2,1,http_proxy=;https_proxy=;PYTHONPATH=.., +test_collective_scatter,linux,gpu;rocm,300,DIST,test_runner.py,2,1,http_proxy=;https_proxy=;PYTHONPATH=.., +test_collective_scatter_api,linux,gpu;rocm,300,DIST,test_runner.py,2,1,http_proxy=;https_proxy=;PYTHONPATH=.., +test_collective_sendrecv,linux,gpu;rocm,300,DIST,test_runner.py,2,1,http_proxy=;https_proxy=;PYTHONPATH=.., +test_collective_sendrecv_api,linux,gpu;rocm,120,DIST,test_runner.py,2,1,http_proxy=;https_proxy=;PYTHONPATH=.., +test_collective_split_col_linear,linux,gpu;rocm,300,DIST,test_runner.py,2,1,http_proxy=;https_proxy=;PYTHONPATH=.., +test_collective_split_embedding_none_divisible,linux,gpu;rocm,300,DIST,test_runner.py,2,1,http_proxy=;https_proxy=;PYTHONPATH=.., +test_collective_split_row_linear,linux,gpu;rocm,300,DIST,test_runner.py,2,1,http_proxy=;https_proxy=;PYTHONPATH=.., +test_collective_wait,linux,gpu;rocm,300,DIST,test_runner.py,2,1,http_proxy=;https_proxy=;PYTHONPATH=.., +test_eager_dist_api,linux,gpu;rocm,120,DIST,test_runner.py,2,1,http_proxy=;https_proxy=;PYTHONPATH=.., +test_new_group_api,linux,gpu;rocm,120,DIST,test_runner.py,2,1,http_proxy=;https_proxy=;PYTHONPATH=.., +test_gen_nccl_id_op,,gpu;rocm;ASCEND;ASCEND_CL,,DIST,../dist_test.sh,2,1,http_proxy=;https_proxy=;PYTHONPATH=.., diff --git a/tools/gen_ut_cmakelists.py b/tools/gen_ut_cmakelists.py index c5716dd10b5..b95739fed61 100644 --- a/tools/gen_ut_cmakelists.py +++ b/tools/gen_ut_cmakelists.py @@ -13,6 +13,10 @@ # limitations under the License. import re +import os +import argparse + +# port range (21200, 23000) is reserved for dist-ops # function to process pythonpath env @@ -67,10 +71,10 @@ def process_conditions(conditions): Output: "" """ if len(conditions.strip()) == 0: - conditions = "" + conditions = [] else: - conditions = f" AND ({conditions})" - return conditions + conditions = conditions.strip().split(";") + return [c.strip() for c in conditions] def proccess_archs(arch): @@ -90,8 +94,8 @@ def proccess_archs(arch): arch = arch.upper().strip() if len(arch) > 0: for a in arch.split(";"): - assert a in ["GPU", "ROCM", "ASCEND", "ASCEND_CL"], \ - f"""Supported arhc options are "GPU", "ROCM", "ASCEND" and "ASCEND_CL", but the options is {a}""" + assert a in ["GPU", "ROCM", "ASCEND", "ASCEND_CL", "XPU"], \ + f"""Supported arhc options are "GPU", "ROCM", "ASCEND" and "ASCEND_CL", "XPU", but the options is {a}""" archs += "WITH_" + a.upper() + " OR " arch = "(" + archs[:-4] + ")" else: @@ -135,6 +139,34 @@ def process_run_serial(run_serial): return rs +def file_with_extension(prefix, suffixes): + """ + Desc: + check whether test file exists. + """ + for ext in suffixes: + if os.path.isfile(prefix + ext): + return True + return False + + +def process_name(name, curdir): + """ + Desc: + check whether name is with a legal format and check whther the test file exists. + """ + name = name.strip() + assert re.compile("^test_[0-9a-zA-Z_]+").search(name), \ + f"""If line is not the header of table, the test name must begin with "test_" """ \ + f"""and the following substring must include at least one char of "0-9", "a-z", "A-Z" or "_".""" + filepath_prefix = os.path.join(curdir, name) + suffix = [".py", ".sh"] + assert file_with_extension(filepath_prefix, suffix), \ + f""" Please ensure the test file with the prefix '{filepath_prefix}' and one of the suffix {suffix} exists, because you specified a unittest named '{name}'""" + + return name + + def process_run_type(run_type): rt = run_type.strip() assert re.compile("^(NIGHTLY|EXCLUSIVE|CINN|DIST|GPUPS|INFER|EXCLUSIVE:NIGHTLY|DIST:NIGHTLY)$").search(rt), \ @@ -143,7 +175,18 @@ def process_run_type(run_type): return rt -def parse_line(line): +DIST_UT_PORT = 21200 + + +def process_dist_ut_port(port_num): + global DIST_UT_PORT + port = DIST_UT_PORT + assert port < 23000, "dist port is exahausted" + DIST_UT_PORT += int(port_num) + return port + + +def parse_line(line, curdir): """ Desc: Input a line in csv file and output a string in cmake grammer, adding the specified test and setting its properties. @@ -161,24 +204,14 @@ def parse_line(line): endif()" """ - # A line contains name, os_, archs, timeout, run_type, launcher, dist_ut_port, run_serial, envs, conditions, etc. - # Following are descriptions of each variable: - # - # * `name`: the test's name - # * `os`: The supported operator system, ignoring case. If the test run in multiple operator systems, use ";" to split systems, forexample, `apple;linux` means the test runs on both Apple and Linux. The supported values are `linux`,`win32` and `apple`. If the value is empty, this means the test runs on all opertaor systems. - # * `arch`: the device's architecture. similar to `os`, multiple valuse ars splited by ";" and ignoring case. The supported arhchetectures are `gpu`, `xpu`, `npu` and `rocm`. - # * `timeout`: timeout of a unittest, whose unit is second. - # * `run_type`: run_type of a unittest. Supported values are `NIGHTLY`, `EXCLUSIVE`, `CINN`, `DIST`, `GPUPS`, `INFER`, `EXCLUSIVE:NIGHTLY`, `DIST:NIGHTLY`,which are case-insensitive. - # * `launcher`: the test launcher.Supported values are test_runner.py, dist_test.sh and custom scripts' name. - # * `dist_ut_port`: the starting port used in a distributed unit test - # * `run_serial`: whether in serial mode. the value can be 1 or 0. Default(empty) is 0 - # * `ENVS`: required environments. multiple envirenmonts are splited by ";". - # * `conditions`: extra required conditions for some tests. the value is a boolean expression in cmake programmer. name, os_, archs, timeout, run_type, launcher, dist_ut_port, run_serial, envs, conditions = line.strip( ).split(",") + # name == "name" means the line being parsed is the header of the table + # we should skip this line and return empty here. if name == "name": return "" + name = process_name(name, curdir) envs = process_envs(envs) conditions = process_conditions(conditions) @@ -189,8 +222,13 @@ def parse_line(line): cmd = "" + for c in conditions: + cmd += f"if ({c})\n" + + time_out_str = f'TIMEOUT "{timeout}"' if len(timeout.strip()) > 0 else '' if launcher[-3:] == ".sh": - cmd += f'''if({archs} AND {os_} {conditions}) + dist_ut_port = process_dist_ut_port(2) + cmd += f'''if({archs} AND {os_}) bash_test_modules( {name} START_BASH @@ -199,27 +237,48 @@ def parse_line(line): "RUN_TYPE={run_type}" ENVS "PADDLE_DIST_UT_PORT={dist_ut_port};{envs}") - set_tests_properties({name} PROPERTIES TIMEOUT "{timeout}" RUN_SERIAL {run_serial}) + set_tests_properties({name} PROPERTIES {time_out_str} RUN_SERIAL {run_serial}) endif() ''' else: - cmd += f'''if({archs} AND {os_} {conditions}) + cmd += f'''if({archs} AND {os_}) py_test_modules( {name} MODULES {name} ENVS - "PADDLE_DIST_UT_PORT={dist_ut_port};{envs}") - set_tests_properties({name} PROPERTIES TIMEOUT "{timeout}" RUN_SERIAL {run_serial}) + "{envs}") + set_tests_properties({name} PROPERTIES {time_out_str} RUN_SERIAL {run_serial}) endif() ''' + for _ in conditions: + cmd += f"endif()\n" return cmd +PROCESSED_DIR = set() + + def gen_cmakelists(current_work_dir): print("procfessing dir:", current_work_dir) if current_work_dir == "": current_work_dir = "." + + contents = os.listdir(current_work_dir) + sub_dirs = [] + for c in contents: + c_path = os.path.join(current_work_dir, c) + if c_path in PROCESSED_DIR: + return + if os.path.isdir(c_path): + PROCESSED_DIR.add(c_path) + if os.path.isfile(os.path.join(current_work_dir, c, "testslist.csv")) \ + or os.path.isfile(os.path.join(current_work_dir, c, "CMakeLists.txt")): + gen_cmakelists(os.path.join(current_work_dir, c)) + sub_dirs.append(c) + + if not os.path.isfile(os.path.join(current_work_dir, "testslist.csv")): + return cmds = """# This file is generated by ${PADDLE_ROOT}/tools/gen_ut_cmakelists.py. # Please don't modify this file manually. # If you need to change unittests in this file, please modify testslist.csv in the current directory @@ -229,7 +288,7 @@ set(LOCAL_ALL_PLAT ON)\n""" with open(f"{current_work_dir}/testslist.csv") as csv_file: for i, line in enumerate(csv_file.readlines()): try: - cmds += parse_line(line) + cmds += parse_line(line, current_work_dir) except Exception as e: print("===============PARSE LINE ERRORS OCCUR==========") print(e) @@ -237,14 +296,14 @@ set(LOCAL_ALL_PLAT ON)\n""" print(f"[ERROR LINE {i+1}]: {line.strip()}") exit(1) + for sub in sub_dirs: + cmds += f"add_subdirectory({sub})\n" print(cmds, end="") with open(f"{current_work_dir}/CMakeLists.txt", "w") as cmake_file: print(cmds, end="", file=cmake_file) if __name__ == "__main__": - import os - import argparse parser = argparse.ArgumentParser() parser.add_argument( "--files", -- GitLab