AI Search Tool Carries NVIDIA GPU Coding Know-How Over to Apple Silicon
Berkeley researchers extended the K-Search kernel optimizer to Apple Silicon and fed it existing CUDA kernels as knowledge. They report reaching 0.97x the speed of the native MLX attention kernel and up to a 20x prefill speedup on a Mamba kernel.
Reviewed by Matheus GrangeiroUpdated on

- Peer reviewed
- No
Evidence level: Prototype or demonstration
Why it matters: Fast GPU kernels take years of expertise, and NVIDIA’s CUDA ecosystem holds decades of it while newer hardware has little. If that expertise can be carried over automatically, more hardware could run AI models efficiently.
A search loop grounded in hardware rules K-Search is an evolutionary kernel search framework from Berkeley Sky Lab. A language model reasons about which optimizations to try, a code model writes candidate kernels, and candidates are compiled and benchmarked on real hardware, with the measurements fed back into the search.
The authors added an MLX backend for Apple Silicon and a translation layer that maps CUDA concepts to Metal equivalents. One example is shared memory, which in Metal threadgroup memory has a hard 32 KB limit against 48 KB on NVIDIA.
The layer also holds code-level hints and reusable assertions that the search must preserve.
Three setups for the attention kernel The team compared a naive baseline, pure evolution with no extra context, and the full translation layer supplying knowledge drawn from kernels such as FlashAttention-2. The comparison asks how much of the gain comes from the CUDA knowledge and how much from search alone.
The hardware gap shapes the choices: an H100’s roughly 3.35 TB/s of HBM3 bandwidth against about 400 GB/s of unified memory on an M3 Max changes which optimizations are worth pursuing, which is why translation is not a copy.
Near-expert speed, with an open attribution question The authors report 0.97× relative to Apple’s state-of-the-art native MLX attention kernel, which is near-expert performance but slightly below it. On the Mamba state-space-model kernel, K-Search with the translation layer reached up to a 20× prefill speedup over the community mlx-lm implementation, a large gain where the baseline was unoptimized.
The two numbers answer different questions. The 0.97× figure shows the method can approach a hand-tuned kernel, while the 20× figure shows it can fill a gap where Apple’s ecosystem lacked a good kernel. K-Search results should be read with that distinction in mind.
The post says it reports how much of the gain comes from the translation layer, and the pure-evolution setup is the control for that. A single run on one chip family is a preliminary result, since the authors only state that the approach applies to other ecosystems where CUDA expertise transfers.
What the blog post does not show This is a research blog post, not a peer-reviewed paper, and its results come from the authors’ own runs with a Gemini 3.5 Pro Preview model acting as both reasoner and code writer. The K-Search work does not show the same gains with other models.
The claim that the method is not specific to MLX is stated by the authors and not demonstrated for other ecosystems here. The Berkeley team also reports results on a few kernels—attention and Mamba SSM—so how far the approach generalizes across the many GPU operations in AI software is untested.
The work was carried out by IBM Research and builds on K-Search from the UC Berkeley Sky Lab.
What the speedups do and do not mean It may seem that AI now ports any CUDA code to Apple chips automatically. In fact: the method needs a structured translation layer and hardware specification, and it was shown on a few kernels.
It may seem that a 20× speedup applies to all Apple Silicon AI work. In fact: it was the best case, on the Mamba prefill kernel against the community mlx-lm implementation.
It may seem that the 0.97× result means the method matches the native kernel. In fact: it is slightly below it, at 0.97×.
It may seem that the method is model-agnostic. In fact: the reported runs used Gemini 3.5 Pro Preview as both reasoner and code writer.
It may seem that the method is peer-reviewed. In fact: it is a research blog post, not a peer-reviewed paper.
Verdict: Berkeley’s work indicates that CUDA kernel knowledge can guide a search to near-expert speed on Apple Silicon, at 0.97× for attention and up to 20× for Mamba prefill. However, the results come from the authors’ own blog-level runs on few kernels, without peer review.
Based on reporting from Berkeley AI Research Blog. This is an independent explainer, written in our own words with AI assistance; Berkeley AI Research Blog has not reviewed or endorsed it. Read the original for the full details.