Ferrox v0.4.1
Highlights — simdgroup-MMA flash attention at d=128
The d=64 MMA prefill attention kernel from v0.4.0 now covers head_dim
128 as well: its body is parameterised over the head dim, so one macro
emits both gqa_prefill_fa_ext_mma_d64 and _d128. That closes the
last group of dense Metal prefill rows.
Interleaved A/B on an Apple M2 Pro, -p 512 -n 0 -r 3 --ngl 99, two
reps per arm (FERROX_METAL_FA_MMA off vs on):
| Model | FA-vec | MMA | speedup | llama.cpp | gap |
|---|---|---|---|---|---|
| Qwen3-0.6B Q8_0 | 1917 | 3277 | 1.71× | 3510 | 1.81× → 1.07× |
| Phi-4-mini Q4_K_M | 450 | 540 | 1.20× | 562 | 1.24× → 1.04× |
| Llama-3.2-3B Q4_K_M | 523 | 630 | 1.20× | 563 | 1.08× → 0.89× |
| Mistral-7B-v0.2 Q4_K_M | 235 | 266 | 1.13× | 257 | 1.10× → 0.97× |
Gap = llama.cpp / ferrox; under 1 means ferrox is faster. Greedy
output is byte-identical with the kernel on and off.
Caveat on the numbers. These are interleaved A/B measurements, valid
as relative comparisons. The full benchmarks/RESULTS.md ledger was not
regenerated for this release — the benchmark host was above its load bar
throughout — so that table still shows the pre-v0.4.1 Metal figures.
FERROX_METAL_FA_MMA=0 restores the previous kernel (the scalar
fa_ext at d=64, FA-vec at d=128).
Install
curl -fsSL https://raw.githubusercontent.com/antonellof/ferrox/main/scripts/install.sh | bashOr pin a version:
FERROX_VERSION=v0.4.1 \
curl -fsSL https://raw.githubusercontent.com/antonellof/ferrox/main/scripts/install.sh | bashPrebuilt archives
| Asset | Notes |
|---|---|
ferrox-v0.4.1-darwin-arm64.tar.gz |
macOS Apple Silicon, Metal |
ferrox-v0.4.1-linux-x86_64.tar.gz |
Linux x86_64, CPU |
CUDA and other hosts: build from source (--features cuda).
Full Changelog: v0.4.0...v0.4.1