Skip to content

Commit a1552b0

Browse files
committed
Fix duplicate ATen kernel registration in macOS executor_runner
The macOS preset enables both EXECUTORCH_BUILD_KERNELS_OPTIMIZED and EXECUTORCH_BUILD_EXECUTOR_RUNNER, so the top-level CMake selects optimized_native_cpu_ops_lib as the runner's ops registration library. coremldelegate is pulled into the runner's link line through executorch_backends and force-loaded, and it was also privately linking portable_ops_lib and portable_kernels whenever EXECUTORCH_COREML_BUILD_EXECUTOR_RUNNER was on. The runner therefore ended up with optimized_native_cpu_ops_lib and portable_ops_lib both registering overlapping ATen kernels at static-init time, aborting before main(). Drop the misplaced portable-kernel link from coremldelegate and remove the now-unused EXECUTORCH_COREML_BUILD_EXECUTOR_RUNNER option. The option never gated building a real CMake runner target; the CoreML executor runner under examples/apple/coreml/executor_runner is an Xcode project, and the build_executor_runner.sh script that drives it stages libportable_ops_lib.a and libportable_kernels.a into examples/apple/coreml/executor_runner/libraries/ where the Xcode project links them directly, independent of libcoremldelegate.a's link list.
1 parent fb420f3 commit a1552b0

3 files changed

Lines changed: 0 additions & 11 deletions

File tree

backends/apple/coreml/CMakeLists.txt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -230,12 +230,6 @@ if(APPLE)
230230

231231
executorch_target_link_options_shared_lib(coremldelegate)
232232

233-
if(EXECUTORCH_COREML_BUILD_EXECUTOR_RUNNER)
234-
target_link_libraries(
235-
coremldelegate PRIVATE portable_ops_lib portable_kernels
236-
)
237-
endif()
238-
239233
target_compile_options(
240234
coremldelegate PRIVATE -fobjc-arc -fno-exceptions -x objective-c++
241235
-Wno-null-character -Wno-receiver-expr

tools/cmake/preset/default.cmake

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -194,10 +194,6 @@ define_overridable_option(
194194
define_overridable_option(
195195
EXECUTORCH_BUILD_VGF "Build the Arm VGF backend" BOOL OFF
196196
)
197-
define_overridable_option(
198-
EXECUTORCH_COREML_BUILD_EXECUTOR_RUNNER "Build CoreML executor runner." BOOL
199-
OFF
200-
)
201197
define_overridable_option(
202198
EXECUTORCH_BUILD_WASM "Build the ExecuTorch JavaScript API" BOOL OFF
203199
)

tools/cmake/preset/macos.cmake

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,3 @@ include(${PROJECT_SOURCE_DIR}/tools/cmake/preset/apple_common.cmake)
99
set_overridable_option(EXECUTORCH_BUILD_EXTENSION_EVALUE_UTIL ON)
1010
set_overridable_option(EXECUTORCH_BUILD_EXTENSION_RUNNER_UTIL ON)
1111
set_overridable_option(EXECUTORCH_BUILD_EXECUTOR_RUNNER ON)
12-
set_overridable_option(EXECUTORCH_COREML_BUILD_EXECUTOR_RUNNER ON)

0 commit comments

Comments
 (0)