Toilville fork of ml-explore/mlx-c — carries local Metal-toolchain-compat patches ahead of upstream releases
  • C++ 61.3%
  • C 20.9%
  • Python 16.8%
  • CMake 1%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Peter Swimm 2c3d21045c fix(build): pin mlx to unreleased Metal 4.1 compat fix, patch fft.cpp for FFTNorm
v0.31.1 (mlx-c 0.6.0's tested pairing) doesn't build on Xcode 27 beta's
Metal 4.1 compiler at all -- the steel/gemm kernels (BlockMMA, NAXSubTile)
fail with "must explicitly initialize the member" and address-space
qualifier errors. Bisected to ef5fc0fab27c63e6976e96b07c234c9e2601d8a7,
the minimum main-branch commit ("Fix implicit `thread` address space
qualifier becoming explicit in metal 4.1", 2026-08-04, mlx#3963) that
builds clean -- 168 commits ahead of v0.32.0, which does not include the
fix. No tagged release contains it yet.

Bumping the pin means mlx's fft:: functions now take an FFTNorm
parameter fft.cpp's auto-generated wrappers don't know about -- hand-
patched all 12 to pass FFTNorm::Backward, preserving pre-bump behavior.
Not upstreamable as-is (proper fix is regenerating this file against the
new API), but correct for this internal build.

See ~/.spel/models/mlx-local-runner.spel for the full bisection evidence
and a separate, unrelated GPU-matmul precision caveat this pin does NOT
fix (mitigated at the call sites that need it, not here).
2026-08-12 07:46:31 -07:00
docs version 0.6.0 (#107) 2026-03-19 17:43:53 -07:00
examples array allocator with user-provided buffer and free callback (#94) 2026-01-30 13:03:07 -08:00
mlx/c fix(build): pin mlx to unreleased Metal 4.1 compat fix, patch fft.cpp for FFTNorm 2026-08-12 07:46:31 -07:00
python bump to MLX v0.30.6 (#98) 2026-02-06 13:02:29 -08:00
.clang-format initial layout 2023-12-12 16:16:40 -08:00
.gitignore readme, ignore build dir, install 2024-02-01 21:25:57 -08:00
ACKNOWLEDGMENTS.md Acknowledgements, code of conduct, contributing files. 2024-01-29 15:56:18 -08:00
CMakeLists.txt fix(build): pin mlx to unreleased Metal 4.1 compat fix, patch fft.cpp for FFTNorm 2026-08-12 07:46:31 -07:00
CODE_OF_CONDUCT.md Acknowledgements, code of conduct, contributing files. 2024-01-29 15:56:18 -08:00
CONTRIBUTING.md Acknowledgements, code of conduct, contributing files. 2024-01-29 15:56:18 -08:00
LICENSE Initial commit 2023-12-12 15:50:49 -08:00
mlx-c.pc.in forgot mlx-c.pc.in 2023-12-15 17:35:45 -08:00
README.md doc: use modern CMake invocation (#87) 2026-03-12 11:31:16 -07:00

MLX C

MLX C is a C API for MLX.

MLX is an array framework for machine learning on Apple silicon. MLX C expands MLX to the C language, making research and experimentation easier on Apple silicon.

MLX C can be used standalone or as a bridge to bind other languages to MLX. For example, the MLX Swift package uses MLX C to provide a Swift API to MLX.

For more information see the docs.

Install

CMake is required to build MLX C. You can install it with Homebrew:

brew install cmake

To build, run the following commands:

cmake -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build -j

From the build/ directory, you can run an example that uses MLX C with ./example.

Contributing

Check out the contribution guidelines for more information on contributing to MLX C. See the docs for more information on building from source, and running tests.

We are grateful for all of our contributors. If you contribute to MLX C and wish to be acknowledged, please add your name to the list in your pull request.