RiptideRiptide
Download Riptide SDKInstall Riptorch
Menu
Apple M5 Pro · the CPU's matrix unit

Matrix maths on the CPU, exact and fast.

The Apple M5 Pro's CPU has a matrix unit built in. Raya, our open-source language, and Riptorch, our rewrite of PyTorch, both put it to work. These are the results where we came out ahead, each with the exact size, number type, threads, chip and date it was measured on.

  • 84×Raya: exact int8 matrix multiply vs C, 2048³, Apple M5 Pro CPU
  • 3,840×Riptorch: float16 matrix multiply vs PyTorch, 4096³, Apple M5 Pro CPU
  • 844×Riptorch: exact int8 vs PyTorch's CPU path, 4096³, Apple M5 Pro CPU

November 23, 2026. Every number holds for the chip named next to it; other Macs give different results.

At a glance

Every win on the M5 Pro's CPU.

One chart, log scale: each step along the bottom is ten times faster than the one before.

Times faster on the Apple M5 Pro CPU, log scale. Raya: exact int8 matrix multiply 84× vs C at 2048³ and 68× at 1024³; float64 1024³ on one core 2.52× vs Apple Accelerate; float32 1024³ 1.38× vs Apple Accelerate. Riptorch: float16 4096³ 3,840× vs PyTorch; exact int8 844× vs PyTorch's CPU path at 4096³ and 123× at 1024³.
Raya · open source

Faster than C, and than Apple's own maths library.

Raya's matrix kernels are built into its runtime and called from ordinary Raya code. Same machine, same inputs, every result checked against C.

84×
exact int8 → int32 matrix multiply, 2048³

Whole-number matrix maths with no rounding at all, 84 times faster than the same job in C.

3.99 ms vs 337 ms · 95% CI 83–85× · 68× at 1024³ (0.632 vs 42.9 ms) · every result bit-identical to C. Raya at its default thread count; C loops on one thread, clang -O3, auto-vectorized (Apple's Accelerate has no int8 multiply). Raya on one thread too: 58×.
1.38×
float32 matrix multiply, 1024³, vs Apple Accelerate

Everyday 32-bit maths, faster than Apple's tuned library on Apple's own chip.

1.18 ms vs 1.62 ms · 95% CI 1.05–1.51× · each side at its default thread count · outputs bit-identical to Accelerate's.
2.52×
float64 matrix multiply, 1024³, on one core

Double precision on a single CPU core, two and a half times Apple's library on that same core.

5.42 ms vs 13.6 ms · 95% CI 2.32–2.63× · one thread each: Raya pinned with RAYA_MATRIX_THREADS=1, Accelerate with VECLIB_MAXIMUM_THREADS=1 · bit-identical outputs.
Raya matrix multiply in milliseconds on the Apple M5 Pro CPU, log scale: int8 2048³ Raya 3.99 vs C loops 337; int8 1024³ Raya 0.632 vs C loops 42.9; float64 1024³ on one core Raya 5.42 vs C with Accelerate 13.6; float32 1024³ Raya 1.18 vs C with Accelerate 1.62.

Apple M5 Pro (18 cores, 48 GB), macOS 27.2.1, measured November 23, 2026. Raya vs Apple clang 21.0.0 -O3 -mcpu=native. Median of 15 runs with a bootstrap 95% confidence interval. Every Raya benchmark, including where C is still ahead.

Riptorch

Where PyTorch's CPU is slow, Riptorch isn't.

Riptorch runs PyTorch code when you change one line: import riptorch as torch. On the M5 Pro's CPU it sends float16 and whole-number products to the matrix unit, where stock PyTorch 2.15 takes a slow path.

3,840×
float16 matrix multiply, 4096³

A 16-bit multiply that keeps PyTorch busy for over three minutes on the CPU finishes in 52 milliseconds.

52 ms vs 201 s · Apple M5 Pro CPU · Riptorch best of 5 (median 66.5 ms); PyTorch 2.15 at the faster of 6 and 18 threads, one 201 s run. PyTorch's own float32 path takes 88.7 ms here, so code that already converts to float32 gains 1.7×.
844×
exact int8 → int32 matrix multiply, 4096³, vs PyTorch's CPU path

Whole-number matrix multiply with every entry exact: 30 milliseconds, where PyTorch's CPU takes 25 seconds.

29.9 ms vs 25,228 ms (torch._int_mm) · Apple M5 Pro CPU · PyTorch at its fastest CPU thread count (18) · best of 2 · 0 wrong entries on both sides.
123×
exact int8 matrix multiply, 1024³, vs PyTorch's exact CPU path

The same exact product at a smaller size: 76 milliseconds in PyTorch, 0.62 in Riptorch.

0.62 ms vs 76.3 ms (torch._int_mm, 18 threads) · Apple M5 Pro CPU · best of 5 · 0 wrong entries.
6.1×
exact vector search, 1 million documents, 16 questions

Find the 10 closest of a million documents for each question, exactly right, six times faster than PyTorch's fastest method.

4.14 ms vs 25.33 ms · Apple M5 Pro CPU · 256 numbers per document · Riptorch's exact int8 index (built once in 6 ms) vs PyTorch's normalize, multiply and top-k · median of 7 · every answer the true top 10 in order.
Riptorch vs PyTorch on the Apple M5 Pro CPU, milliseconds, log scale: float16 4096³ Riptorch 52 ms vs PyTorch 201 s; exact int8 4096³ Riptorch 29.9 ms vs PyTorch torch._int_mm 25.2 s; exact int8 1024³ Riptorch 0.62 ms vs PyTorch 76 ms.

Apple M5 Pro CPU, November 23, 2026, PyTorch 2.15.0.

Also measured · other chips

On the GPU, and on both at once.

These ran on Apple GPUs or on an older Mac, so each one names its chip.

197×
exact vector search, 2 million documents · Apple M1 Pro GPU

Against PyTorch's cosine_similarity, the call most search code makes: every answer the true top 10, in order.

25.4 ms vs 4,990 ms · 16 questions, 256 numbers per document · against PyTorch's fastest hand-written method the lead is up to 3.4×.
+22%
one matrix multiply on the GPU and the CPU together · Apple M1 Pro

The GPU and the CPU's matrix unit share one product on the same memory, so the CPU adds speed instead of sitting idle.

float16 2048 × 4096 × 4096: 3.90 → 4.77 trillion operations per second (float32 3.01 → 3.47, +15%) · RIPTORCH_HYBRID=1 · November 26, 2026.
1.29×
float32 matrix multiply vs Apple MLX, 4096³ · Apple M5 Pro GPU

Faster than Apple's MLX and 2.6 times more accurate, using scaled 16-bit pieces that never overflow.

6.45 ms vs 8.31 ms · error 2.9e-4 vs 7.7e-4 against a float64 product · Riptorch's fast mode · November 23, 2026 · Riptorch timed on the GPU's clock, MLX by wall clock including its 0.1–0.3 ms launch.
Exact vector search, top 10 for 16 questions, milliseconds, log scale: Apple M5 Pro CPU with 1 million documents, Riptorch exact int8 4.14 ms vs PyTorch's fastest method 25.3 ms; Apple M1 Pro GPU with 2 million documents, Riptorch exact int8 25.4 ms vs PyTorch cosine_similarity 4,990 ms.
How we measured

Medians, intervals, and the machine.

  • Raya. Apple M5 Pro (18 cores, 48 GB), macOS 27.2.1, November 23, 2026, against Apple clang 21.0.0 with -O3 -mcpu=native. 15 runs of each variant, in a fresh shuffled order every round, each started only while the machine's 1-minute load was under 4.5. We report the median and a bootstrap 95% confidence interval (10,000 resamples). Integer outputs are bit-exact across Raya, C and C++, and at 1024³ every element was compared. The full Raya benchmark page has every row, wins and losses, and the programs to run them yourself.
  • Riptorch matrix multiply. Apple M5 Pro CPU, November 23, 2026, PyTorch 2.15.0. The Mac was shared (1-minute load 7.5–12), so we report best times of 2 to 9 runs rather than medians, with no confidence intervals; differences under about 15% would be noise, and these are 100 to 3,840 times. PyTorch ran at the faster of 6 and 18 threads. Every integer result was checked against an exact 64-bit reference: 0 wrong.
  • Riptorch vector search. Apple M5 Pro CPU, November 23, 2026: median of 7 per row, load 3.6. Each search is timed whole (score, top 10, indices read out) and checked against a double-precision ranking.
  • Other chips. The vector search at 2 million documents ran on an Apple M1 Pro GPU, the GPU-plus-CPU split on an Apple M1 Pro, and the MLX comparison on the Apple M5 Pro GPU. Results on one chip don't carry over to another: PyTorch's slow paths, especially, vary a lot between Macs.
  • Raya and Riptorch are both written by Riptide. Raya is open source. Riptorch's code is private; Riptorch 0.4.0 installs from PyPI.
Try it

Raya and Riptorch 0.4.0 are out.

Raya's compiler, runtime and matrix kernels are open source on GitHub, with downloads for macOS, Linux and Windows. Riptorch 0.4.0 is on PyPI for macOS, Linux and Windows.

# Raya: macOS and Linux curl -fsSL https://riptidecompute.com/raya/install.sh | sh # Riptorch pip install riptorch

Windows, Homebrew and direct downloads: every install method. Riptorch's platforms and settings are on the Riptorch page.