From b2c4398adf4bc95ee8e17875382b9c1b86188602 Mon Sep 17 00:00:00 2001 From: risemeup1 <515586620@qq.com> Date: Tue, 19 Dec 2023 08:03:33 +0000 Subject: [PATCH 1/2] remove redundant dependencies --- cmake/cinn/external/llvm.cmake | 1 - cmake/cinn/llvm.cmake | 1 - paddle/cinn/api/CMakeLists.txt | 2 - paddle/cinn/common/CMakeLists.txt | 2 - .../framework/new_executor/CMakeLists.txt | 3 +- .../new_executor/instruction/CMakeLists.txt | 6 +- .../new_executor/interpreter/CMakeLists.txt | 64 +++++++++---------- .../new_executor/pir_adaptor/CMakeLists.txt | 2 +- .../new_executor/workqueue/CMakeLists.txt | 12 ++-- paddle/fluid/platform/profiler/CMakeLists.txt | 2 +- .../profiler/custom_device/CMakeLists.txt | 2 +- paddle/fluid/pybind/CMakeLists.txt | 1 - 12 files changed, 42 insertions(+), 56 deletions(-) diff --git a/cmake/cinn/external/llvm.cmake b/cmake/cinn/external/llvm.cmake index f5663214801031..0b095a5b9c695d 100644 --- a/cmake/cinn/external/llvm.cmake +++ b/cmake/cinn/external/llvm.cmake @@ -88,7 +88,6 @@ llvm_map_components_to_libnames( message(STATUS "LLVM libs: ${llvm_libs}") get_property(mlir_libs GLOBAL PROPERTY MLIR_ALL_LIBS) -message(STATUS "MLIR libs: ${mlir_libs}") add_definitions(${LLVM_DEFINITIONS}) # The minimum needed libraries for MLIR IR parse and transform. diff --git a/cmake/cinn/llvm.cmake b/cmake/cinn/llvm.cmake index 4fc274e6983cd5..9cb048b957b64f 100644 --- a/cmake/cinn/llvm.cmake +++ b/cmake/cinn/llvm.cmake @@ -54,7 +54,6 @@ llvm_map_components_to_libnames( message(STATUS "LLVM libs: ${llvm_libs}") get_property(mlir_libs GLOBAL PROPERTY MLIR_ALL_LIBS) -message(STATUS "MLIR libs: ${mlir_libs}") add_definitions(${LLVM_DEFINITIONS}) # The minimum needed libraries for MLIR IR parse and transform. diff --git a/paddle/cinn/api/CMakeLists.txt b/paddle/cinn/api/CMakeLists.txt index 2806b33154c8b4..ba150cad722e74 100644 --- a/paddle/cinn/api/CMakeLists.txt +++ b/paddle/cinn/api/CMakeLists.txt @@ -1,5 +1,3 @@ core_gather_headers() gather_srcs(cinnapi_src SRCS op_node.cc tensor_node.cc) - -message(STATUS "srcs: ${cinnapi_src}") diff --git a/paddle/cinn/common/CMakeLists.txt b/paddle/cinn/common/CMakeLists.txt index 1df88d225ebe93..d5f254f407ff29 100644 --- a/paddle/cinn/common/CMakeLists.txt +++ b/paddle/cinn/common/CMakeLists.txt @@ -23,8 +23,6 @@ gather_srcs( nvgpu_dev_info.cc integer_set.cc) -message(STATUS "srcs: ${cinnapi_src}") - cinn_cc_test(test_equation_graph_topo_walker SRCS equation_graph_topo_walker_test.cc DEPS gtest glog) cinn_cc_test(test_dfs_walker SRCS dfs_walker_test.cc DEPS gtest glog) diff --git a/paddle/fluid/framework/new_executor/CMakeLists.txt b/paddle/fluid/framework/new_executor/CMakeLists.txt index 0ae4e35fdf13e6..e189b8b3e6a372 100644 --- a/paddle/fluid/framework/new_executor/CMakeLists.txt +++ b/paddle/fluid/framework/new_executor/CMakeLists.txt @@ -17,8 +17,7 @@ set(STANDALONE_EXECUTOR_DEPS pir_adaptor program_translator instruction_base - pir - plan) + pir) cc_library( standalone_executor diff --git a/paddle/fluid/framework/new_executor/instruction/CMakeLists.txt b/paddle/fluid/framework/new_executor/instruction/CMakeLists.txt index 46d907d60841b8..fe95ba15d9d37e 100644 --- a/paddle/fluid/framework/new_executor/instruction/CMakeLists.txt +++ b/paddle/fluid/framework/new_executor/instruction/CMakeLists.txt @@ -10,12 +10,12 @@ cc_library( tuple_push_instruction.cc tuple_pop_instruction.cc builtin_combine_instruction.cc - instruction_util.cc - DEPS pir_adaptor phi common framework_proto) + instruction_util.cc) +# DEPS pir_adaptor phi common framework_proto) if(WITH_CINN AND NOT CINN_ONLY) cc_library( cinn_jit_instruction NOT_FOR_INFER SRCS cinn_jit_instruction.cc - DEPS phi common cinnapi cinn_op_dialect cinn_runtime_dialect) + DEPS cinnapi cinn_op_dialect cinn_runtime_dialect) endif() diff --git a/paddle/fluid/framework/new_executor/interpreter/CMakeLists.txt b/paddle/fluid/framework/new_executor/interpreter/CMakeLists.txt index e2d221d167b139..9c27cccfe24de0 100644 --- a/paddle/fluid/framework/new_executor/interpreter/CMakeLists.txt +++ b/paddle/fluid/framework/new_executor/interpreter/CMakeLists.txt @@ -1,39 +1,38 @@ -set(INTERPRETER_SRCS data_transfer.cc dependency_builder.cc execution_config.cc - interpreter_util.cc static_build.cc stream_analyzer.cc) +set(INTERPRETER_SRCS + data_transfer.cc + dependency_builder.cc + execution_config.cc + interpreter_util.cc + static_build.cc + stream_analyzer.cc + plan.cc) set(INTERPRETER_DEPS buffered_reader device_context global_utils op_registry - scope - framework_proto - data_feed_proto - ops_extra_info - heter_service_proto - trainer_desc_proto - glog - lod_rank_table - framework_io - string_helper - fleet_wrapper - heter_wrapper - ps_gpu_wrapper - box_wrapper - lodtensor_printer - feed_fetch_method - graph_to_program_pass - variable_helper - timer - monitor - nan_inf_utils - enforce - scope - glog - phi - common - ${DEVICE_EVENT_LIBS} - glog) + #framework_proto + # data_feed_proto + # ops_extra_info + # heter_service_proto + # trainer_desc_proto + # lod_rank_table + # framework_io + # string_helper + # fleet_wrapper + # heter_wrapper + # ps_gpu_wrapper + # box_wrapper + # lodtensor_printer + # feed_fetch_method + # graph_to_program_pass + # variable_helper + # timer + # monitor + # nan_inf_utils + # enforce + ${DEVICE_EVENT_LIBS}) if(WITH_CINN AND NOT CINN_ONLY) set(INTERPRETER_DEPS ${INTERPRETER_DEPS} cinn_jit_instruction) @@ -43,8 +42,3 @@ cc_library( interpreter SRCS ${INTERPRETER_SRCS} DEPS standalone_executor ${INTERPRETER_DEPS}) - -cc_library( - plan - SRCS plan.cc - DEPS proto_desc framework_proto) diff --git a/paddle/fluid/framework/new_executor/pir_adaptor/CMakeLists.txt b/paddle/fluid/framework/new_executor/pir_adaptor/CMakeLists.txt index 9236249f421d72..c1ab577e1af6d9 100644 --- a/paddle/fluid/framework/new_executor/pir_adaptor/CMakeLists.txt +++ b/paddle/fluid/framework/new_executor/pir_adaptor/CMakeLists.txt @@ -4,4 +4,4 @@ file(GLOB PIR_ADAPTOR_SRCS "*.cc") cc_library( pir_adaptor SRCS ${PIR_ADAPTOR_SRCS} - DEPS program_translator op_dialect) + DEPS program_translator) diff --git a/paddle/fluid/framework/new_executor/workqueue/CMakeLists.txt b/paddle/fluid/framework/new_executor/workqueue/CMakeLists.txt index e92756a72274d8..5dc2fcbdb5eca2 100644 --- a/paddle/fluid/framework/new_executor/workqueue/CMakeLists.txt +++ b/paddle/fluid/framework/new_executor/workqueue/CMakeLists.txt @@ -1,8 +1,8 @@ -cc_library( - workqueue_utils - SRCS workqueue_utils.cc events_waiter.cc - DEPS enforce glog common) +# cc_library( +# workqueue_utils +# SRCS workqueue_utils.cc events_waiter.cc +# DEPS enforce glog common) cc_library( workqueue - SRCS workqueue.cc - DEPS workqueue_utils enforce glog phi common) + SRCS workqueue.cc workqueue_utils.cc events_waiter.cc + DEPS enforce glog phi common) diff --git a/paddle/fluid/platform/profiler/CMakeLists.txt b/paddle/fluid/platform/profiler/CMakeLists.txt index 92285058a869a9..4601fbecd77442 100644 --- a/paddle/fluid/platform/profiler/CMakeLists.txt +++ b/paddle/fluid/platform/profiler/CMakeLists.txt @@ -5,7 +5,7 @@ cc_library( cc_library( cuda_tracer SRCS cuda_tracer.cc cupti_data_process.cc - DEPS enforce glog common workqueue_utils) + DEPS enforce glog common) cc_library( xpu_tracer SRCS xpu_tracer.cc diff --git a/paddle/fluid/platform/profiler/custom_device/CMakeLists.txt b/paddle/fluid/platform/profiler/custom_device/CMakeLists.txt index 269bda41723de1..a97e88a6b476dd 100644 --- a/paddle/fluid/platform/profiler/custom_device/CMakeLists.txt +++ b/paddle/fluid/platform/profiler/custom_device/CMakeLists.txt @@ -1,4 +1,4 @@ cc_library( custom_tracer SRCS custom_tracer.cc - DEPS enforce glog workqueue_utils common) + DEPS enforce glog common) diff --git a/paddle/fluid/pybind/CMakeLists.txt b/paddle/fluid/pybind/CMakeLists.txt index 1012bb0e692428..ff18f3f6a24394 100755 --- a/paddle/fluid/pybind/CMakeLists.txt +++ b/paddle/fluid/pybind/CMakeLists.txt @@ -36,7 +36,6 @@ set(PYBIND_DEPS cuda_graph_with_memory_pool fleet_executor global_utils - plan phi_utils phi op_dialect_vjp From 2588df1eef0f164754f993b2c89b497e4881fa72 Mon Sep 17 00:00:00 2001 From: risemeup1 <515586620@qq.com> Date: Tue, 19 Dec 2023 08:57:21 +0000 Subject: [PATCH 2/2] remove redundant dependencies --- .../new_executor/instruction/CMakeLists.txt | 8 ++++-- .../new_executor/interpreter/CMakeLists.txt | 28 ++----------------- .../new_executor/workqueue/CMakeLists.txt | 9 +----- paddle/fluid/platform/profiler/CMakeLists.txt | 2 +- 4 files changed, 9 insertions(+), 38 deletions(-) diff --git a/paddle/fluid/framework/new_executor/instruction/CMakeLists.txt b/paddle/fluid/framework/new_executor/instruction/CMakeLists.txt index fe95ba15d9d37e..129e2847eb39c5 100644 --- a/paddle/fluid/framework/new_executor/instruction/CMakeLists.txt +++ b/paddle/fluid/framework/new_executor/instruction/CMakeLists.txt @@ -10,9 +10,11 @@ cc_library( tuple_push_instruction.cc tuple_pop_instruction.cc builtin_combine_instruction.cc - instruction_util.cc) -# DEPS pir_adaptor phi common framework_proto) - + instruction_util.cc + DEPS framework_proto) +if(WITH_MKLDNN) + add_dependencies(instruction_base mkldnn) +endif() if(WITH_CINN AND NOT CINN_ONLY) cc_library( cinn_jit_instruction NOT_FOR_INFER diff --git a/paddle/fluid/framework/new_executor/interpreter/CMakeLists.txt b/paddle/fluid/framework/new_executor/interpreter/CMakeLists.txt index 9c27cccfe24de0..046dd76a17de23 100644 --- a/paddle/fluid/framework/new_executor/interpreter/CMakeLists.txt +++ b/paddle/fluid/framework/new_executor/interpreter/CMakeLists.txt @@ -7,32 +7,8 @@ set(INTERPRETER_SRCS stream_analyzer.cc plan.cc) -set(INTERPRETER_DEPS - buffered_reader - device_context - global_utils - op_registry - #framework_proto - # data_feed_proto - # ops_extra_info - # heter_service_proto - # trainer_desc_proto - # lod_rank_table - # framework_io - # string_helper - # fleet_wrapper - # heter_wrapper - # ps_gpu_wrapper - # box_wrapper - # lodtensor_printer - # feed_fetch_method - # graph_to_program_pass - # variable_helper - # timer - # monitor - # nan_inf_utils - # enforce - ${DEVICE_EVENT_LIBS}) +set(INTERPRETER_DEPS buffered_reader device_context global_utils op_registry + ${DEVICE_EVENT_LIBS}) if(WITH_CINN AND NOT CINN_ONLY) set(INTERPRETER_DEPS ${INTERPRETER_DEPS} cinn_jit_instruction) diff --git a/paddle/fluid/framework/new_executor/workqueue/CMakeLists.txt b/paddle/fluid/framework/new_executor/workqueue/CMakeLists.txt index 5dc2fcbdb5eca2..e9fed941a73c84 100644 --- a/paddle/fluid/framework/new_executor/workqueue/CMakeLists.txt +++ b/paddle/fluid/framework/new_executor/workqueue/CMakeLists.txt @@ -1,8 +1 @@ -# cc_library( -# workqueue_utils -# SRCS workqueue_utils.cc events_waiter.cc -# DEPS enforce glog common) -cc_library( - workqueue - SRCS workqueue.cc workqueue_utils.cc events_waiter.cc - DEPS enforce glog phi common) +cc_library(workqueue SRCS workqueue.cc workqueue_utils.cc events_waiter.cc) diff --git a/paddle/fluid/platform/profiler/CMakeLists.txt b/paddle/fluid/platform/profiler/CMakeLists.txt index 4601fbecd77442..ddef352103be82 100644 --- a/paddle/fluid/platform/profiler/CMakeLists.txt +++ b/paddle/fluid/platform/profiler/CMakeLists.txt @@ -5,7 +5,7 @@ cc_library( cc_library( cuda_tracer SRCS cuda_tracer.cc cupti_data_process.cc - DEPS enforce glog common) + DEPS workqueue enforce glog common) cc_library( xpu_tracer SRCS xpu_tracer.cc