KernelShift Benchmarks Coding Agents Across Evolving Arm CPU Extensions
Summary:KernelShift turns code repositories into hardware-in-the-loop benchmark instances for evaluating how coding agents adapt to Arm Neon, SVE, SVE2, and SME2. From 99 kernels drawn from projects including ncnn and llama.cpp, agent-written implementations outperform auto-vectorized compiler results by 2.4–19.8× on established extensions and reach up to 2.74× the performance of ncnn's Neon kernels. They nevertheless achieve only 0.70× the performance of Arm's hand-tuned KleidiAI kernels. In two end-to
Core Findings
KernelShift evaluates whether coding agents can translate processor capabilities into fast, executable CPU kernels. Its 99 kernels are drawn from actively maintained repositories rather than synthetic functions alone. The results separate two capabilities that are often conflated: optimizing within a familiar SIMD programming model and adapting to a genuinely new instruction-set architecture.
On established extensions, agent-generated kernels run 2.4–19.8× faster than the auto-vectorized compiler baseline. They reach up to 2.74× the performance of ncnn's Neon kernels. Against Arm's hand-tuned KleidiAI, however, they achieve only 0.70× performance. This gap is more informative than the compiler comparison alone: agents can already produce code far beyond ordinary compiler output, but they do not consistently match experts' accumulated work on data layout, register allocation, instruction scheduling, and edge-case handling.
In two end-to-end LLM workloads, agent-written kernels provide a 1.3–1.6× prefill improvement over llama.cpp's fast path. That confirms that kernel-level gains can propagate into real inference pipelines. It does not establish equivalent decode gains, however, because token decoding is often constrained by weight-memory bandwidth and batching behavior rather than by the compute-heavy kernels emphasized in the study.
How the Benchmark Works
KernelShift provides an agent-assisted, human-verified pipeline for converting active code repositories into executable benchmark instances. Its environments provide feedback from the target processor, turning optimization into a hardware-in-the-loop search process rather than a one-shot code-generation task. The suite includes kernels from ncnn, llama.cpp, Arm SIMD Loops, and KleidiAI, along with inference workloads derived from actual model executions.
The benchmark spans Arm Neon, SVE, SVE2, and SME2. This progression matters because each extension changes more than the available intrinsic names. Neon centers on fixed-width SIMD, SVE introduces scalable vector lengths, and SME2 exposes matrix tiles and outer-product-style operations. A model that performs well on Neon therefore cannot automatically be assumed to understand the dataflow required by SME2.
Why SME2 Is Different
Neon uses fixed 128-bit vectors, while SVE and SVE2 expose scalable vector widths. Agents can often approach these targets by recombining intrinsics found in public code, using compiler feedback, and iterating on masks, reductions, and tail handling. Their prior exposure to established kernel idioms is a meaningful advantage.
The problem becomes harder when the underlying parallel decomposition changes. For N elements processed with L active lanes, a simplified utilization model is:
η = N / (ceil(N / L) × L)
This expression does not capture every implementation detail, but it illustrates why vector width, masked tails, register pressure, and instruction-cache footprint matter. With SME2, the challenge expands beyond selecting wider vectors. An agent must reorganize matrix multiplication, convolution, or linear algebra into a coherent two-dimensional tiling and accumulation scheme. Replacing a Neon intrinsic with an SME2-named intrinsic is not sufficient when the surrounding dataflow, layout, and scheduling assumptions are wrong.
The observed SME2 weakness is therefore consistent with a mismatch between learned code priors and a new programming model. The benchmark does not, by itself, prove that the failure is caused only by model knowledge; prompts, available examples, task coverage, compiler maturity, and benchmark design may also contribute. Its achievement is to make this adaptation problem measurable and reproducible.
Engineering Trade-offs
First, kernel speedup does not translate linearly into application speedup. A simplified roofline view treats execution time as broadly constrained by computation, memory movement, or synchronization. If an operator is already bandwidth-bound, additional vector instructions may deliver little benefit. End-to-end improvement can also be approximated with an Amdahl-style relation:
S_end-to-end = 1 / ((1-p) + p/S_kernel)
Here, p is the fraction of runtime affected by the optimized kernel. Scheduler jitter, small-opaque dispatch overhead, and data movement can all reduce the realized gain.
Second, peak throughput is not sustained throughput. Agent-generated code may be instruction-dense enough to increase power pressure or reduce CPU frequency. Wall-clock speedups without CPU SKUs, core counts, frequency behavior, thermal conditions, thread affinity, and energy measurements are difficult to translate into production capacity.
Third, ISA specialization carries a portability cost. Neon code does not run natively on x86, while SVE and SME2 require additional runtime feature detection, ISA dispatch, and multiple maintained code paths. General-purpose libraries trade some peak speed for broad deployability; specialized agent output must be evaluated under the same constraint.
Finally, the reported runtime gains exclude the cost of generating the code. A realistic workflow includes model inference, compilation failures, repeated tests, deployment to the target machine, benchmarking, and human review. If a winning kernel requires many sampling rounds and long feedback cycles, its total cost may erase the apparent runtime advantage.
How Much Confidence to Place in the Benchmark
Using kernels from real repositories is stronger than relying only on synthetic microbenchmarks, but 99 instances still cannot represent the full CPU operator space. Because the repositories are public, possible pretraining contamination and source-version leakage also need to be checked. Human verification reduces the risk of malformed benchmark instances, yet the abstract does not specify sampling rules, rejected cases, or the exact correctness protocol.
The speedup ranges require absolute context. A 2.4–19.8× gain may come from a microsecond-scale operation or from a materially expensive kernel. Without absolute latency, repetition counts, variance, compiler flags, CPU models, and thread settings, it is impossible to assess statistical stability or whether the gains are concentrated in a small subset of tasks. The 0.70× result against KleidiAI provides a useful ceiling, but it too must be reproduced under identical microarchitecture, data layout, and timing boundaries.
Hardware-in-the-loop evaluation can also encourage overfitting to one processor. Stronger validation would cross-test different core counts, vector-length implementations, frequency policies, and processor generations. Prefill, decode, and full-application performance should be reported separately rather than collapsed into a single speedup.
Deployment Guidance
- Benchmark on the actual target SKU. Establish baselines on the deployment processor, compiler, linker flags, core allocation, and NUMA topology; do not transfer paper speedups across unrelated hardware.
- Treat agents as candidate generators. Require reference-output checks, numerical tolerances, sanitizers, and fuzzing, followed by expert review of aliasing, bounds, layout, and tail handling.
- Maintain explicit ISA dispatch. Keep separate Neon, SVE, and SME2 paths with runtime capability detection rather than presenting a local peak as a portable guarantee.
- Split the metrics. Measure operator latency, prefill throughput, decode latency, peak memory, and energy independently so that compute gains do not conceal memory bottlenecks.
- Account for total cost. Include model calls, compilation, failed attempts, benchmark-machine occupancy, and human review when comparing the agent workflow with profile-guided optimization and hand-written kernels.
- Teach genuinely new programming models. SME2-like extensions require validated tile examples, intrinsic-mapping documentation, and stepwise performance feedback. Adaptation to unfamiliar ISAs should not be assumed to emerge automatically with model scale.
KernelShift's main contribution is to separate two questions that are frequently merged: whether an agent can write a fast kernel and whether it can adapt when the hardware's programming model changes. The first is already showing substantial progress; the second remains a central obstacle to deploying coding agents inside production compute stacks.
— END —Source: Hugging Face Daily Papers (2026-11-22)
Tags: #KernelShift #Coding Agents #CPU Kernel Optimization #Arm SIMD #Performance Benchmarking
Editorial & Fact-Checking Note: This article is compiled from primary research, official release documentation, and source papers by the ZICQ Newsroom pipeline with automated entity verification and human editorial review. If you notice any technical inaccuracy, please submit a correction via our corrections policy or email our editorial desk directly.
Community Comments