metalSPARSE: A 2:4 Semi-Structured Sparse GEMV Kernel for Apple Silicon GPUs
Tek Raj Awasthi (Friedrich-Alexander-Universit\"at Erlangen-N\"urnberg), Babita Awasthi
Key points
From the paper's conclusion- We present metalSPARSE, to our knowledge the first 2:4 sparse kernels for Apple GPUs, together with a fused decoder written in Metal.
Abstract
Autoregressive Large Language Models (LLMs) generate text one token at a time, and each token reads every weight from memory, so on edge devices, decoding is limited by memory bandwidth. 2:4 semi-structured sparsity keeps two of every four weights, but Apple-silicon GPUs have no sparse matrix hardware, so pruning helps only if a kernel actually reads fewer bytes. We present metalSPARSE, to our knowledge the first 2:4 sparse kernels for Apple GPUs, together with a fused decoder written in Metal. The kernels stream weights in compressed form and expand them in registers. On Qwen2.5-1.5B with 2:4 sparsity on every decoder linear layer, decoding runs 3.6x faster than HuggingFace Transformers on PyTorch-MPS on an 8 GB M2 MacBook Air and 1.52x faster than MLX on a 16 GB M4. The same engine on dense weights matches MLX, so the gain comes from the compressed weights, and sparsity delivers 97% of the speedup its byte reduction allows. Prompt processing, which is compute-bound, does not speed up. To preserve quality, we combine a Wanda mask with block-wise reconstruction and low-rank adapters trained jointly with the surviving weights and quantized to 4 bits. On WikiText-2 this brings perplexity from 3.01x dense after one-shot pruning (Wanda with a closed-form refit) to 1.34x, and the whole pipeline runs on the same laptop/hardware.
Read the paper
Discussion
Science Skim's AI key points, plus readers' public thoughts
Readers' thoughts
No reader thoughts yet.
Related papers
- Evaluating the Applicability of LLM Inference Optimizations on Apple SiliconarXiv · 2026
- Activation Sparsity with Weight Approximation for Faster LLM Decoding on Offloaded WeightsarXiv · 2026
- One Million Tokens in 20GB: Calibration-Free 2-Bit SRFT KV-Cache Compression for Looped MoE Inference on Apple SiliconarXiv · 2026
- Double KV Cache Optimization on Apple Silicon: Block-FP4, Radial Quantization, and Fused Metal KernelsarXiv · 2026
- LampAttention: Look-Ahead Mixed-Precision FlashAttention for Dedicated AcceleratorsarXiv · 2026
- What actually runs: a measurement study of language model placement and decode speed on the Apple Neural EnginearXiv · 2026