Skip to content

Commit a0977b2

Browse files
kimishpatelfacebook-github-bot
authored andcommitted
Use eigen blas for blas routines (#2672)
Summary: Pull Request resolved: #2672 In previous diffs we added eigen_blas for accelerating blas routines. In this diff we enable linking it for llama runner ghstack-source-id: 220378204 exported-using-ghexport Pre-existing lint failures bypass-github-export-checks bypass-github-pytorch-ci-checks Reviewed By: digantdesai, mcr229 Differential Revision: D55344019 fbshipit-source-id: e76c71c36d8f0044c7c26364ec136aa7ed963544
1 parent 3881bff commit a0977b2

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

build/cmake_deps.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ filters = [
275275
excludes = [
276276
"^codegen",
277277
# Exclude blas, since it's built as a separate target.
278-
# "^kernels/optimized/blas",
278+
"^kernels/optimized/blas",
279279
]
280280
deps = [
281281
"executorch",

examples/models/llama2/custom_ops/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ set(_common_include_directories ${EXECUTORCH_ROOT}/..)
4949
set(custom_ops_libs extension_module)
5050
list(APPEND custom_ops_libs pthreadpool)
5151
list(APPEND custom_ops_libs cpuinfo)
52+
list(APPEND custom_ops_libs cpublas)
53+
list(APPEND custom_ops_libs eigen_blas)
5254

5355
# Generate C++ bindings to register kernels into both PyTorch (for AOT) and
5456
# Executorch (for runtime). Here select all ops in optimized.yaml
@@ -65,7 +67,7 @@ add_library(custom_ops ${_custom_ops__srcs})
6567
target_include_directories(custom_ops PUBLIC "${_common_include_directories}")
6668
target_include_directories(custom_ops PRIVATE
6769
"${CMAKE_CURRENT_BINARY_DIR}/../../../../include")
68-
target_link_libraries(custom_ops PRIVATE ${custom_ops_libs})
70+
target_link_libraries(custom_ops PUBLIC ${custom_ops_libs})
6971

7072
target_compile_options(custom_ops PUBLIC ${_common_compile_options}
7173
-DET_USE_THREADPOOL)

kernels/optimized/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ if(NOT PYTHON_EXECUTABLE)
4646
endif()
4747
# Build cpublas.
4848
list(TRANSFORM _optimized_cpublas__srcs PREPEND "${EXECUTORCH_ROOT}/")
49-
add_library(cpublas ${_optimized_cpublas__srcs})
49+
add_library(cpublas STATIC ${_optimized_cpublas__srcs})
5050
target_link_libraries(cpublas PRIVATE executorch eigen_blas)
5151
target_compile_options(cpublas PUBLIC ${_common_compile_options})
5252

@@ -72,3 +72,5 @@ gen_operators_lib(
7272
DEPS executorch)
7373

7474
install(TARGETS cpublas optimized_kernels optimized_ops_lib DESTINATION lib)
75+
76+
install(TARGETS cpublas DESTINATION lib)

0 commit comments

Comments
 (0)