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

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.
Whole-number matrix maths with no rounding at all, 84 times faster than the same job in C.
Everyday 32-bit maths, faster than Apple's tuned library on Apple's own chip.
Double precision on a single CPU core, two and a half times Apple's library on that same core.

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.
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.
A 16-bit multiply that keeps PyTorch busy for over three minutes on the CPU finishes in 52 milliseconds.
Whole-number matrix multiply with every entry exact: 30 milliseconds, where PyTorch's CPU takes 25 seconds.
The same exact product at a smaller size: 76 milliseconds in PyTorch, 0.62 in Riptorch.
Find the 10 closest of a million documents for each question, exactly right, six times faster than PyTorch's fastest method.

Apple M5 Pro CPU, November 23, 2026, PyTorch 2.15.0.
On the GPU, and on both at once.
These ran on Apple GPUs or on an older Mac, so each one names its chip.
Against PyTorch's cosine_similarity, the call most search code makes: every answer the true top 10, in order.
The GPU and the CPU's matrix unit share one product on the same memory, so the CPU adds speed instead of sitting idle.
Faster than Apple's MLX and 2.6 times more accurate, using scaled 16-bit pieces that never overflow.

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.
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.
Windows, Homebrew and direct downloads: every install method. Riptorch's platforms and settings are on the Riptorch page.