benchmarking-mlx-vlm

Benchmarks MLX vision-language models with median-of-N timing, peak-memory tracking, and A/B version comparisons.

1|1|Updated Apr 21, 2025
One-click install
npx skills add https://github.com/jrp2014/check_models --skill benchmarking-mlx-vlm-jrp2014
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: benchmarking-mlx-vlm
Source: https://github.com/jrp2014/check_models/tree/main/.agents/skills/benchmarking-mlx-vlm
Command: npx skills add https://github.com/jrp2014/check_models --skill benchmarking-mlx-vlm-jrp2014

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires mlx.

What problem does it solve? Timing MLX models is error-prone because MLX evaluates lazily, so naive timers measure graph construction instead of compute. This Skill enforces a credible benchmarking protocol for mlx-vlm so performance comparisons, regression checks, and upstream PR evidence are trustworthy. ## Core Features & Use Cases - Correct timing discipline: warmup iterations, median-of-N reporting, and mx.eval/mx.synchronize before stopping timers. - Peak-memory protocol: mx.reset_peak_memory/mx.get_peak_memory measurement paired with latency so regressions in memory are caught alongside speed. - A/B across MLX versions: conda + pip workflow for comparing local MLX builds or pinned wheels through check_models, with like-for-like comparison rules. - Use Case: You modified an MLX kernel and need numbers for an upstream PR. Follow the protocol to produce a median-of-7 latency table with peak memory, a correctness assertion, and full environment provenance (chip, RAM, versions) that maintainers will accept. ## Quick Start Ask the assistant to benchmark an MLX model change following the mlx-vlm benchmarking protocol with warmup, median-of-N timing, and peak-memory reporting.

Frequently Asked Questions about benchmarking-mlx-vlm

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I benchmark MLX models correctly on Apple Silicon?▼

Benchmark MLX models by running warmup iterations first, then reporting the median of at least 5 timed runs. Call mx.eval or mx.synchronize before stopping each timer, since MLX is lazy and otherwise you measure graph construction instead of compute.

How do I compare performance across different MLX versions?▼

Run baseline numbers with check_models on the current install, then switch the candidate build with pip install (editable local repo or pinned wheel) and rerun identically. Record pip show mlx mlx-vlm with every measurement and only compare runs with matching chip, prompt, image, and generation settings.

Why are my MLX timing results misleadingly fast?▼

MLX evaluates lazily, so a timer stopped without mx.eval or mx.synchronize measures only graph construction, not actual compute. Always flush evaluation before reading the clock, and discard warmup runs that include kernel compilation.

How do I measure peak GPU memory in MLX?▼

Call mx.reset_peak_memory() before the timed region and mx.get_peak_memory() / 1e9 after it to get peak usage in GB. Report peak memory alongside latency, since a speedup that doubles memory usage is not a real win.

Can I use uv to manage the benchmarking environment?▼

No, this workflow uses conda + pip exclusively and explicitly forbids uv run and uv venv. Activate the mlx-vlm conda environment and install builds with pip install -e or pinned wheels.

What should I include in benchmark numbers for an upstream PR?▼

Paste the exact benchmark script and raw Markdown table, report both latency and peak memory, and state the correctness assertion used. Include the swept parameter, fixed parameters, chip, RAM, macOS, and mlx/mlx-vlm versions with commit SHAs for editable installs.