Skip to content

Back out "Build CPUBLAS as a separate CMake target" #2610

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
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
17 changes: 1 addition & 16 deletions build/Utils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,6 @@
# It should also be cmake-lint clean.
#

# Platform-specific definitions.
if(CMAKE_SYSTEM_PROCESSOR MATCHES "arm64")
set(arm64 ON)
else()
set(arm64 OFF)
endif()

if(CMAKE_SYSTEM_PROCESSOR MATCHES "(x86)|(X86)|(amd64)|(AMD64)")
set(x86 ON)
else()
set(x86 OFF)
endif()

# Public function to print summary for all configurations. For new variables,
# it's recommended to add them here.
function(executorch_print_configuration_summary)
Expand All @@ -45,8 +32,6 @@ function(executorch_print_configuration_summary)
message(STATUS " BUCK2 : ${BUCK2}")
message(STATUS " PYTHON_EXECUTABLE : ${PYTHON_EXECUTABLE}")
message(STATUS " FLATC_EXECUTABLE : ${FLATC_EXECUTABLE}")
message(STATUS " X86 : ${x86}")
message(STATUS " ARM64 : ${arm64}")
message(
STATUS " EXECUTORCH_ENABLE_LOGGING : ${EXECUTORCH_ENABLE_LOGGING}")
message(
Expand Down Expand Up @@ -135,4 +120,4 @@ function(extract_sources sources_file)
message(FATAL_ERROR "executorch: source list generation failed")
endif()
endif()
endfunction()
endfunction()
15 changes: 0 additions & 15 deletions build/cmake_deps.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ excludes = [
# Exclude the codegen templates, which are picked up because the buck target
# is the generated_lib and not the unwrapped set of kernels.
"^codegen/templates",
# Exclude blas, since it's built as a separate target.
"^kernels/optimized/blas",
]
deps = [
"executorch",
Expand Down Expand Up @@ -87,19 +85,6 @@ filters = [
".fbs$",
]

[targets.optimized_cpublas]
buck_targets = [
"//kernels/optimized:libblas",
]
filters = [
".cpp$",
]
excludes = [
]
deps = [
"executorch",
]

# ---------------------------------- core end ----------------------------------
# ---------------------------------- extension start ----------------------------------

Expand Down
17 changes: 1 addition & 16 deletions kernels/optimized/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,24 +30,9 @@ endif()

set(_common_compile_options -Wno-deprecated-declarations)

# Set platform-specific definitions.
if(arm64)
list(APPEND _common_compile_options -DET_BUILD_WITH_BLAS)
elseif(x86)
# TODO(T183193812) Enable once sleef is built in OSS.
# list(APPEND _common_compile_options -DCPU_CAPABILITY_AVX2)
endif()

include(${EXECUTORCH_ROOT}/build/Utils.cmake)
include(${EXECUTORCH_ROOT}/build/Codegen.cmake)

# Build cpublas.
list(TRANSFORM _optimized_cpublas__srcs PREPEND "${EXECUTORCH_ROOT}/")
add_library(cpublas ${_optimized_cpublas__srcs})
target_link_libraries(cpublas PRIVATE executorch)
target_compile_options(cpublas PUBLIC ${_common_compile_options})


# Generate C++ bindings to register kernels into both PyTorch (for AOT) and
# Executorch (for runtime). Here select all ops in optimized.yaml
set(_yaml "${CMAKE_CURRENT_LIST_DIR}/optimized-oss.yaml")
Expand All @@ -59,7 +44,7 @@ message("Generated files ${gen_command_sources}")

list(TRANSFORM _optimized_kernels__srcs PREPEND "${EXECUTORCH_ROOT}/")
add_library(optimized_kernels ${_optimized_kernels__srcs})
target_link_libraries(optimized_kernels PRIVATE executorch cpublas)
target_link_libraries(optimized_kernels PRIVATE executorch)
target_compile_options(optimized_kernels PUBLIC ${_common_compile_options})
# Build a library for _optimized_kernels_srcs
#
Expand Down