OpenViSTAI · Agents · Blockchain · Crypto
Menu
AI Evaluation & Observability

Mlx Benchmark

Mlx Benchmark is an open-source Python tool that measures runtimes for machine-learning operations in Apple MLX and equivalent PyTorch backends. It publishes individual experiment results, averages, and visualizations for comparing Apple Silicon chips and supported CPU, MPS, and CUDA paths.

Independent OpenViST project profile, based on linked sources.

Mlx Benchmark — OpenViST project profile in AI Evaluation & Observability.
OpenViST project illustration. See the linked sources for product details.
Understand the project

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.
Before you choose

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.compile are 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.

Source-based practical guide

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

  1. 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.

  2. Install the repository dependencies with the command below.

    Documented command
    pip install -r requirements.txt
  3. Run the command below.

    Documented command
    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.compile are included by default; the README documents --compile=False to exclude them.
Source-based practical guide

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

  1. Create an environment without the CONDA_SUBDIR=osx-arm64 prefix.

  2. Install the appropriate PyTorch package and the requirements in requirements.txt, excluding mlx.

  3. Set USE_MLX = False in config.py.

  4. Run the command below.

    Documented command
    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.
Evidence and transparency

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