Practical overview
When it fits
Use it when you need operation-level runtime comparisons across MLX and the documented PyTorch backends, or want to contribute new measurements to the published benchmark tables.
Who it is for
- Developers evaluating MLX operation performance across Apple Silicon devices.
- Practitioners comparing MLX GPU results with PyTorch MPS and CPU measurements.
- Contributors who want to add benchmark results for a device, layer, or operation.
Documented uses
- Measure runtimes for MLX operations on GPU and CPU.
- Compare corresponding PyTorch operations using MPS, CPU, or CUDA backends.
- Review individual experiment timings or averages across repeated experiments.
- Inspect charts comparing chip-level performance and MLX GPU versus PyTorch MPS by operation.
- Submit updated device measurements or extend the benchmark coverage.
Requirements & limits
The repository is public and identifies the project as MIT-licensed.
- MLX runs require macOS on Apple Silicon; the non-macOS path is limited to PyTorch CPU or CUDA experiments.
- MLX GPU operations compiled with
mx.compileare benchmarked by default, with a documented option to exclude compiled functions. - Results are available as both per-experiment timings and averages, and the visualizations are generated from the average benchmark table.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Run MLX and PyTorch benchmarks on Apple Silicon
Collect operation runtimes for MLX GPU and CPU, PyTorch MPS, and PyTorch CPU on a Mac.
Before you start
- A Mac with Apple Silicon running macOS
- Conda environment using the osx-arm64 architecture
- Python 3.10, NumPy, PyTorch, torchvision, SciPy, requests, and the repository requirements
Steps
Create the documented environment with
CONDA_SUBDIR=osx-arm64 conda create -n mlx_benchmark python=3.10 numpy pytorch torchvision scipy requests -c conda-forge.Install the repository dependencies with the command below.
pip install -r requirements.txtRun the command below.
python run_benchmark.py --include_mps=True --include_mlx_gpu=True --include_mlx_cpu=True --include_cpu=True
Expected outcome
The runner measures operations across the selected MLX and PyTorch backends; the project provides detailed per-experiment and averaged benchmark tables.
Guide limitations
- MLX experiments require the documented macOS Apple Silicon setup.
- MLX GPU operations compiled with
mx.compileare included by default; the README documents--compile=Falseto exclude them.
Run PyTorch CPU or CUDA benchmarks on other operating systems
Collect PyTorch CPU and CUDA operation measurements without importing MLX.
Before you start
- A non-macOS device with a CPU or CUDA-capable GPU
- A Python environment with the repository requirements except
mlx - A PyTorch package matching the installed CUDA version when using CUDA
Steps
Create an environment without the
CONDA_SUBDIR=osx-arm64prefix.Install the appropriate PyTorch package and the requirements in
requirements.txt, excludingmlx.Set
USE_MLX = Falseinconfig.py.Run the command below.
python run_benchmark.py --include_mps=False --include_mlx_gpu=False --include_mlx_cpu=False --include_cuda=True --include_cpu=True
Expected outcome
The documented non-macOS path runs PyTorch benchmarks on CUDA and CPU without MLX imports.
Guide limitations
- Non-macOS systems run only the documented PyTorch CPU or CUDA experiments, not MLX benchmarks.
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 28 November 2026
- Original website title
- TristanBilot/mlx-benchmark · Official homepage title · retained in its source language

