diff --git a/CMakeLists.txt b/CMakeLists.txt index 8f9dbff7afc..52379dbf513 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -456,7 +456,7 @@ endif() add_subdirectory(schema) # -# executorch_no_prim_ops: Minimal runtime library +# executorch_core: Minimal runtime library # # The bare-minimum runtime library, supporting the Program and Method # interfaces. Does not contain any operators, including primitive ops. Does not @@ -464,14 +464,14 @@ add_subdirectory(schema) # # Remove any PAL-definition files from the sources. -list(FILTER _executorch_no_prim_ops__srcs EXCLUDE REGEX +list(FILTER _executorch_core__srcs EXCLUDE REGEX "runtime/platform/default/[^/]*.cpp$" ) # Add the source file that maps to the requested default PAL implementation. if(EXECUTORCH_PAL_DEFAULT MATCHES "^(posix|minimal)$") message(STATUS "executorch: Using PAL default '${EXECUTORCH_PAL_DEFAULT}'") - list(APPEND _executorch_no_prim_ops__srcs + list(APPEND _executorch_core__srcs "runtime/platform/default/${EXECUTORCH_PAL_DEFAULT}.cpp" ) else() @@ -481,45 +481,48 @@ else() ) endif() -add_library(executorch_no_prim_ops ${_executorch_no_prim_ops__srcs}) -target_link_libraries(executorch_no_prim_ops PRIVATE program_schema) +add_library(executorch_core ${_executorch_core__srcs}) +# Legacy name - deprecated. +add_library(executorch_no_prim_ops ALIAS executorch_core) + +target_link_libraries(executorch_core PRIVATE program_schema) if(EXECUTORCH_USE_DL) # Check if dl exists for this toolchain and only then link it. find_library(DL_LIBRARY_EXISTS NAMES dl) # Check if the library was found if(DL_LIBRARY_EXISTS) - target_link_libraries(executorch_no_prim_ops PRIVATE dl) # For dladdr() + target_link_libraries(executorch_core PRIVATE dl) # For dladdr() endif() endif() target_include_directories( - executorch_no_prim_ops PUBLIC ${_common_include_directories} + executorch_core PUBLIC ${_common_include_directories} ) -target_compile_options(executorch_no_prim_ops PUBLIC ${_common_compile_options}) +target_compile_options(executorch_core PUBLIC ${_common_compile_options}) if(MAX_KERNEL_NUM) target_compile_definitions( - executorch_no_prim_ops PRIVATE MAX_KERNEL_NUM=${MAX_KERNEL_NUM} + executorch_core PRIVATE MAX_KERNEL_NUM=${MAX_KERNEL_NUM} ) endif() if(EXECUTORCH_BUILD_PYBIND AND APPLE) # shared version add_library( - executorch_no_prim_ops_shared SHARED ${_executorch_no_prim_ops__srcs} + executorch_core_shared SHARED ${_executorch_core__srcs} ) - target_link_libraries(executorch_no_prim_ops_shared PRIVATE program_schema) + target_link_libraries(executorch_core_shared PRIVATE program_schema) if(DL_LIBRARY_EXISTS) # For dladdr() - target_link_libraries(executorch_no_prim_ops_shared PRIVATE dl) + target_link_libraries(executorch_core_shared PRIVATE dl) endif() target_include_directories( - executorch_no_prim_ops_shared PUBLIC ${_common_include_directories} + executorch_core_shared PUBLIC ${_common_include_directories} ) target_compile_options( - executorch_no_prim_ops_shared PUBLIC ${_common_compile_options} + executorch_core_shared PUBLIC ${_common_compile_options} ) if(MAX_KERNEL_NUM) target_compile_definitions( - executorch_no_prim_ops_shared PRIVATE MAX_KERNEL_NUM=${MAX_KERNEL_NUM} + executorch_core_shared PRIVATE MAX_KERNEL_NUM=${MAX_KERNEL_NUM} ) endif() endif() @@ -532,7 +535,7 @@ endif() # any backends. # add_library(executorch ${_executorch__srcs}) -target_link_libraries(executorch PRIVATE executorch_no_prim_ops) +target_link_libraries(executorch PRIVATE executorch_core) target_include_directories(executorch PUBLIC ${_common_include_directories}) target_compile_options(executorch PUBLIC ${_common_compile_options}) target_link_options_shared_lib(executorch) @@ -568,7 +571,7 @@ endif() # Install `executorch` library as well as `executorch-config.cmake` under # ${CMAKE_INSTALL_PREFIX}/ install( - TARGETS executorch executorch_no_prim_ops + TARGETS executorch executorch_core DESTINATION lib INCLUDES DESTINATION ${_common_include_directories} diff --git a/backends/apple/coreml/CMakeLists.txt b/backends/apple/coreml/CMakeLists.txt index 27e09b3f581..ca92f900f30 100644 --- a/backends/apple/coreml/CMakeLists.txt +++ b/backends/apple/coreml/CMakeLists.txt @@ -112,34 +112,36 @@ set(PROTOBUF_SOURCES ) # Define the delegate library -add_library(coremldelegate) +add_library(coreml_backend) +# Preserve old name for backwards compatability +add_library(coremldelegate ALIAS coreml_backend) target_sources( - coremldelegate PRIVATE ${INMEMORYFS_SOURCES} ${KVSTORE_SOURCES} + coreml_backend PRIVATE ${INMEMORYFS_SOURCES} ${KVSTORE_SOURCES} ${DELEGATE_SOURCES} ${UTIL_SOURCES} ) target_include_directories( - coremldelegate PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/runtime/include + coreml_backend PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/runtime/include ) target_include_directories( - coremldelegate PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/runtime/kvstore + coreml_backend PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/runtime/kvstore ) target_include_directories( - coremldelegate PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/runtime/inmemoryfs + coreml_backend PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/runtime/inmemoryfs ) target_include_directories( - coremldelegate PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/runtime/delegate + coreml_backend PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/runtime/delegate ) target_include_directories( - coremldelegate PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/runtime/util + coreml_backend PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/runtime/util ) -target_include_directories(coremldelegate PRIVATE ${EXECUTORCH_ROOT}/..) -target_link_libraries(coremldelegate PRIVATE executorch_no_prim_ops) +target_include_directories(coreml_backend PRIVATE ${EXECUTORCH_ROOT}/..) +target_link_libraries(coreml_backend PRIVATE executorch_core) if(EXECUTORCH_BUILD_DEVTOOLS) - target_sources(coremldelegate PRIVATE ${SDK_SOURCES} ${PROTOBUF_SOURCES}) + target_sources(coreml_backend PRIVATE ${SDK_SOURCES} ${PROTOBUF_SOURCES}) target_include_directories( - coremldelegate + coreml_backend PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/runtime/sdk ${CMAKE_CURRENT_SOURCE_DIR}/third-party/coremltools/deps/protobuf/src @@ -149,7 +151,7 @@ if(EXECUTORCH_BUILD_DEVTOOLS) ) target_link_options_shared_lib(libprotobuf-lite) - target_link_libraries(coremldelegate PRIVATE libprotobuf-lite) + target_link_libraries(coreml_backend PRIVATE libprotobuf-lite) endif() find_library(ACCELERATE_FRAMEWORK Accelerate) @@ -158,46 +160,46 @@ find_library(FOUNDATION_FRAMEWORK Foundation) find_library(SQLITE_LIBRARY sqlite3) target_link_libraries( - coremldelegate - PRIVATE executorch_no_prim_ops ${ACCELERATE_FRAMEWORK} ${COREML_FRAMEWORK} + coreml_backend + PRIVATE executorch_core ${ACCELERATE_FRAMEWORK} ${COREML_FRAMEWORK} ${FOUNDATION_FRAMEWORK} ${SQLITE_LIBRARY} ) -target_link_options_shared_lib(coremldelegate) +target_link_options_shared_lib(coreml_backend) if(COREML_BUILD_EXECUTOR_RUNNER) target_link_libraries( - coremldelegate PRIVATE portable_ops_lib portable_kernels + coreml_backend PRIVATE portable_ops_lib portable_kernels ) endif() -target_compile_options(coremldelegate PRIVATE "-fobjc-arc") -target_compile_options(coremldelegate PRIVATE "-fno-exceptions") +target_compile_options(coreml_backend PRIVATE "-fobjc-arc") +target_compile_options(coreml_backend PRIVATE "-fno-exceptions") if(EXECUTORCH_BUILD_DEVTOOLS) target_compile_options( - executorch_no_prim_ops PUBLIC -DET_EVENT_TRACER_ENABLED + executorch_core PUBLIC -DET_EVENT_TRACER_ENABLED ) - target_compile_options(coremldelegate PRIVATE "-frtti") + target_compile_options(coreml_backend PRIVATE "-frtti") target_compile_options(libprotobuf-lite PRIVATE "-frtti") else() - target_compile_options(coremldelegate PRIVATE "-fno-rtti") + target_compile_options(coreml_backend PRIVATE "-fno-rtti") endif() -set(TARGET coremldelegate APPEND_STRING PROPERTY COMPILE_FLAGS +set(TARGET coreml_backend APPEND_STRING PROPERTY COMPILE_FLAGS "-x objective-c++" ) -set(TARGET coremldelegate APPEND_STRING PROPERTY COMPILE_FLAGS +set(TARGET coreml_backend APPEND_STRING PROPERTY COMPILE_FLAGS "-Wno-null-character" ) -set(TARGET coremldelegate APPEND_STRING PROPERTY COMPILE_FLAGS +set(TARGET coreml_backend APPEND_STRING PROPERTY COMPILE_FLAGS "-Wno-receiver-expr" ) install( - TARGETS coremldelegate + TARGETS coreml_backend DESTINATION lib INCLUDES DESTINATION ${_common_include_directories} diff --git a/backends/apple/coreml/README.md b/backends/apple/coreml/README.md index 05b56e9c788..e660b412629 100644 --- a/backends/apple/coreml/README.md +++ b/backends/apple/coreml/README.md @@ -119,9 +119,9 @@ The `converted_graph` is the quantized torch model, and can be delegated to **Co ## Runtime -To execute a Core ML delegated program, the application must link to the `coremldelegate` library. Once linked there are no additional steps required, ExecuTorch when running the program would call the Core ML runtime to execute the Core ML delegated part of the program. +To execute a Core ML delegated program, the application must link to the `coreml_backend` library. Once linked there are no additional steps required, ExecuTorch when running the program would call the Core ML runtime to execute the Core ML delegated part of the program. -Please follow the instructions described in the [Core ML setup](/backends/apple/coreml/setup.md) to link the `coremldelegate` library. +Please follow the instructions described in the [Core ML setup](/backends/apple/coreml/setup.md) to link the `coreml_backend` library. ## Help & Improvements If you have problems or questions or have suggestions for ways to make diff --git a/backends/apple/coreml/runtime/workspace/executorchcoreml.xcodeproj/project.pbxproj b/backends/apple/coreml/runtime/workspace/executorchcoreml.xcodeproj/project.pbxproj index 2daa5615ba9..1cb29d7c962 100644 --- a/backends/apple/coreml/runtime/workspace/executorchcoreml.xcodeproj/project.pbxproj +++ b/backends/apple/coreml/runtime/workspace/executorchcoreml.xcodeproj/project.pbxproj @@ -105,7 +105,7 @@ C9E7D7962AB3F9BF00CCAE5D /* KeyValueStoreTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = C9E7D78E2AB3F9BF00CCAE5D /* KeyValueStoreTests.mm */; }; C9E7D7A22AB3FBB200CCAE5D /* CoreMLBackendDelegateTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = C9E7D7A12AB3FBB200CCAE5D /* CoreMLBackendDelegateTests.mm */; }; C9EC7E1B2BC73B3200A6B166 /* MultiArrayTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = C9EC7E1A2BC73B3200A6B166 /* MultiArrayTests.mm */; }; - F24817E52BC655E100E80D98 /* libexecutorch_no_prim_ops.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F24817E42BC655E100E80D98 /* libexecutorch_no_prim_ops.a */; }; + F24817E52BC655E100E80D98 /* libexecutorch_core.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F24817E42BC655E100E80D98 /* libexecutorch_core.a */; }; /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -310,7 +310,7 @@ C9EA3FE52B73EF6300B7D7BD /* Accelerate.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Accelerate.framework; path = System/Library/Frameworks/Accelerate.framework; sourceTree = SDKROOT; }; C9EC7E092BC662A300A6B166 /* objc_array_util.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = objc_array_util.h; path = ../util/objc_array_util.h; sourceTree = ""; }; C9EC7E1A2BC73B3200A6B166 /* MultiArrayTests.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = MultiArrayTests.mm; path = ../test/MultiArrayTests.mm; sourceTree = ""; }; - F24817E42BC655E100E80D98 /* libexecutorch_no_prim_ops.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libexecutorch_no_prim_ops.a; path = ../libraries/libexecutorch_no_prim_ops.a; sourceTree = ""; }; + F24817E42BC655E100E80D98 /* libexecutorch_core.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libexecutorch_core.a; path = ../libraries/libexecutorch_core.a; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -319,7 +319,7 @@ buildActionMask = 2147483647; files = ( C94D510F2ABDF87500AF47FD /* Accelerate.framework in Frameworks */, - F24817E52BC655E100E80D98 /* libexecutorch_no_prim_ops.a in Frameworks */, + F24817E52BC655E100E80D98 /* libexecutorch_core.a in Frameworks */, C94D510E2ABDF86800AF47FD /* libsqlite3.tbd in Frameworks */, C94D50D92ABD7B2400AF47FD /* CoreML.framework in Frameworks */, C99883862B95AD7D000953A3 /* libprotobuf-lite.a in Frameworks */, @@ -540,7 +540,7 @@ C96560942AABFDCE005F8126 /* libsqlite3.tbd */, C96560922AABF992005F8126 /* CoreML.framework */, C96560902AABF982005F8126 /* Accelerate.framework */, - F24817E42BC655E100E80D98 /* libexecutorch_no_prim_ops.a */, + F24817E42BC655E100E80D98 /* libexecutorch_core.a */, C965608D2AABF72A005F8126 /* libexecutorch.a */, ); name = "Recovered References"; diff --git a/backends/apple/coreml/scripts/build_tests.sh b/backends/apple/coreml/scripts/build_tests.sh index 911c6cd4e10..5fbde6ac66f 100755 --- a/backends/apple/coreml/scripts/build_tests.sh +++ b/backends/apple/coreml/scripts/build_tests.sh @@ -59,7 +59,7 @@ cmake --build "$CMAKE_PROTOBUF_BUILD_DIR_PATH" -j9 -t libprotobuf-lite echo "ExecuTorch: Copying libraries" mkdir "$LIBRARIES_DIR_PATH" cp -f "$CMAKE_EXECUTORCH_BUILD_DIR_PATH/libexecutorch.a" "$LIBRARIES_DIR_PATH" -cp -f "$CMAKE_EXECUTORCH_BUILD_DIR_PATH/libexecutorch_no_prim_ops.a" "$LIBRARIES_DIR_PATH" +cp -f "$CMAKE_EXECUTORCH_BUILD_DIR_PATH/libexecutorch_core.a" "$LIBRARIES_DIR_PATH" cp -f "$CMAKE_PROTOBUF_BUILD_DIR_PATH/libprotobuf-lite.a" "$LIBRARIES_DIR_PATH" #Copy ExecuTorch headers diff --git a/backends/apple/mps/CMakeLists.txt b/backends/apple/mps/CMakeLists.txt index f47139a0000..b5d8e19a3b0 100644 --- a/backends/apple/mps/CMakeLists.txt +++ b/backends/apple/mps/CMakeLists.txt @@ -64,7 +64,8 @@ target_include_directories( ) list(TRANSFORM _mps_backend__srcs PREPEND "${EXECUTORCH_ROOT}/") -add_library(mpsdelegate ${_mps_backend__srcs}) +add_library(mps_backend ${_mps_backend__srcs}) +add_library(mpsdelegate ALIAS mps_backend) find_library(FOUNDATION_FRAMEWORK Foundation) find_library(METAL_FRAMEWORK Metal) @@ -72,22 +73,22 @@ find_library(MPS_FRAMEWORK MetalPerformanceShaders) find_library(MPS_GRAPH_FRAMEWORK MetalPerformanceShadersGraph) target_link_libraries( - mpsdelegate + mps_backend PRIVATE bundled_program mps_schema - executorch_no_prim_ops + executorch_core ${FOUNDATION_FRAMEWORK} ${METAL_FRAMEWORK} ${MPS_FRAMEWORK} ${MPS_GRAPH_FRAMEWORK} ) -target_link_options_shared_lib(mpsdelegate) -target_compile_options(mpsdelegate PUBLIC ${_common_compile_options}) -target_compile_options(mpsdelegate PRIVATE "-fno-objc-arc") +target_link_options_shared_lib(mps_backend) +target_compile_options(mps_backend PUBLIC ${_common_compile_options}) +target_compile_options(mps_backend PRIVATE "-fno-objc-arc") install( - TARGETS mpsdelegate + TARGETS mps_backend DESTINATION lib INCLUDES DESTINATION ${_common_include_directories} diff --git a/backends/arm/CMakeLists.txt b/backends/arm/CMakeLists.txt index 2b7be537ceb..80515473ccf 100644 --- a/backends/arm/CMakeLists.txt +++ b/backends/arm/CMakeLists.txt @@ -26,10 +26,11 @@ set(_arm_baremetal_sources backends/arm/runtime/ArmBackendEthosU.cpp ) list(TRANSFORM _arm_baremetal_sources PREPEND "${EXECUTORCH_ROOT}/") -add_library(executorch_delegate_ethos_u STATIC ${_arm_baremetal_sources}) +add_library(ethos_u_backend STATIC ${_arm_baremetal_sources}) +add_library(executorch_delegate_ethos_u ALIAS ethos_u_backend) target_include_directories( - executorch_delegate_ethos_u PUBLIC ${_common_include_directories} + ethos_u_backend PUBLIC ${_common_include_directories} ) target_include_directories( - executorch_delegate_ethos_u PUBLIC ${DRIVER_ETHOSU_INCLUDE_DIR} + ethos_u_backend PUBLIC ${DRIVER_ETHOSU_INCLUDE_DIR} ) diff --git a/backends/mediatek/CMakeLists.txt b/backends/mediatek/CMakeLists.txt index 744b1193d5a..f12834c2297 100644 --- a/backends/mediatek/CMakeLists.txt +++ b/backends/mediatek/CMakeLists.txt @@ -27,7 +27,7 @@ include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/runtime/include) add_library(neuron_backend SHARED) target_link_libraries(neuron_backend PRIVATE - executorch_no_prim_ops + executorch_core portable_ops_lib android log diff --git a/backends/qualcomm/CMakeLists.txt b/backends/qualcomm/CMakeLists.txt index 3b2644bf4b1..70ccad8b270 100644 --- a/backends/qualcomm/CMakeLists.txt +++ b/backends/qualcomm/CMakeLists.txt @@ -181,7 +181,7 @@ target_link_libraries( ) target_link_libraries( qnn_executorch_backend PRIVATE qnn_executorch_header qnn_schema qnn_manager - executorch_no_prim_ops qcir_utils + executorch_core qcir_utils ) set_target_properties( qnn_executorch_backend PROPERTIES LINK_FLAGS "-Wl,-rpath='$ORIGIN'" diff --git a/backends/xnnpack/CMakeLists.txt b/backends/xnnpack/CMakeLists.txt index 98870bf0e11..d800806475a 100644 --- a/backends/xnnpack/CMakeLists.txt +++ b/backends/xnnpack/CMakeLists.txt @@ -93,7 +93,7 @@ include(cmake/Dependencies.cmake) list(TRANSFORM _xnnpack_backend__srcs PREPEND "${EXECUTORCH_ROOT}/") add_library(xnnpack_backend STATIC ${_xnnpack_backend__srcs}) target_link_libraries( - xnnpack_backend PRIVATE ${xnnpack_third_party} executorch_no_prim_ops + xnnpack_backend PRIVATE ${xnnpack_third_party} executorch_core xnnpack_schema ) diff --git a/build/Codegen.cmake b/build/Codegen.cmake index 381cd0958fd..435b3d24802 100644 --- a/build/Codegen.cmake +++ b/build/Codegen.cmake @@ -154,7 +154,7 @@ function(gen_custom_ops_aot_lib) if(TARGET portable_lib) target_link_libraries(${GEN_LIB_NAME} PRIVATE portable_lib) else() - target_link_libraries(${GEN_LIB_NAME} PRIVATE executorch_no_prim_ops) + target_link_libraries(${GEN_LIB_NAME} PRIVATE executorch_core) endif() endfunction() diff --git a/build/build_apple_frameworks.sh b/build/build_apple_frameworks.sh index 348111e2b4c..4acafcb45b1 100755 --- a/build/build_apple_frameworks.sh +++ b/build/build_apple_frameworks.sh @@ -29,7 +29,7 @@ PLATFORM_TARGET=("17.0" "17.0" "10.15") FRAMEWORK_EXECUTORCH="executorch:\ libexecutorch.a,\ -libexecutorch_no_prim_ops.a,\ +libexecutorch_core.a,\ libextension_apple.a,\ libextension_data_loader.a,\ libextension_module.a,\ @@ -37,11 +37,11 @@ libextension_tensor.a,\ :$HEADERS_PATH" FRAMEWORK_BACKEND_COREML="backend_coreml:\ -libcoremldelegate.a,\ +libcoreml_backend.a,\ :" FRAMEWORK_BACKEND_MPS="backend_mps:\ -libmpsdelegate.a,\ +libmps_backend.a,\ :" FRAMEWORK_BACKEND_XNNPACK="backend_xnnpack:\ diff --git a/build/cmake_deps.toml b/build/cmake_deps.toml index 1430ea3a9ef..2a9d47e56ce 100644 --- a/build/cmake_deps.toml +++ b/build/cmake_deps.toml @@ -20,14 +20,14 @@ buck_targets = [ "//runtime/executor:program", ] deps = [ - "executorch_no_prim_ops", + "executorch_core", ] filters = [ ".cpp$", ] -[targets.executorch_no_prim_ops] +[targets.executorch_core] buck_targets = [ "//runtime/executor:program_no_prim_ops", ] @@ -55,7 +55,7 @@ excludes = [ ] deps = [ "executorch", - "executorch_no_prim_ops", + "executorch_core", ] [targets.optimized_kernels] @@ -72,7 +72,7 @@ excludes = [ ] deps = [ "executorch", - "executorch_no_prim_ops", + "executorch_core", "portable_kernels", ] @@ -90,7 +90,7 @@ excludes = [ ] deps = [ "executorch", - "executorch_no_prim_ops", + "executorch_core", "portable_kernels", ] @@ -112,7 +112,7 @@ filters = [ excludes = [ ] deps = [ - "executorch_no_prim_ops", + "executorch_core", "executorch", ] @@ -126,7 +126,7 @@ filters = [ excludes = [ ] deps = [ - "executorch_no_prim_ops", + "executorch_core", "executorch", "portable_kernels", ] @@ -143,7 +143,7 @@ filters = [ ".cpp$", ] deps = [ - "executorch_no_prim_ops", + "executorch_core", "executorch", ] @@ -156,7 +156,7 @@ filters = [ ] deps = [ "executorch", - "executorch_no_prim_ops", + "executorch_core", "extension_data_loader", ] @@ -169,7 +169,7 @@ filters = [ ] deps = [ "executorch", - "executorch_no_prim_ops", + "executorch_core", ] [targets.extension_llm_runner] @@ -181,7 +181,7 @@ filters = [ ] deps = [ "executorch", - "executorch_no_prim_ops", + "executorch_core", "extension_module", "extension_runner_util", ] @@ -195,7 +195,7 @@ filters = [ ] deps = [ "executorch", - "executorch_no_prim_ops", + "executorch_core", ] # ---------------------------------- extension end ---------------------------------- # ---------------------------------- binary start ---------------------------------- @@ -212,7 +212,7 @@ excludes = [ ] deps = [ "executorch", - "executorch_no_prim_ops", + "executorch_core", "portable_kernels", "quantized_kernels", ] @@ -228,7 +228,7 @@ excludes = [ "^codegen", ] deps = [ - "executorch_no_prim_ops", + "executorch_core", "executorch", ] # ---------------------------------- binary end ---------------------------------- @@ -245,7 +245,7 @@ excludes = [ ] deps = [ "executorch", - "executorch_no_prim_ops", + "executorch_core", "portable_kernels", ] @@ -258,7 +258,7 @@ filters = [ ] deps = [ "executorch", - "executorch_no_prim_ops", + "executorch_core", ] [targets.mps_schema] @@ -284,7 +284,7 @@ excludes = [ ] deps = [ "executorch", - "executorch_no_prim_ops", + "executorch_core", "xnnpack_backend", "portable_kernels", ] @@ -298,7 +298,7 @@ filters = [ ] deps = [ "executorch", - "executorch_no_prim_ops", + "executorch_core", ] [targets.xnnpack_schema] @@ -331,7 +331,7 @@ excludes = [ ] deps = [ "executorch", - "executorch_no_prim_ops", + "executorch_core", "optimized_kernels", "xnnpack_backend", ] @@ -349,7 +349,7 @@ excludes = [ deps = [ "custom_ops", "executorch", - "executorch_no_prim_ops", + "executorch_core", "extension_data_loader", "extension_module", "portable_kernels", diff --git a/build/executorch-config.cmake b/build/executorch-config.cmake index 4376c9e5e77..905440a0a86 100644 --- a/build/executorch-config.cmake +++ b/build/executorch-config.cmake @@ -13,7 +13,7 @@ cmake_minimum_required(VERSION 3.19) set(_root "${CMAKE_CURRENT_LIST_DIR}/../..") -set(required_lib_list executorch executorch_no_prim_ops portable_kernels) +set(required_lib_list executorch executorch_core portable_kernels) foreach(lib ${required_lib_list}) set(lib_var "LIB_${lib}") add_library(${lib} STATIC IMPORTED) @@ -26,7 +26,7 @@ foreach(lib ${required_lib_list}) target_include_directories(${lib} INTERFACE ${_root}) endforeach() -target_link_libraries(executorch INTERFACE executorch_no_prim_ops) +target_link_libraries(executorch INTERFACE executorch_core) if(CMAKE_BUILD_TYPE MATCHES "Debug") set(FLATCCRT_LIB flatccrt_d) @@ -39,8 +39,8 @@ set(lib_list bundled_program extension_data_loader ${FLATCCRT_LIB} - coremldelegate - mpsdelegate + coreml_backend + mps_backend qnn_executorch_backend portable_ops_lib extension_module @@ -86,3 +86,12 @@ foreach(lib ${lib_list}) target_include_directories(${lib} INTERFACE ${_root}) endif() endforeach() + +# Legacy target names. +add_library(executorch_no_prim_ops ALIAS executorch_core) +if(TARGET coreml_backend) + add_library(coremldelegate ALIAS coreml_backend) +endif() +if(TARGET mps_backend) + add_library(mpsdelegate ALIAS mps_backend) +endif() diff --git a/examples/apple/coreml/executor_runner/coreml_executor_runner.xcodeproj/project.pbxproj b/examples/apple/coreml/executor_runner/coreml_executor_runner.xcodeproj/project.pbxproj index 16e9e590027..b5a1b44301c 100644 --- a/examples/apple/coreml/executor_runner/coreml_executor_runner.xcodeproj/project.pbxproj +++ b/examples/apple/coreml/executor_runner/coreml_executor_runner.xcodeproj/project.pbxproj @@ -14,11 +14,11 @@ C94D51622ACFCBBA00AF47FD /* libsqlite3.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = C94D51612ACFCBBA00AF47FD /* libsqlite3.tbd */; }; C94D51642ACFCBC500AF47FD /* CoreML.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C94D51632ACFCBC500AF47FD /* CoreML.framework */; }; C94D51662ACFCBCB00AF47FD /* Accelerate.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C94D51652ACFCBCB00AF47FD /* Accelerate.framework */; }; - C94D51682ACFCC7100AF47FD /* libcoremldelegate.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C94D51672ACFCC7100AF47FD /* libcoremldelegate.a */; }; + C94D51682ACFCC7100AF47FD /* libcoreml_backend.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C94D51672ACFCC7100AF47FD /* libcoreml_backend.a */; }; C97BFFA42BC0C17300F55BAC /* libportable_kernels.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C97BFFA32BC0C17300F55BAC /* libportable_kernels.a */; }; C97BFFA62BC0C1F200F55BAC /* libportable_ops_lib.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C97BFFA52BC0C1F200F55BAC /* libportable_ops_lib.a */; }; C988D69D2B998CDE00979CF6 /* libprotobuf-lite.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C988D69C2B998CD700979CF6 /* libprotobuf-lite.a */; }; - F24817E72BC65B2000E80D98 /* libexecutorch_no_prim_ops.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F24817E62BC65B2000E80D98 /* libexecutorch_no_prim_ops.a */; }; + F24817E72BC65B2000E80D98 /* executorch_core.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F24817E62BC65B2000E80D98 /* executorch_core.a */; }; /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -42,11 +42,11 @@ C94D51612ACFCBBA00AF47FD /* libsqlite3.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libsqlite3.tbd; path = usr/lib/libsqlite3.tbd; sourceTree = SDKROOT; }; C94D51632ACFCBC500AF47FD /* CoreML.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreML.framework; path = System/Library/Frameworks/CoreML.framework; sourceTree = SDKROOT; }; C94D51652ACFCBCB00AF47FD /* Accelerate.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Accelerate.framework; path = System/Library/Frameworks/Accelerate.framework; sourceTree = SDKROOT; }; - C94D51672ACFCC7100AF47FD /* libcoremldelegate.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libcoremldelegate.a; path = libraries/libcoremldelegate.a; sourceTree = ""; }; + C94D51672ACFCC7100AF47FD /* libcoreml_backend.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libcoreml_backend.a; path = libraries/libcoreml_backend.a; sourceTree = ""; }; C97BFFA32BC0C17300F55BAC /* libportable_kernels.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libportable_kernels.a; path = libraries/libportable_kernels.a; sourceTree = ""; }; C97BFFA52BC0C1F200F55BAC /* libportable_ops_lib.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libportable_ops_lib.a; path = libraries/libportable_ops_lib.a; sourceTree = ""; }; C988D69C2B998CD700979CF6 /* libprotobuf-lite.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = "libprotobuf-lite.a"; path = "libraries/libprotobuf-lite.a"; sourceTree = ""; }; - F24817E62BC65B2000E80D98 /* libexecutorch_no_prim_ops.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libexecutorch_no_prim_ops.a; path = libraries/libexecutorch_no_prim_ops.a; sourceTree = ""; }; + F24817E62BC65B2000E80D98 /* executorch_core.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = executorch_core.a; path = libraries/executorch_core.a; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -55,9 +55,9 @@ buildActionMask = 2147483647; files = ( 38626BB52B225A890059413D /* libetdump.a in Frameworks */, - F24817E72BC65B2000E80D98 /* libexecutorch_no_prim_ops.a in Frameworks */, + F24817E72BC65B2000E80D98 /* executorch_core.a in Frameworks */, 38626BB42B225A560059413D /* libflatccrt.a in Frameworks */, - C94D51682ACFCC7100AF47FD /* libcoremldelegate.a in Frameworks */, + C94D51682ACFCC7100AF47FD /* libcoreml_backend.a in Frameworks */, C94D51662ACFCBCB00AF47FD /* Accelerate.framework in Frameworks */, C988D69D2B998CDE00979CF6 /* libprotobuf-lite.a in Frameworks */, C97BFFA62BC0C1F200F55BAC /* libportable_ops_lib.a in Frameworks */, @@ -98,8 +98,8 @@ C94D51632ACFCBC500AF47FD /* CoreML.framework */, C94D515C2ACFCBA000AF47FD /* libexecutorch.a */, C94D51612ACFCBBA00AF47FD /* libsqlite3.tbd */, - C94D51672ACFCC7100AF47FD /* libcoremldelegate.a */, - F24817E62BC65B2000E80D98 /* libexecutorch_no_prim_ops.a */, + C94D51672ACFCC7100AF47FD /* libcoreml_backend.a */, + F24817E62BC65B2000E80D98 /* executorch_core.a */, C97BFFA32BC0C17300F55BAC /* libportable_kernels.a */, C97BFFA52BC0C1F200F55BAC /* libportable_ops_lib.a */, ); diff --git a/examples/apple/coreml/executor_runner/coreml_executor_runner.xcodeproj/xcshareddata/xcschemes/coreml_executor_runner.xcscheme b/examples/apple/coreml/executor_runner/coreml_executor_runner.xcodeproj/xcshareddata/xcschemes/coreml_executor_runner.xcscheme index 40b8d753943..4482663a89b 100644 --- a/examples/apple/coreml/executor_runner/coreml_executor_runner.xcodeproj/xcshareddata/xcschemes/coreml_executor_runner.xcscheme +++ b/examples/apple/coreml/executor_runner/coreml_executor_runner.xcodeproj/xcshareddata/xcschemes/coreml_executor_runner.xcscheme @@ -40,7 +40,6 @@ debugDocumentVersioning = "YES" debugServiceExtension = "internal" allowLocationSimulation = "YES" - internalIOSLaunchStyle = "3" viewDebuggingEnabled = "No"> diff --git a/examples/apple/coreml/scripts/build_executor_runner.sh b/examples/apple/coreml/scripts/build_executor_runner.sh index 89cd45ea6b1..9d20f289bf6 100755 --- a/examples/apple/coreml/scripts/build_executor_runner.sh +++ b/examples/apple/coreml/scripts/build_executor_runner.sh @@ -63,7 +63,7 @@ cp -rf "$COREML_DIR_PATH/runtime/include/" "$INCLUDE_DIR_PATH" echo "ExecuTorch: Copying libraries" mkdir "$LIBRARIES_DIR_PATH" find "$CMAKE_BUILD_DIR_PATH/" -name 'libexecutorch.a' -exec cp -f "{}" "$LIBRARIES_DIR_PATH/libexecutorch.a" \; -find "$CMAKE_BUILD_DIR_PATH/" -name 'libexecutorch_no_prim_ops.a' -exec cp -f "{}" "$LIBRARIES_DIR_PATH/libexecutorch_no_prim_ops.a" \; +find "$CMAKE_BUILD_DIR_PATH/" -name 'libexecutorch_core.a' -exec cp -f "{}" "$LIBRARIES_DIR_PATH/libexecutorch_core.a" \; find "$CMAKE_BUILD_DIR_PATH/" -name 'libprotobuf-lite.a' -exec cp -f "{}" "$LIBRARIES_DIR_PATH/libprotobuf-lite.a" \; find "$CMAKE_BUILD_DIR_PATH/" -name 'libprotobuf-lited.a' -exec cp -f "{}" "$LIBRARIES_DIR_PATH/libprotobuf-lite.a" \; find "$CMAKE_BUILD_DIR_PATH/" -name 'libetdump.a' -exec cp -f "{}" "$LIBRARIES_DIR_PATH/libetdump.a" \; diff --git a/examples/arm/executor_runner/CMakeLists.txt b/examples/arm/executor_runner/CMakeLists.txt index 68c5435dffe..9eeb4475b05 100644 --- a/examples/arm/executor_runner/CMakeLists.txt +++ b/examples/arm/executor_runner/CMakeLists.txt @@ -67,12 +67,12 @@ set_property( "${ET_BUILD_DIR_PATH}/libexecutorch.a" ) -add_library(executorch_no_prim_ops STATIC IMPORTED) +add_library(executorch_core STATIC IMPORTED) set_property( - TARGET executorch_no_prim_ops - PROPERTY IMPORTED_LOCATION "${ET_BUILD_DIR_PATH}/libexecutorch_no_prim_ops.a" + TARGET executorch_core + PROPERTY IMPORTED_LOCATION "${ET_BUILD_DIR_PATH}/libexecutorch_core.a" ) -target_link_libraries(executorch INTERFACE executorch_no_prim_ops) +target_link_libraries(executorch INTERFACE executorch_core) add_library(executorch_delegate_ethos_u STATIC IMPORTED) set_property( diff --git a/examples/qualcomm/qaihub_scripts/llama/CMakeLists.txt b/examples/qualcomm/qaihub_scripts/llama/CMakeLists.txt index 6d28976a57a..947b3ef975c 100644 --- a/examples/qualcomm/qaihub_scripts/llama/CMakeLists.txt +++ b/examples/qualcomm/qaihub_scripts/llama/CMakeLists.txt @@ -32,7 +32,7 @@ target_include_directories( target_link_libraries( qaihub_llama2_7b_runner qnn_executorch_backend - executorch_no_prim_ops + executorch_core extension_data_loader extension_module extension_tensor @@ -90,7 +90,7 @@ target_include_directories( target_link_libraries( qaihub_llama3_8b_runner qnn_executorch_backend - executorch_no_prim_ops + executorch_core extension_data_loader extension_module extension_tensor diff --git a/examples/qualcomm/qaihub_scripts/stable_diffusion/CMakeLists.txt b/examples/qualcomm/qaihub_scripts/stable_diffusion/CMakeLists.txt index 8a2e69b3748..ff22f08cd09 100644 --- a/examples/qualcomm/qaihub_scripts/stable_diffusion/CMakeLists.txt +++ b/examples/qualcomm/qaihub_scripts/stable_diffusion/CMakeLists.txt @@ -21,7 +21,7 @@ target_include_directories( target_link_libraries( qaihub_stable_diffusion_runner qnn_executorch_backend - executorch_no_prim_ops + executorch_core extension_data_loader extension_module extension_tensor diff --git a/exir/backend/test/demos/rpc/CMakeLists.txt b/exir/backend/test/demos/rpc/CMakeLists.txt index cd1b6e73ff2..d3722e830d4 100644 --- a/exir/backend/test/demos/rpc/CMakeLists.txt +++ b/exir/backend/test/demos/rpc/CMakeLists.txt @@ -29,7 +29,7 @@ set(_common_compile_options -Wno-deprecated-declarations -fPIC) add_library( executor_backend STATIC ExecutorBackendRegister.cpp ExecutorBackend.cpp ) -target_link_libraries(executor_backend PRIVATE executorch_no_prim_ops) +target_link_libraries(executor_backend PRIVATE executorch_core) target_include_directories( executor_backend PUBLIC ${_common_include_directories} diff --git a/extension/llm/custom_ops/CMakeLists.txt b/extension/llm/custom_ops/CMakeLists.txt index 723444498a4..5d5537b79fe 100644 --- a/extension/llm/custom_ops/CMakeLists.txt +++ b/extension/llm/custom_ops/CMakeLists.txt @@ -60,7 +60,7 @@ target_include_directories( custom_ops PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/../../../include" ) target_link_libraries( - custom_ops PUBLIC ${custom_ops_libs} executorch_no_prim_ops + custom_ops PUBLIC ${custom_ops_libs} executorch_core ) target_compile_options( @@ -90,7 +90,7 @@ if(EXECUTORCH_BUILD_KERNELS_CUSTOM_AOT) else() # If no portable_lib, custom_ops_aot_lib still gives the ability to use the # ops in PyTorch - target_link_libraries(custom_ops_aot_lib PUBLIC executorch_no_prim_ops) + target_link_libraries(custom_ops_aot_lib PUBLIC executorch_core) endif() target_link_libraries( diff --git a/extension/tensor/CMakeLists.txt b/extension/tensor/CMakeLists.txt index 2cf1bf2956f..31ee1b7fd4e 100644 --- a/extension/tensor/CMakeLists.txt +++ b/extension/tensor/CMakeLists.txt @@ -18,7 +18,7 @@ endif() list(TRANSFORM _extension_tensor__srcs PREPEND "${EXECUTORCH_ROOT}/") add_library(extension_tensor ${_extension_tensor__srcs}) -target_link_libraries(extension_tensor executorch_no_prim_ops) +target_link_libraries(extension_tensor executorch_core) target_include_directories(extension_tensor PUBLIC ${EXECUTORCH_ROOT}/..) target_compile_options(extension_tensor PUBLIC ${_common_compile_options}) diff --git a/extension/threadpool/CMakeLists.txt b/extension/threadpool/CMakeLists.txt index 281b63b8592..90288656674 100644 --- a/extension/threadpool/CMakeLists.txt +++ b/extension/threadpool/CMakeLists.txt @@ -24,7 +24,7 @@ add_library( extension_threadpool threadpool.cpp threadpool_guard.cpp cpuinfo_utils.cpp ) target_link_libraries( - extension_threadpool PUBLIC executorch_no_prim_ops cpuinfo pthreadpool + extension_threadpool PUBLIC executorch_core cpuinfo pthreadpool ) target_include_directories(extension_threadpool PUBLIC ${EXECUTORCH_ROOT}/..) target_include_directories( diff --git a/kernels/optimized/CMakeLists.txt b/kernels/optimized/CMakeLists.txt index 858e51160e5..2da76c34279 100644 --- a/kernels/optimized/CMakeLists.txt +++ b/kernels/optimized/CMakeLists.txt @@ -42,7 +42,7 @@ endif() # Build cpublas. list(TRANSFORM _optimized_cpublas__srcs PREPEND "${EXECUTORCH_ROOT}/") add_library(cpublas STATIC ${_optimized_cpublas__srcs}) -target_link_libraries(cpublas PRIVATE executorch_no_prim_ops eigen_blas) +target_link_libraries(cpublas PRIVATE executorch_core eigen_blas) target_compile_options(cpublas PUBLIC ${_common_compile_options}) # Generate C++ bindings to register kernels into both PyTorch (for AOT) and @@ -58,7 +58,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_no_prim_ops cpublas) +target_link_libraries(optimized_kernels PRIVATE executorch_core cpublas) target_compile_options(optimized_kernels PUBLIC ${_common_compile_options}) # Build a library for _optimized_kernels_srcs #