# metalSPARSE: A 2:4 Semi-Structured Sparse GEMV Kernel for Apple Silicon GPUs

DevFeed: [metalSPARSE: A 2:4 Semi-Structured Sparse GEMV Kernel for Apple Silicon GPUs](<https://devfeed.tech/articles/metalsparse-a-2-4-semi-structured-sparse-gemv-kernel-for-apple-silicon-gpus-132019.md>)

Original publisher: [Read original article](<https://arxiv.org/abs/2611.14545>)

Author: Tek Raj Awasthi (Friedrich-Alexander-Universit\\"at Erlangen-N\\"urnberg), Babita Awasthi

Published: 2026-11-13T05:00:00Z

Content type: article

Language: en

Sources: [arXiv: Artificial Intelligence](<https://devfeed.tech/sources/arxiv-artificial-intelligence.md>), [arXiv: Machine Learning](<https://devfeed.tech/sources/arxiv-machine-learning.md>)

Topics: [LLM optimization](<https://devfeed.tech/topics/llm-optimization.md>), [GPU optimization](<https://devfeed.tech/topics/gpu-optimization.md>), [Large Language Model](<https://devfeed.tech/topics/llm.md>), [MLX](<https://devfeed.tech/topics/mlx.md>), [lora](<https://devfeed.tech/topics/lora.md>), [PyTorch](<https://devfeed.tech/topics/pytorch.md>), [Transformers](<https://devfeed.tech/topics/transformers.md>)

Tags: [adapters](<https://devfeed.tech/tags/adapters.md>), [apple-silicon](<https://devfeed.tech/tags/apple-silicon.md>), [autoregressive](<https://devfeed.tech/tags/autoregressive.md>), [bandwidth](<https://devfeed.tech/tags/bandwidth.md>), [bits](<https://devfeed.tech/tags/bits.md>), [compute](<https://devfeed.tech/tags/compute.md>), [cs-ai](<https://devfeed.tech/tags/cs-ai.md>), [cs-ce](<https://devfeed.tech/tags/cs-ce.md>), [cs-lg](<https://devfeed.tech/tags/cs-lg.md>), [decoder](<https://devfeed.tech/tags/decoder.md>), [decoding](<https://devfeed.tech/tags/decoding.md>), [devices](<https://devfeed.tech/tags/devices.md>), [edge-devices](<https://devfeed.tech/tags/edge-devices.md>), [engine](<https://devfeed.tech/tags/engine.md>), [faster](<https://devfeed.tech/tags/faster.md>), [gpus](<https://devfeed.tech/tags/gpus.md>), [huggingface](<https://devfeed.tech/tags/huggingface.md>), [kernel](<https://devfeed.tech/tags/kernel.md>), [kernels](<https://devfeed.tech/tags/kernels.md>), [language](<https://devfeed.tech/tags/language.md>), [language-models](<https://devfeed.tech/tags/language-models.md>), [laptop](<https://devfeed.tech/tags/laptop.md>), [structured](<https://devfeed.tech/tags/structured.md>)

## AI overview

metalSPARSE reduces Apple GPU decoding traffic by streaming 2:4 weights in compressed form and expanding them in registers, despite the lack of sparse matrix hardware. Its fused Metal decoder reports 3.6x faster decoding than HuggingFace Transformers on PyTorch-MPS on an 8 GB M2 MacBook Air, and 1.52x faster than MLX on a 16 GB M4 for Qwen2.5-1.5B; the same engine on dense weights matches MLX. The reported speedup reaches 97% of what the byte reduction allows, while compute-bound prompt processing does not speed up. For quality recovery, the pipeline combines a Wanda mask, block-wise reconstruction, and 4-bit low-rank adapters trained jointly with surviving weights. On WikiText-2, perplexity falls from 3.01x dense after one-shot pruning with closed-form refit to 1.34x dense. The abstract says the pipeline runs on the same laptop hardware.

## Source excerpt

arXiv:2611.14545v1 Announce Type: cross 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.