Skip to content

[Core ML] Avoid unnecessary portable-kernel linkage from coremldelegate #22684

Description

@mergennachin

Problem

The Core ML CMake target links portable_ops_lib and portable_kernels privately when the standalone runner option is enabled. The standalone Xcode runner already links those archives itself, while other Core ML consumers should not pull in a second operator registry.

A proposed switch from link edges to build dependencies surfaced another requirement: add_dependencies fails when portable operators are disabled unless both targets are guarded. This was found during the source-build validation for #22620 and is intentionally excluded from that documentation-only PR.

Proposed change

Use build-order dependencies instead of private linkage where appropriate, guarded with TARGET portable_ops_lib and TARGET portable_kernels.

Test plan

  • Configure the macOS preset with Core ML enabled and portable operators disabled.
  • Build the Core ML runner configuration with portable operators enabled.
  • Run Core ML model and operator CI.

cc @larryliu0820 @GregoryComer @kimishpatel @YifanShenSZ @cymbalrush @metascroy

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugmodule: build/installIssues related to the cmake and buck2 builds, and to installing ExecuTorchmodule: coremlIssues related to Apple's Core ML delegation and code under backends/apple/coreml/

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions