Summary
Benchmark and profile Emily (the Nx backend for Apple MLX) against the existing EXLA backend to understand where we win, where we lose, and where to focus optimization effort.
Both are Nx.Backend implementations, so the same Nx programs can run on either by swapping the default backend — making a like-for-like comparison straightforward.
Goals
- Establish a baseline performance comparison between
Emily.Backend and EXLA.Backend on Apple Silicon
- Identify operations / workloads where Emily is significantly slower than EXLA so they can be prioritized
- Capture both compiled (
defn / Emily.Compiler) and eager-mode numbers
Suggested workloads
Method
Notes
- EXLA is not currently a dependency; it would be added as a
only: [:dev, :test] dep purely for benchmarking.
- Emily is Apple-Silicon / macOS only; EXLA on the same host runs CPU (or Metal via XLA if available) — note the comparison target explicitly so numbers aren't misread.
Summary
Benchmark and profile Emily (the Nx backend for Apple MLX) against the existing EXLA backend to understand where we win, where we lose, and where to focus optimization effort.
Both are
Nx.Backendimplementations, so the same Nx programs can run on either by swapping the default backend — making a like-for-like comparison straightforward.Goals
Emily.BackendandEXLA.Backendon Apple Silicondefn/Emily.Compiler) and eager-mode numbersSuggested workloads
dotacross a range of shapes & dtypesNx.Defncompiled functions (exerciseEmily.CompilervsEXLAJIT)conv_general) at typical CNN sizesEmily.Quantizationvs EXLA equivalents, where comparable)Method
bencheefor wall-clock timing (warm up to exclude first-call JIT/compile cost; also report cold-start separately):variant(:aotvs:jit) and note which was measured@mlx_version), and EXLA/XLA versionEmily.Memorytelemetry) — not just latencybench/) so results are reproducibleNotes
only: [:dev, :test]dep purely for benchmarking.