From 3f8585a96c5dc654ce3c8bc0d86e28e2a4028c1b Mon Sep 17 00:00:00 2001 From: HongyuJia Date: Wed, 28 Sep 2022 18:57:28 +0800 Subject: [PATCH] rename filenames from pten to phi (#46579) --- paddle/phi/tests/api/CMakeLists.txt | 8 +++---- ...ten_exception.cc => test_phi_exception.cc} | 24 +++++++++---------- ...test_pten_tensor.cc => test_phi_tensor.cc} | 0 paddle/phi/tools/CMakeLists.txt | 8 +++---- ...t_pten_kernels.cc => print_phi_kernels.cc} | 0 paddle/scripts/infrt_build.sh | 4 ++-- tools/parallel_UT_rule.py | 10 ++++---- 7 files changed, 27 insertions(+), 27 deletions(-) rename paddle/phi/tests/api/{test_pten_exception.cc => test_phi_exception.cc} (81%) rename paddle/phi/tests/api/{test_pten_tensor.cc => test_phi_tensor.cc} (100%) rename paddle/phi/tools/{print_pten_kernels.cc => print_phi_kernels.cc} (100%) diff --git a/paddle/phi/tests/api/CMakeLists.txt b/paddle/phi/tests/api/CMakeLists.txt index e8fb6359004..09c218e6bc9 100644 --- a/paddle/phi/tests/api/CMakeLists.txt +++ b/paddle/phi/tests/api/CMakeLists.txt @@ -1,23 +1,23 @@ if(WITH_GPU) nv_test( test_phi_tensor - SRCS test_pten_tensor.cc + SRCS test_phi_tensor.cc DEPS phi_tensor glog) elseif(WITH_ROCM) hip_test( test_phi_tensor - SRCS test_pten_tensor.cc + SRCS test_phi_tensor.cc DEPS phi_tensor glog) else() cc_test( test_phi_tensor - SRCS test_pten_tensor.cc + SRCS test_phi_tensor.cc DEPS phi_tensor glog) endif() cc_test( test_phi_exception - SRCS test_pten_exception.cc + SRCS test_phi_exception.cc DEPS gtest) set(COMMON_API_TEST_DEPS phi_tensor phi_api phi_api_utils) diff --git a/paddle/phi/tests/api/test_pten_exception.cc b/paddle/phi/tests/api/test_phi_exception.cc similarity index 81% rename from paddle/phi/tests/api/test_pten_exception.cc rename to paddle/phi/tests/api/test_phi_exception.cc index 92c44684f3a..3384f120e13 100644 --- a/paddle/phi/tests/api/test_pten_exception.cc +++ b/paddle/phi/tests/api/test_phi_exception.cc @@ -27,10 +27,10 @@ TEST(PD_THROW, empty) { std::string err_msg = e.what(); EXPECT_TRUE(err_msg.find("An error occurred.") != std::string::npos); #if _WIN32 - EXPECT_TRUE(err_msg.find("tests\\api\\test_pten_exception.cc") != + EXPECT_TRUE(err_msg.find("tests\\api\\test_phi_exception.cc") != std::string::npos); #else - EXPECT_TRUE(err_msg.find("paddle/phi/tests/api/test_pten_exception.cc") != + EXPECT_TRUE(err_msg.find("paddle/phi/tests/api/test_phi_exception.cc") != std::string::npos); #endif } @@ -54,10 +54,10 @@ TEST(PD_THROW, non_empty) { EXPECT_TRUE(err_msg.find("PD_THROW returns 0. DataType of 1 is INT. ") != std::string::npos); #if _WIN32 - EXPECT_TRUE(err_msg.find("tests\\api\\test_pten_exception.cc") != + EXPECT_TRUE(err_msg.find("tests\\api\\test_phi_exception.cc") != std::string::npos); #else - EXPECT_TRUE(err_msg.find("paddle/phi/tests/api/test_pten_exception.cc") != + EXPECT_TRUE(err_msg.find("paddle/phi/tests/api/test_phi_exception.cc") != std::string::npos); #endif } @@ -84,10 +84,10 @@ TEST(PD_CHECK, FAILED) { EXPECT_TRUE(err_msg.find("Expected false, but it's not satisfied.") != std::string::npos); #if _WIN32 - EXPECT_TRUE(err_msg.find("tests\\api\\test_pten_exception.cc") != + EXPECT_TRUE(err_msg.find("tests\\api\\test_phi_exception.cc") != std::string::npos); #else - EXPECT_TRUE(err_msg.find("paddle/phi/tests/api/test_pten_exception.cc") != + EXPECT_TRUE(err_msg.find("paddle/phi/tests/api/test_phi_exception.cc") != std::string::npos); #endif } @@ -110,10 +110,10 @@ TEST(PD_CHECK, FAILED) { EXPECT_TRUE(err_msg.find("PD_CHECK returns 0. DataType of 1 is INT. ") != std::string::npos); #if _WIN32 - EXPECT_TRUE(err_msg.find("tests\\api\\test_pten_exception.cc") != + EXPECT_TRUE(err_msg.find("tests\\api\\test_phi_exception.cc") != std::string::npos); #else - EXPECT_TRUE(err_msg.find("paddle/phi/tests/api/test_pten_exception.cc") != + EXPECT_TRUE(err_msg.find("paddle/phi/tests/api/test_phi_exception.cc") != std::string::npos); #endif } @@ -130,10 +130,10 @@ TEST(PD_CHECK, FAILED) { EXPECT_TRUE(err_msg.find("Expected a > b, but it's not satisfied.") != std::string::npos); #if _WIN32 - EXPECT_TRUE(err_msg.find("tests\\api\\test_pten_exception.cc") != + EXPECT_TRUE(err_msg.find("tests\\api\\test_phi_exception.cc") != std::string::npos); #else - EXPECT_TRUE(err_msg.find("paddle/phi/tests/api/test_pten_exception.cc") != + EXPECT_TRUE(err_msg.find("paddle/phi/tests/api/test_phi_exception.cc") != std::string::npos); #endif } @@ -150,10 +150,10 @@ TEST(PD_CHECK, FAILED) { EXPECT_TRUE(err_msg.find("PD_CHECK returns 0, because 123 > 0.345") != std::string::npos); #if _WIN32 - EXPECT_TRUE(err_msg.find("tests\\api\\test_pten_exception.cc") != + EXPECT_TRUE(err_msg.find("tests\\api\\test_phi_exception.cc") != std::string::npos); #else - EXPECT_TRUE(err_msg.find("paddle/phi/tests/api/test_pten_exception.cc") != + EXPECT_TRUE(err_msg.find("paddle/phi/tests/api/test_phi_exception.cc") != std::string::npos); #endif } diff --git a/paddle/phi/tests/api/test_pten_tensor.cc b/paddle/phi/tests/api/test_phi_tensor.cc similarity index 100% rename from paddle/phi/tests/api/test_pten_tensor.cc rename to paddle/phi/tests/api/test_phi_tensor.cc diff --git a/paddle/phi/tools/CMakeLists.txt b/paddle/phi/tools/CMakeLists.txt index d1df5ec3275..9c2492cd4ef 100644 --- a/paddle/phi/tools/CMakeLists.txt +++ b/paddle/phi/tools/CMakeLists.txt @@ -1,8 +1,8 @@ -add_executable(print_pten_kernels print_pten_kernels.cc) -target_link_libraries(print_pten_kernels phi phi_api_utils) +add_executable(print_phi_kernels print_phi_kernels.cc) +target_link_libraries(print_phi_kernels phi phi_api_utils) if(WIN32) - target_link_libraries(print_pten_kernels shlwapi.lib) + target_link_libraries(print_phi_kernels shlwapi.lib) endif() if(WITH_ROCM) - target_link_libraries(print_pten_kernels ${ROCM_HIPRTC_LIB}) + target_link_libraries(print_phi_kernels ${ROCM_HIPRTC_LIB}) endif() diff --git a/paddle/phi/tools/print_pten_kernels.cc b/paddle/phi/tools/print_phi_kernels.cc similarity index 100% rename from paddle/phi/tools/print_pten_kernels.cc rename to paddle/phi/tools/print_phi_kernels.cc diff --git a/paddle/scripts/infrt_build.sh b/paddle/scripts/infrt_build.sh index 6bd6078eca2..6f13d888072 100755 --- a/paddle/scripts/infrt_build.sh +++ b/paddle/scripts/infrt_build.sh @@ -33,9 +33,9 @@ function update_pd_ops() { rm -rf ${PADDLE_ROOT}/build && mkdir -p ${PADDLE_ROOT}/build cd ${PADDLE_ROOT}/build cmake .. -DWITH_PYTHON=ON -DWITH_MKL=OFF -DWITH_GPU=OFF -DPYTHON_EXECUTABLE=`which python3` -DWITH_XBYAK=OFF -DWITH_NCCL=OFF -DWITH_RCCL=OFF -DWITH_CRYPTO=OFF - make -j8 paddle_python print_pten_kernels kernel_signature_generator + make -j8 paddle_python print_phi_kernels kernel_signature_generator cd ${PADDLE_ROOT}/build - ./paddle/phi/tools/print_pten_kernels > ../tools/infrt/kernels.json + ./paddle/phi/tools/print_phi_kernels > ../tools/infrt/kernels.json ./paddle/fluid/pybind/kernel_signature_generator > ../tools/infrt/kernel_signature.json cd python/dist/ python3 -m pip uninstall -y paddlepaddle diff --git a/tools/parallel_UT_rule.py b/tools/parallel_UT_rule.py index 575ad9c8821..5b51315e234 100755 --- a/tools/parallel_UT_rule.py +++ b/tools/parallel_UT_rule.py @@ -1711,9 +1711,9 @@ CPU_PARALLEL_JOB = [ 'test_fleet_utils', 'brpc_service_dense_sgd_test', 'test_custom_linear', - 'pten_test_backend', + 'phi_test_backend', 'test_allocator', - 'pten_test_data_type', + 'phi_test_data_type', 'test_slice_api', 'test_scale_api', 'test_sum_api', @@ -1723,7 +1723,7 @@ CPU_PARALLEL_JOB = [ 'build_strategy_test', 'test_fc_rnn_mkldnn_fuse_pass', 'scope_guard_test', - 'pten_utils_test', + 'phi_utils_test', 'init_test', 'cpu_helper_test', 'complex_gpu_test', @@ -1740,7 +1740,7 @@ CPU_PARALLEL_JOB = [ 'test_framework_place_utils', 'test_reshape_api', 'test_cast_api', - 'test_pten_exception', + 'test_phi_exception', 'test_mean_api', 'test_framework_storage', 'test_fill_api', @@ -2111,7 +2111,7 @@ TETRAD_PARALLEL_JOB = [ 'test_fused_layernorm_residual_dropout_bias', 'test_fused_dropout_act_bias', 'test_tensorrt', - 'test_pten_tensor', + 'test_phi_tensor', 'test_matmul_api', 'test_to_api', 'beam_search_test', -- GitLab