What happened
The llama.cpp project released version b13030, introducing native F8_E4M3 dequantization and a suite of optimized kernels for Metal GPUs. These additions cover matrix-multiply, flash-attention, and various element-wise operations, leveraging thread-group LUTs and SIMD-group parallelism. The changes enable the Qwen3.8-27B-NVFP4 model to run fully on Metal with dramatically fewer graph splits (from 290 to 2) and a ten-fold increase in prompt processing speed (≈4.5 t/s to ≈340 t/s) and generation speed (≈3 t/s to ≈25 t/s). Performance benchmarks on Apple M5 Max and M2 Ultra GPUs show TFLOPS gains that bring F8 paths within a few percent of the existing Q8_0 baseline.
The release adds dequantization and compute kernels for several core operations: MUL_MAT, MUL_MAT_ID, GET_ROWS, CPY, ADD, and FLASH_ATTN_EXT. A 256-entry thread-group lookup table (LUT) replaces per-value conversion, speeding up F8 processing.
For matrix-multiply, the F8 path dequantizes weights into thread-group memory and reuses existing dequantization logic, with specialized MMA kernels handling 2-16 row blocks. Alignment constraints (32-aligned K dimension and even weight pointers) are enforced, with fall-backs to existing paths when unmet.
Performance testing on a Mac Studio equipped with an M5 Ultra (256 GB) shows the Qwen3.8-27B-NVFP4 model’s graph splits drop from 290 to 2, prompt processing speed rises from 4.5 tokens/s to roughly 340 tokens/s, and generation speed climbs from about 3 tokens/s to 25 tokens/s.
TFLOPS measurements on an M5 Max GPU indicate the F8 MMA path reaches 2.10-7.11 TFLOPS across 2-8 row configurations, approaching the Q8_0 baseline. On an M2 Ultra, the legacy mat-mat path improves from 13.65 TFLOPS to 17.85 TFLOPS, matching Q8_0 performance.
Additional code clean-ups include consolidating binary operation cases, refining predicate checks for MMA usage, and removing duplicated type checks, which together improve scheduler stability and graph ordering.
Why it matters
Native F8_E4M3 support on Metal lowers the computational cost of running large language models on Apple silicon, making high-quality inference more accessible to developers who rely on macOS or iOS devices. By reducing graph-split overhead and improving token throughput, the update narrows the performance gap between 8-bit and 4-bit schemes, potentially cutting memory usage and power consumption for applications. This could accelerate the deployment of sophisticated models like Qwen3.8-27B in edge scenarios such as mobile assistants, desktop tools, and research prototypes that previously required more powerful GPUs or cloud resources. The open-weight nature of llama.cpp means the improvement benefits the broader open-source AI ecosystem, not just a single vendor.
The update demonstrates that 4-bit (F8_E4M3) can be made practical on consumer-grade Apple silicon, expanding the hardware options for developers who cannot afford dedicated GPUs.
Higher token throughput reduces latency for interactive applications, making on-device chatbots, code assistants, and translation tools more responsive.
Memory savings from F8 enable larger models to fit within the limited VRAM of mobile GPUs, opening possibilities for richer experiences without cloud reliance.
Because llama.cpp is open-source and widely used, the performance gains are immediately available to a broad community, potentially influencing other projects to adopt similar strategies.
The detailed kernel optimizations (thread-group LUTs, SIMD-group usage) provide a reference implementation for future hardware-specific enhancements across the AI tooling ecosystem.
Interactive Mechanism: How It Actually Works
Explore the underlying technology behind this development interactively.
Why is standard self-attention expensive for long sequences?
What to watch next
Future llama.cpp releases may extend F8 support to additional kernels, broader hardware backends, or higher-precision formats. Watch for community benchmarks comparing the new Metal F8 path against other strategies on different Apple devices. Developers should monitor any changes to the library’s or build requirements that could affect integration into existing pipelines. Additionally, the impact on battery life and thermal performance for prolonged inference workloads on laptops and tablets will be an important practical metric.
Whether the F8 kernels will be back-ported to other backends such as CUDA or Vulkan, extending the performance benefits beyond Metal.
Community feedback on stability and edge-case handling, especially regarding the strict alignment requirements that trigger fall-backs.
Potential updates to the llama.cpp documentation and example scripts to help developers adopt the new F8 path with minimal friction.
Comparative studies on power consumption and thermal behavior when running the same model with F8 versus Q8_0 on Apple devices.
The emergence of third-party tools or wrappers that expose the new Metal F8 capabilities through higher-level APIs or UI frameworks.