Wink Pings

Running scikit-learn on a Mac: SVC predictions are nearly 300× faster, but don’t rush to delete your CPU environment

mlx-learn has released an alpha version that uses MLX and Metal kernels to accelerate classic ML on Apple silicon. The API is compatible with scikit-learn, and SVC prediction is up to 298× faster. First, look at what it solves—and where not to be misled by the multipliers.

Bojan Tunguz has released the alpha version of mlx-learn.

The project’s positioning is straightforward: accelerate classic machine learning algorithms on Apple silicon, using MLX and native Metal kernels under the hood, with an API aligned with scikit-learn and results that match or come close. It does not create a new model framework, nor does it rewrite how sklearn is used.

It initially covers three algorithms: logistic regression, nearest neighbors, and exact support vector classification. The figures Bojan Tunguz gives in the tweet are up to 30× faster training and up to 300× faster inference. SVC shows the most visible gains: with a 2GB kernel cache, training is up to 29.5× faster and prediction up to 298× faster; on three datasets, accuracy matches or is close to scikit-learn.

These multipliers depend on conditions. A 2GB kernel cache, dataset size, and hardware model all affect the results. Treating the maximum as everyday performance will likely lead to disappointment. More worth noting are exact SVC and compatibility with old workflows. For classic ML on a Mac, sklearn is easy to use, but it mostly runs on CPU, and as data gets larger, training and prediction for algorithms like SVC can easily become slow. What mlx-learn does is let these old algorithms run on Apple GPUs while trying not to change usage habits.

Installation is simple:

pip install mlx-learn

There are also two ways to use it. You can import it directly, or add patch_sklearn() to an existing workflow to accelerate supported estimators. The project includes automatic CPU/GPU routing. It is currently alpha, open source, and Apache 2.0.

In replies, Bojan Tunguz said that only a small number of algorithms are accelerated for now, with more on the way. TAAFT Research followed up asking which estimators are planned for porting after the 0.2 batch, showing that people care more about coverage than just one SVC multiplier. Someone in the comments joked that now there is finally a reason to expense a MacBook.

If you repeatedly run SVC or nearest neighbors on a Mac, it is worth trying in a virtual environment. For production, wait. It is alpha, and coverage is limited. Code and benchmarks are on GitHub, with the source at the original tweet.

发布时间: 2026-11-03 01:40