Back to articles

KernelShift Tests Whether Coding Agents Can Keep Up With New CPUs

3 min read

AI inference performance depends not only on models and processors, but also on whether low-level kernels make effective use of the instructions a processor exposes. Arm has added extensions such as Neon, SVE, SVE2, and SME2 over time, and each can call for different optimization techniques. KernelShift asks a practical question: can coding agents keep producing correct, fast CPU kernels as the hardware changes?

A benchmark grounded in real code

KernelShift is both a benchmarking pipeline and a set of execution environments. Its authors assembled 99 kernel tasks from actively developed projects, including ncnn, llama.cpp, Arm SIMD Loops, and KleidiAI. The collection includes inference workloads derived from real model executions. For each task, an agent receives a reference implementation and workloads to test, while an expert implementation provides a performance target. Agents can run their code on the target hardware, inspect the feedback, and iterate.

Correctness is a prerequisite, not a bonus: a candidate must work on every workload to receive a score. That score is its speedup relative to the expert implementation. This setup makes it harder to win by optimizing only a narrow test case, and connects measured performance to working code. The pipeline is also designed to accommodate additional kernels and hardware configurations as processors and libraries evolve.

Strong gains, but not across every generation

On established architectural extensions, agents outperform the auto-vectorized compiler in all reported cases, with speedups of 2.4–19.8x. They also exceed a general-purpose library in some comparisons: generated kernels reach up to 2.74x the performance of ncnn’s Neon kernels. Yet the gap to expert engineering remains. Agents fall behind Arm’s hand-tuned KleidiAI kernels, reaching 0.70x relative performance.

The paper also reports end-to-end results, rather than only isolated kernel measurements. For prefill in two LLMs, agent-written kernels deliver a 1.3–1.6x speedup over llama.cpp’s fast path. But these gains do not automatically carry over to newer hardware features. The authors find that current agents do not reliably adapt to SME2, whose matrix-tile programming model is unfamiliar compared with established SIMD approaches.

Why the result matters

KernelShift’s contribution is not simply a leaderboard for coding models. It offers a repeatable way to test whether generated code is both correct and useful on actual target hardware, using tasks drawn from real repositories. Its results help separate the ability to produce plausible code from the ability to exploit a processor’s specific capabilities.

The findings suggest a nuanced role for coding agents. Where optimization patterns transfer from familiar SIMD extensions, agents can uncover substantial gains over compiler-generated code and some general-purpose library kernels. But they do not yet consistently match carefully hand-tuned implementations, and a new programming model can undermine their performance. For now, these systems are better understood as contributors to an optimization workflow than as replacements for kernel specialists: they can propose and test candidates, while rigorous validation and expert reference code remain important safeguards. As architectures evolve, benchmarks that evolve with them can show where agent capability is advancing—and where it is not.

Source: Hugging Face Daily Papers

Comments

Checking sign-in status...

Loading comments...

Related articles