Skip to content

[MLX] Probe the usable Metal compiler in Apple CMake presets #22683

Description

@mergennachin

Problem

The Apple and pybind presets use xcrun -sdk macosx --find metal. On current Xcode releases this can locate a launcher even when the separately installed Metal Toolchain component is unavailable, so configuration enables MLX and fails later during compilation.

The documentation correction is part of #22620. The preset behavior change is intentionally excluded from that documentation-only PR.

Proposed change

Probe xcrun -sdk macosx metal --version in both presets and update the fallback message to point to xcodebuild -downloadComponent MetalToolchain.

Test plan

  • Configure on Apple silicon with Xcode and the Metal Toolchain installed; verify MLX remains enabled.
  • Configure with Xcode but without the Metal Toolchain; verify MLX is disabled cleanly.
  • Run Apple pybind and MLX build CI.

cc @larryliu0820 @GregoryComer @metascroy

Activity

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

Metadata

Metadata

Labels

bugmodule: build/installIssues related to the cmake and buck2 builds, and to installing ExecuTorchmodule: mlxIssues related to MLX Backend: Metal-accelerated inference on Apple Silicon

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions