From 3e33ef5a63a858935341a2686ba210fd425accd1 Mon Sep 17 00:00:00 2001 From: Huihuang Zheng Date: Mon, 6 Dec 2021 20:45:45 +0800 Subject: [PATCH] Update CINN tag (#37870) 1. Modify git tag for CINN 2. Support compile option "-DWITH_CINN=ON, -DWITH_TESTING=OFF" --- cmake/external/cinn.cmake | 3 +-- .../framework/paddle2cinn/CMakeLists.txt | 26 ++++++++++--------- paddle/fluid/operators/CMakeLists.txt | 6 +++-- 3 files changed, 19 insertions(+), 16 deletions(-) diff --git a/cmake/external/cinn.cmake b/cmake/external/cinn.cmake index 581a5f93768..41b90345c8c 100644 --- a/cmake/external/cinn.cmake +++ b/cmake/external/cinn.cmake @@ -26,8 +26,7 @@ add_definitions(-w) ###################################### include(ExternalProject) set(CINN_PREFIX_DIR ${THIRD_PARTY_PATH}/CINN) -# TODO(zhhsplendid): Modify git tag after we have release tag -set(CINN_GIT_TAG develop) +set(CINN_GIT_TAG release/v0.1) set(CINN_OPTIONAL_ARGS -DPY_VERSION=${PY_VERSION} -DWITH_CUDA=${WITH_GPU} -DWITH_CUDNN=${WITH_GPU} diff --git a/paddle/fluid/framework/paddle2cinn/CMakeLists.txt b/paddle/fluid/framework/paddle2cinn/CMakeLists.txt index b80a265f8a4..b13166cff60 100644 --- a/paddle/fluid/framework/paddle2cinn/CMakeLists.txt +++ b/paddle/fluid/framework/paddle2cinn/CMakeLists.txt @@ -4,20 +4,22 @@ cc_library(transform_desc SRCS transform_desc.cc DEPS proto_desc cinn) cc_library(cinn_graph_symbolization SRCS cinn_graph_symbolization.cc DEPS lod_tensor graph transform_desc cinn) cc_library(cinn_compiler SRCS cinn_compiler.cc DEPS framework_proto graph lod_tensor cinn_cache_key cinn_graph_symbolization cinn) -cc_test(cinn_lib_test SRCS cinn_lib_test.cc DEPS cinn) -set_tests_properties(cinn_lib_test PROPERTIES LABELS "RUN_TYPE=CINN") +if (WITH_TESTING) + cc_test(cinn_lib_test SRCS cinn_lib_test.cc DEPS cinn) + set_tests_properties(cinn_lib_test PROPERTIES LABELS "RUN_TYPE=CINN") -cc_test(cinn_cache_key_test SRCS cinn_cache_key_test.cc DEPS cinn_cache_key) -set_tests_properties(cinn_cache_key_test PROPERTIES LABELS "RUN_TYPE=CINN") + cc_test(cinn_cache_key_test SRCS cinn_cache_key_test.cc DEPS cinn_cache_key) + set_tests_properties(cinn_cache_key_test PROPERTIES LABELS "RUN_TYPE=CINN") -cc_test(build_cinn_pass_test SRCS build_cinn_pass_test.cc DEPS build_cinn_pass cinn_compiler) -set_tests_properties(build_cinn_pass_test PROPERTIES LABELS "RUN_TYPE=CINN") + cc_test(build_cinn_pass_test SRCS build_cinn_pass_test.cc DEPS build_cinn_pass cinn_compiler) + set_tests_properties(build_cinn_pass_test PROPERTIES LABELS "RUN_TYPE=CINN") -cc_test(transform_desc_test SRCS transform_desc_test.cc DEPS transform_desc) -set_tests_properties(transform_desc_test PROPERTIES LABELS "RUN_TYPE=CINN") + cc_test(transform_desc_test SRCS transform_desc_test.cc DEPS transform_desc) + set_tests_properties(transform_desc_test PROPERTIES LABELS "RUN_TYPE=CINN") -cc_test(cinn_graph_symbolization_test SRCS cinn_graph_symbolization_test.cc DEPS cinn_graph_symbolization) -set_tests_properties(cinn_graph_symbolization_test PROPERTIES LABELS "RUN_TYPE=CINN") + cc_test(cinn_graph_symbolization_test SRCS cinn_graph_symbolization_test.cc DEPS cinn_graph_symbolization) + set_tests_properties(cinn_graph_symbolization_test PROPERTIES LABELS "RUN_TYPE=CINN") -cc_test(cinn_compiler_test SRCS cinn_compiler_test.cc DEPS cinn_compiler place proto_desc graph_viz_pass build_cinn_pass cinn) -set_tests_properties(cinn_compiler_test PROPERTIES LABELS "RUN_TYPE=CINN") + cc_test(cinn_compiler_test SRCS cinn_compiler_test.cc DEPS cinn_compiler place proto_desc graph_viz_pass build_cinn_pass cinn) + set_tests_properties(cinn_compiler_test PROPERTIES LABELS "RUN_TYPE=CINN") +endif() diff --git a/paddle/fluid/operators/CMakeLists.txt b/paddle/fluid/operators/CMakeLists.txt index 0c3572ab655..f0621af9bbd 100644 --- a/paddle/fluid/operators/CMakeLists.txt +++ b/paddle/fluid/operators/CMakeLists.txt @@ -169,8 +169,10 @@ endif() if (WITH_CINN) op_library(cinn_launch_op SRCS cinn_launch_op.cc cinn_launch_op.cu.cc DEPS transform_desc cinn_compiler cinn ${OP_HEADER_DEPS}) - cc_test(cinn_launch_op_test SRCS cinn_launch_op_test.cc DEPS cinn_compiler cinn_launch_op elementwise_add_op) - set_tests_properties(cinn_launch_op_test PROPERTIES ENVIRONMENT OMP_NUM_THREADS=1) + if (WITH_TESTING) + cc_test(cinn_launch_op_test SRCS cinn_launch_op_test.cc DEPS cinn_compiler cinn_launch_op elementwise_add_op) + set_tests_properties(cinn_launch_op_test PROPERTIES ENVIRONMENT OMP_NUM_THREADS=1) + endif() endif() # FIXME(typhoonzero): operator deps may not needed. -- GitLab