Skip to content

Commit 711fa08

Browse files
authored
Add build flag to set parallel_backend (#1870)
up
1 parent d3b481b commit 711fa08

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

torchao/experimental/CMakeLists.txt

+4
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ if(NOT TORCHAO_INCLUDE_DIRS)
2424
set(TORCHAO_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/../..)
2525
endif()
2626

27+
if(NOT DEFINED TORCHAO_PARALLEL_BACKEND)
28+
set(TORCHAO_PARALLEL_BACKEND aten_openmp)
29+
endif()
30+
2731
include(CMakePrintHelpers)
2832

2933
add_compile_options("-Wall" "-Werror" "-Wno-deprecated")

torchao/experimental/ops/embedding_xbit/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ find_package(Torch REQUIRED)
1212
add_library(torchao_ops_embedding_xbit_aten OBJECT
1313
op_embedding_xbit_aten.cpp
1414
)
15-
target_link_torchao_parallel_backend(torchao_ops_embedding_xbit_aten "aten_openmp")
15+
target_link_torchao_parallel_backend(torchao_ops_embedding_xbit_aten "${TORCHAO_PARALLEL_BACKEND}")
1616
if (TORCHAO_BUILD_CPU_AARCH64)
1717
target_link_libraries(torchao_ops_embedding_xbit_aten PRIVATE torchao_kernels_aarch64)
1818
endif()

torchao/experimental/ops/linear_8bit_act_xbit_weight/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ add_library(torchao_ops_linear_8bit_act_xbit_weight_aten OBJECT
2424
linear_8bit_act_xbit_weight.cpp
2525
op_linear_8bit_act_xbit_weight_aten.cpp
2626
)
27-
target_link_torchao_parallel_backend(torchao_ops_linear_8bit_act_xbit_weight_aten aten_openmp)
27+
target_link_torchao_parallel_backend(torchao_ops_linear_8bit_act_xbit_weight_aten "${TORCHAO_PARALLEL_BACKEND}")
2828

2929
if(TORCHAO_BUILD_CPU_AARCH64)
3030
target_link_libraries(torchao_ops_linear_8bit_act_xbit_weight_aten PRIVATE torchao_kernels_aarch64)

0 commit comments

Comments
 (0)