Skip to content

Commit

Permalink
Add separate CMakeLists.txt for CCL ops
Browse files Browse the repository at this point in the history
  • Loading branch information
Aswinmcw committed Dec 5, 2024
1 parent a318130 commit 1b89ff6
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 27 deletions.
29 changes: 2 additions & 27 deletions ttnn/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,34 +12,7 @@ set(ALL_TTNN_SRCS
${CMAKE_CURRENT_SOURCE_DIR}/cpp/ttnn/graph/graph_processor.cpp
${CMAKE_CURRENT_SOURCE_DIR}/cpp/ttnn/graph/graph_trace_utils.cpp
${CMAKE_CURRENT_SOURCE_DIR}/cpp/ttnn/graph/graph_pybind.cpp
${CMAKE_CURRENT_SOURCE_DIR}/cpp/ttnn/operations/ccl/erisc_datamover_builder.cpp
${CMAKE_CURRENT_SOURCE_DIR}/cpp/ttnn/operations/ccl/all_gather/all_gather.cpp
${CMAKE_CURRENT_SOURCE_DIR}/cpp/ttnn/operations/ccl/all_gather/all_gather_pybind.cpp
${CMAKE_CURRENT_SOURCE_DIR}/cpp/ttnn/operations/ccl/all_gather/device/all_gather_op.cpp
${CMAKE_CURRENT_SOURCE_DIR}/cpp/ttnn/operations/ccl/all_gather/device/multi_core/all_gather_op_multi_core.cpp
${CMAKE_CURRENT_SOURCE_DIR}/cpp/ttnn/operations/experimental/ccl/all_gather_matmul/all_gather_matmul.cpp
${CMAKE_CURRENT_SOURCE_DIR}/cpp/ttnn/operations/experimental/ccl/all_gather_matmul/all_gather_matmul_pybind.cpp
${CMAKE_CURRENT_SOURCE_DIR}/cpp/ttnn/operations/experimental/ccl/all_gather_matmul/device/all_gather_matmul_op.cpp
${CMAKE_CURRENT_SOURCE_DIR}/cpp/ttnn/operations/experimental/ccl/all_gather_matmul/device/multi_core/all_gather_matmul_op_multi_core.cpp
${CMAKE_CURRENT_SOURCE_DIR}/cpp/ttnn/operations/experimental/ccl/all_reduce/all_reduce.cpp
${CMAKE_CURRENT_SOURCE_DIR}/cpp/ttnn/operations/experimental/ccl/all_reduce/all_reduce_pybind.cpp
${CMAKE_CURRENT_SOURCE_DIR}/cpp/ttnn/operations/experimental/ccl/all_reduce/device/all_reduce_op.cpp
${CMAKE_CURRENT_SOURCE_DIR}/cpp/ttnn/operations/ccl/ccl_op_fusion.cpp
${CMAKE_CURRENT_SOURCE_DIR}/cpp/ttnn/operations/ccl/ccl_common.cpp
${CMAKE_CURRENT_SOURCE_DIR}/cpp/ttnn/operations/ccl/ccl_host_datastructures.cpp
${CMAKE_CURRENT_SOURCE_DIR}/cpp/ttnn/operations/ccl/common/types/ccl_types_args_emitters.cpp
${CMAKE_CURRENT_SOURCE_DIR}/cpp/ttnn/operations/ccl/common/uops/ccl_command.cpp
${CMAKE_CURRENT_SOURCE_DIR}/cpp/ttnn/operations/ccl/reduce_scatter/device/host/reduce_scatter_full_worker_grid.cpp
${CMAKE_CURRENT_SOURCE_DIR}/cpp/ttnn/operations/ccl/reduce_scatter/device/reduce_scatter_op.cpp
${CMAKE_CURRENT_SOURCE_DIR}/cpp/ttnn/operations/ccl/reduce_scatter/reduce_scatter.cpp
${CMAKE_CURRENT_SOURCE_DIR}/cpp/ttnn/operations/ccl/reduce_scatter/reduce_scatter_pybind.cpp
${CMAKE_CURRENT_SOURCE_DIR}/cpp/ttnn/operations/core/compute_kernel/compute_kernel_config.cpp
${CMAKE_CURRENT_SOURCE_DIR}/cpp/ttnn/operations/ccl/reduce_scatter/host/reduce_scatter_worker_builder.cpp
${CMAKE_CURRENT_SOURCE_DIR}/cpp/ttnn/operations/ccl/reduce_scatter/host/reduce_scatter_common.cpp
${CMAKE_CURRENT_SOURCE_DIR}/cpp/ttnn/operations/ccl/barrier/device/host/barrier_full_worker_grid.cpp
${CMAKE_CURRENT_SOURCE_DIR}/cpp/ttnn/operations/ccl/barrier/device/barrier_op.cpp
${CMAKE_CURRENT_SOURCE_DIR}/cpp/ttnn/operations/ccl/barrier/barrier.cpp
${CMAKE_CURRENT_SOURCE_DIR}/cpp/ttnn/operations/ccl/barrier/barrier_pybind.cpp
${CMAKE_CURRENT_SOURCE_DIR}/cpp/ttnn/operations/conv/conv2d/conv2d.cpp
${CMAKE_CURRENT_SOURCE_DIR}/cpp/ttnn/operations/conv/conv2d/conv2d_utils.cpp
${CMAKE_CURRENT_SOURCE_DIR}/cpp/ttnn/operations/conv/conv2d/conv2d_pybind.cpp
Expand Down Expand Up @@ -612,9 +585,11 @@ endforeach()

### Setup TTNN as a shared library with optional Python bindings
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/cpp/ttnn/tensor)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/cpp/ttnn/operations/ccl)
add_subdirectory(cpp/ttnn/deprecated)
set(TTNN_FINAL_SRC
${TTNN_SRC}
${CCL_TTNN_SRCS}
${QUEUE_SRCS}
${TENSOR_SRCS}
${TT_DNN_SRCS}
Expand Down
34 changes: 34 additions & 0 deletions ttnn/cpp/ttnn/operations/ccl/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
set(CCL_TTNN_SRCS
# Common
${CMAKE_CURRENT_SOURCE_DIR}/erisc_datamover_builder.cpp
${CMAKE_CURRENT_SOURCE_DIR}/ccl_op_fusion.cpp
${CMAKE_CURRENT_SOURCE_DIR}/ccl_common.cpp
${CMAKE_CURRENT_SOURCE_DIR}/ccl_host_datastructures.cpp
${CMAKE_CURRENT_SOURCE_DIR}/common/types/ccl_types_args_emitters.cpp
${CMAKE_CURRENT_SOURCE_DIR}/common/uops/ccl_command.cpp
# CCL Ops
${CMAKE_CURRENT_SOURCE_DIR}/all_gather/all_gather.cpp
${CMAKE_CURRENT_SOURCE_DIR}/all_gather/all_gather_pybind.cpp
${CMAKE_CURRENT_SOURCE_DIR}/all_gather/device/all_gather_op.cpp
${CMAKE_CURRENT_SOURCE_DIR}/all_gather/device/multi_core/all_gather_op_multi_core.cpp
${CMAKE_CURRENT_SOURCE_DIR}/reduce_scatter/device/host/reduce_scatter_full_worker_grid.cpp
${CMAKE_CURRENT_SOURCE_DIR}/reduce_scatter/device/reduce_scatter_op.cpp
${CMAKE_CURRENT_SOURCE_DIR}/reduce_scatter/reduce_scatter.cpp
${CMAKE_CURRENT_SOURCE_DIR}/reduce_scatter/reduce_scatter_pybind.cpp
${CMAKE_CURRENT_SOURCE_DIR}/reduce_scatter/host/reduce_scatter_worker_builder.cpp
${CMAKE_CURRENT_SOURCE_DIR}/reduce_scatter/host/reduce_scatter_common.cpp
${CMAKE_CURRENT_SOURCE_DIR}/barrier/device/host/barrier_full_worker_grid.cpp
${CMAKE_CURRENT_SOURCE_DIR}/barrier/device/barrier_op.cpp
${CMAKE_CURRENT_SOURCE_DIR}/barrier/barrier.cpp
${CMAKE_CURRENT_SOURCE_DIR}/barrier/barrier_pybind.cpp
#Experimental
${CMAKE_CURRENT_SOURCE_DIR}/../experimental/ccl/all_gather_matmul/all_gather_matmul.cpp
${CMAKE_CURRENT_SOURCE_DIR}/../experimental/ccl/all_gather_matmul/all_gather_matmul_pybind.cpp
${CMAKE_CURRENT_SOURCE_DIR}/../experimental/ccl/all_gather_matmul/device/all_gather_matmul_op.cpp
${CMAKE_CURRENT_SOURCE_DIR}/../experimental/ccl/all_gather_matmul/device/multi_core/all_gather_matmul_op_multi_core.cpp
${CMAKE_CURRENT_SOURCE_DIR}/../experimental/ccl/all_reduce/all_reduce.cpp
${CMAKE_CURRENT_SOURCE_DIR}/../experimental/ccl/all_reduce/all_reduce_pybind.cpp
${CMAKE_CURRENT_SOURCE_DIR}/../experimental/ccl/all_reduce/device/all_reduce_op.cpp
CACHE INTERNAL
"CCL sources to reuse in ttnn build"
)

0 comments on commit 1b89ff6

Please sign in to comment.