diff --git a/paddle/scripts/paddle_build.sh b/paddle/scripts/paddle_build.sh index a773f47bb3cc06c51b9ab0750f11ee74cc8c3962..2db59b7b61ce7e7a32c7500e3c8df9233fe8412d 100644 --- a/paddle/scripts/paddle_build.sh +++ b/paddle/scripts/paddle_build.sh @@ -2173,7 +2173,30 @@ function parallel_test_base_gpups() { ======================================== EOF ut_startTime_s=`date +%s` - ctest -L "RUN_TYPE=GPUPS" --timeout 120 + + protobuf_version=`pip list | grep "protobuf" | awk '{print $2}'` + if [[ "$protobuf_version" == 3.* ]]; then + echo "Your current protobuf version is $protobuf_version" + ctest -L "RUN_TYPE=GPUPS" --timeout 120 + else + echo "Your current protobuf version is $protobuf_version" + #get all unittests need to be run by protobuf 3 + python ${PADDLE_ROOT}/tools/test_run_by_protobuf_3.py > all_ut_run_by_protobuf3 + # get all unittets need to be run in gpups ci + ctest -N -V -L "RUN_TYPE=GPUPS"| grep -Ei "Test[ \t]+#" | grep -oEi "\w+$" > ut_gpups + #get the intersection of ut_run_by_protobuf3 and ut_gpups + grep -F -f all_ut_run_by_protobuf3 ut_gpups > ut_run_by_protobuf3_in_gpups + #get the difference set of ut_gpups and ut_run_by_protobuf3_in_gpups + grep -F -x -v -f ut_run_by_protobuf3_in_gpups ut_gpups > ut_run_in_gpups + + ctest -R ${ut_run_in_gpups} --timeout 120 + pip install protobuf==3.20.2 + ctest -R ${ut_run_by_protobuf3_in_gpups} --timeout 120 + ut_endTime_s=`date +%s` + echo "GPUPS testCase Time: $[ $ut_endTime_s - $ut_startTime_s ]s" + pip install protobuf==$protobuf_version + fi + ut_endTime_s=`date +%s` echo "GPUPS testCase Time: $[ $ut_endTime_s - $ut_startTime_s ]s" diff --git a/tools/test_run_by_protobuf_3.py b/tools/test_run_by_protobuf_3.py new file mode 100644 index 0000000000000000000000000000000000000000..16ceb77fba29a0b48f3e4bba563e2c67607005a3 --- /dev/null +++ b/tools/test_run_by_protobuf_3.py @@ -0,0 +1,86 @@ +# Copyright (c) 2023 PaddlePaddle Authors. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +PROTOBUF3_NEEDED_TESTING_LIST = [ + 'test_dist_fleet_ps11', + 'test_dist_fleet_ps12', + 'test_dataloader_dataset', + 'test_ema_fleet', + 'test_fleet_base2', + 'test_fleet_base3', + 'test_communicator_geo', + 'test_communicator_async', + 'test_dist_fleet_a_sync_optimizer_async', + 'test_dist_fleet_a_sync_optimizer_auto', + 'test_dist_fleet_a_sync_optimizer_sync', + 'test_dist_fleet_a_sync_optimizer_geo', + 'test_dist_fleet_a_sync_optimizer_auto_geo', + 'test_dist_fleet_a_sync_optimizer_auto_async', + 'test_fleet_fp16_allreduce_meta_optimizer', + 'test_dist_fleet_ctr', + 'test_dist_fleet_ctr2', + 'test_dist_fleet_decay', + 'test_dist_fleet_geo', + 'test_dist_fleet_heter_program', + 'test_dist_fleet_ps', + 'test_dist_fleet_ps10', + 'test_dist_fleet_ps13', + 'test_dist_fleet_ps2', + 'test_dist_fleet_ps3', + 'test_dist_fleet_ps4', + 'test_dist_fleet_ps5', + 'test_dist_fleet_ps6', + 'test_dist_fleet_ps7', + 'test_dist_fleet_ps8', + 'test_dist_fleet_ps9', + 'test_dist_fleet_simnet', + 'test_dist_fleet_sparse_embedding_ctr', + 'test_dist_sparse_tensor_load_adagrad', + 'test_dist_sparse_tensor_load_adam', + 'test_dist_sparse_tensor_load_ftrl', + 'test_dist_sparse_tensor_load_momentum', + 'test_dist_sparse_tensor_load_rmsprop', + 'test_dist_sparse_tensor_load_sgd', + 'test_communicator_sync', + 'test_dist_fuse_adam_pass', + 'test_dist_fuse_bn_act_pass', + 'test_dist_fuse_bn_add_act_pass', + 'test_dist_fuse_momentum_pass', + 'test_dist_fuse_relu_depthwise_conv_pass', + 'test_dist_fuse_sgd_pass', + 'test_dist_inplace_addto_pass', + 'test_fleet_sharding_meta_optimizer', + 'test_rnn_dp', + 'test_communicator_half_async', + 'test_fleet_graph_executor', + 'test_fleet_localsgd_meta_optimizer', + 'test_fleet_lars_meta_optimizer', + 'test_fleet_pipeline_meta_optimizer', + 'test_fleet_gradient_merge_meta_optimizer', + 'test_fleet_amp_init', + 'test_fleet_raw_program_meta_optimizer', + 'test_fleet_dgc_meta_optimizer', + 'test_fleet_lamb_meta_optimizer', + 'test_fleet_pipeline_meta_optimizer_with_recompute', + 'test_fleet_hybrid_meta_optimizer', + 'test_fleet_amp_meta_optimizer', + 'test_fleet_recompute_meta_optimizer', + 'test_fleet_with_asp_static', + 'test_fleet_with_asp_sharding', +] + +if __name__ == "__main__": + + for test in PROTOBUF3_NEEDED_TESTING_LIST: + print(test)