pytorch / pytorch/executorch

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

Open
#22,683 0 comments 0 reactions 3 assignees View on GitHub

@metascroy is already working on this.

Since Sep 10, 2026.

bug module: build/install module: mlx
Dominant language
Python
Stars
5k
Forks
1.2k
Avg merge
2d 10h
Merged PRs (30d)
581

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.