Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions paddle/fluid/framework/details/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -381,8 +381,8 @@ set(IR_PASS_DEPS
delete_dropout_op_pass)

if(WITH_CINN)
set(IR_PASS_DEPS ${IR_PASS_DEPS} build_cinn_pass)
set(IR_PASS_DEPS ${IR_PASS_DEPS} cinn_zero_tensor_trick_pass)
set(IR_PASS_DEPS ${IR_PASS_DEPS} paddle2cinn)
set(IR_PASS_DEPS ${IR_PASS_DEPS} paddle2cinn)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
set(IR_PASS_DEPS ${IR_PASS_DEPS} paddle2cinn)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

收到

endif()

if(NOT APPLE
Expand Down
6 changes: 3 additions & 3 deletions paddle/fluid/framework/ir/memory_optimize_pass/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ if(WITH_CINN)
share_varinfo_into_cinn_pass
SRCS share_varinfo_into_cinn_pass.cc
DEPS pass enforce graph_helper computation_op_handle
eager_deletion_op_handle cinn_compiler)
eager_deletion_op_handle)
cc_test(
share_varinfo_into_cinn_pass_test
SRCS share_varinfo_into_cinn_pass_test.cc
DEPS share_varinfo_into_cinn_pass parallel_executor cinn_compiler
elementwise_add_op mul_op cinn_launch_op)
DEPS share_varinfo_into_cinn_pass parallel_executor elementwise_add_op
mul_op cinn_launch_op)
list(APPEND EAGER_DELETETION_PASS_DEPS share_varinfo_into_cinn_pass)
endif()

Expand Down
137 changes: 23 additions & 114 deletions paddle/fluid/framework/paddle2cinn/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,116 +1,25 @@
pass_library(
build_cinn_pass
base
DEPS
cinn_subgraph_detector
subgraph_detector
cinn_compiler
phi
enforce)

pass_library(cinn_zero_tensor_trick_pass base)

cc_library(
transform_desc
SRCS transform_desc.cc
DEPS proto_desc cinnapi)
cc_library(
transform_type
SRCS transform_type.cc
DEPS phi enforce cinnapi)
cc_library(
cinn_cache_key
SRCS cinn_cache_key.cc
DEPS graph graph_helper lod_tensor proto_desc transform_type)
cc_library(
cinn_subgraph_detector
SRCS cinn_subgraph_detector.cc
DEPS graph graph_helper subgraph_detector lod_tensor proto_desc)
cc_library(
cinn_graph_symbolization
SRCS cinn_graph_symbolization.cc
DEPS lod_tensor graph transform_desc cinnapi)
cc_library(
cinn_compiler
SRCS cinn_compiler.cc
DEPS framework_proto
graph
lod_tensor
cinn_cache_key
cinn_graph_symbolization
cinnapi
cinn_launch_context
parallel_executor
python
pybind)

if(WITH_TESTING)
# cc_test_old(cinn_lib_test SRCS cinn_lib_test.cc DEPS cinnapi)
# set_tests_properties(cinn_lib_test PROPERTIES LABELS "RUN_TYPE=CINN")

cc_test_old(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_old(
build_cinn_pass_test
SRCS
build_cinn_pass_test.cc
DEPS
fleet_executor
build_cinn_pass
cinn_compiler
op_registry
mul_op
activation_op
elementwise_add_op
generated_op
generated_static_op)
set_tests_properties(build_cinn_pass_test PROPERTIES LABELS "RUN_TYPE=CINN")
target_link_libraries(build_cinn_pass_test ${PYTHON_LIBRARIES})

cc_test_old(
cinn_zero_tensor_trick_pass_test
SRCS
cinn_zero_tensor_trick_pass_test.cc
DEPS
fleet_executor
build_cinn_pass
cinn_compiler
file(GLOB paddle2cinn_srcs "*.cc")
set(paddle2cinn_deps
gtest
absl
isl
mkldnn
xxhash
pybind
python
op_registry
elementwise_add_op
generated_op)
set_tests_properties(cinn_zero_tensor_trick_pass_test
PROPERTIES LABELS "RUN_TYPE=CINN")
target_link_libraries(cinn_zero_tensor_trick_pass_test ${PYTHON_LIBRARIES})
pass
graph_traits
cinnapi
cinn_launch_context
proto_desc
auto_parallel_proto
cinn_framework_proto
schedule_desc_proto
auto_schedule_proto
parallel_executor)

cc_test_old(transform_desc_test SRCS transform_desc_test.cc DEPS
transform_desc)
set_tests_properties(transform_desc_test PROPERTIES LABELS "RUN_TYPE=CINN")

cc_test_old(transform_type_test SRCS transform_type_test.cc DEPS
transform_type)
set_tests_properties(transform_type_test PROPERTIES LABELS "RUN_TYPE=CINN")

# cc_test_old(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_old(
# cinn_compiler_test
# SRCS
# cinn_compiler_test.cc
# DEPS
# cinn_compiler
# place
# proto_desc
# graph_viz_pass
# build_cinn_pass
# cinnapi
# mul_op
# activation_op
# elementwise_add_op
# generated_op)
# set_tests_properties(cinn_compiler_test PROPERTIES LABELS "RUN_TYPE=CINN")
endif()
cc_library(
paddle2cinn
SRCS ${paddle2cinn_srcs}
DEPS ${paddle2cinn_deps})
3 changes: 1 addition & 2 deletions paddle/fluid/inference/tensorrt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ elseif(WITH_CINN)
nv_test(
test_tensorrt_engine
SRCS test_engine.cc test_dynamic_engine.cc
DEPS fleet_executor cinn_compiler dynload_cuda tensorrt_engine
tensorrt_plugin python)
DEPS fleet_executor dynload_cuda tensorrt_engine tensorrt_plugin python)
else()
nv_test(
test_tensorrt_engine
Expand Down
1 change: 0 additions & 1 deletion paddle/fluid/inference/tensorrt/convert/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@ elseif(WITH_CINN)
custom_operator
init_phi
fleet_executor
cinn_compiler
python)
else()
nv_test(
Expand Down
12 changes: 2 additions & 10 deletions paddle/fluid/operators/cinn/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,8 @@ cc_library(
device_context
parallel_executor
standalone_executor
transform_type
cinnapi)

set(CINN_OP_DEPS
parallel_executor
string_helper
variable_helper
cinnapi
cinn_compiler
cinn_op_helper
cinn_launch_context
transform_type)
set(CINN_OP_DEPS parallel_executor string_helper variable_helper cinnapi
cinn_op_helper cinn_launch_context)
register_operators(DEPS ${CINN_OP_DEPS})
2 changes: 1 addition & 1 deletion test/cpp/eager/data_structure_tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
if(WITH_CINN)
set(eager_deps ${eager_deps} cinn_compiler python)
set(eager_deps ${eager_deps} python)
endif()
cc_test(
test_egr_ds_eager_tensor
Expand Down
2 changes: 1 addition & 1 deletion test/cpp/eager/performance_tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
if(NOT (NOT WITH_PYTHON AND ON_INFER))
if(WITH_CINN)
set(eager_deps ${eager_deps} cinn_compiler python)
set(eager_deps ${eager_deps} python)
endif()
cc_library(performance_benchmark_utils SRCS benchmark_utils.cc)
add_dependencies(
Expand Down
3 changes: 1 addition & 2 deletions test/cpp/fluid/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ cc_test(
SRCS save_load_combine_op_test.cc
DEPS save_combine_op load_combine_op)
if(WITH_CINN)
set(CINN_DEPS cinn_compiler python)
set(CINN_DEPS python)
endif()
if(WITH_GPU)
nv_test(
Expand Down Expand Up @@ -118,7 +118,6 @@ if(WITH_CINN)
DEPS
executor
fleet_executor
cinn_compiler
recurrent_op_helper
recurrent_op
elementwise_add_op
Expand Down
14 changes: 0 additions & 14 deletions test/cpp/fluid/cinn/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,26 +21,12 @@ if(WITH_TESTING)
set(CINN_RUN_ENVIRONMENT
"OMP_NUM_THREADS=1;runtime_include_dir=${CINN_INCLUDE_DIR}/paddle/cinn/runtime/cuda/"
)
# cc_test_old(
# cinn_launch_op_test
# SRCS
# cinn_launch_op_test.cc
# DEPS
# cinn_compiler
# cinn_launch_op
# cinn_instruction_run_op
# elementwise_add_op
# gflags)
# set_tests_properties(
# cinn_launch_op_test PROPERTIES LABELS "RUN_TYPE=CINN" ENVIRONMENT
# "${CINN_RUN_ENVIRONMENT}")

cc_test_old(
cinn_instruction_run_op_test
SRCS
cinn_instruction_run_op_test.cc
DEPS
cinn_compiler
cinn_launch_op
cinn_instruction_run_op
elementwise_add_op
Expand Down
36 changes: 36 additions & 0 deletions test/cpp/fluid/framework/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -308,3 +308,39 @@ cc_test(
test_fleet_cc
SRCS fleet/test_fleet.cc
DEPS fleet_wrapper gloo_wrapper framework_io string_helper)

if(WITH_CINN)
cc_test_old(
cinn_cache_key_test
SRCS
paddle2cinn/cinn_cache_key_test.cc
DEPS
paddle2cinn
graph
python)
set_tests_properties(cinn_cache_key_test PROPERTIES LABELS "RUN_TYPE=CINN")

paddle_test(build_cinn_pass_test SRCS paddle2cinn/build_cinn_pass_test.cc)
set_tests_properties(build_cinn_pass_test PROPERTIES LABELS "RUN_TYPE=CINN")
# target_link_libraries(build_cinn_pass_test ${PYTHON_LIBRARIES})

cc_test_old(cinn_zero_tensor_trick_pass_test SRCS
paddle2cinn/cinn_zero_tensor_trick_pass_test.cc DEPS paddle2cinn)
set_tests_properties(cinn_zero_tensor_trick_pass_test
PROPERTIES LABELS "RUN_TYPE=CINN")
target_link_libraries(cinn_zero_tensor_trick_pass_test ${PYTHON_LIBRARIES})

cc_test_old(transform_desc_test SRCS paddle2cinn/transform_desc_test.cc DEPS
paddle2cinn)
set_tests_properties(transform_desc_test PROPERTIES LABELS "RUN_TYPE=CINN")

cc_test_old(
transform_type_test
SRCS
paddle2cinn/transform_type_test.cc
DEPS
paddle2cinn
cinnapi
cinn_op_dialect)
set_tests_properties(transform_type_test PROPERTIES LABELS "RUN_TYPE=CINN")
endif()
3 changes: 0 additions & 3 deletions test/cpp/fluid/fused/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
if(WITH_CINN)
set(CINN_DEPS cinn_compiler python)
endif()
if(WITH_GPU OR WITH_ROCM)
# fusion_group
if(NOT APPLE AND NOT WIN32)
Expand Down
6 changes: 2 additions & 4 deletions test/cpp/prim/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,12 @@ set(prim_eager_deps

set(prim_generated_deps final_dygraph_function final_dygraph_node
dygraph_function dygraph_node)
if(WITH_CINN)
set(CINN_DEPS cinn_compiler)
endif()

paddle_test(test_comp_static SRCS test_static_prim.cc)

if(NOT (NOT WITH_PYTHON AND ON_INFER))
if(WITH_CINN)
set(prim_eager_deps ${prim_eager_deps} cinn_compiler)
set(prim_eager_deps ${prim_eager_deps})
endif()
cc_library(init_env_utils SRCS init_env_utils.cc)
target_compile_definitions(init_env_utils PUBLIC PADDLE_DLL_EXPORT)
Expand Down