{"id":17282,"date":"2026-07-31T22:32:48","date_gmt":"2026-07-31T22:32:48","guid":{"rendered":"https:\/\/techtrendfeed.com\/?p=17282"},"modified":"2026-07-31T22:32:48","modified_gmt":"2026-07-31T22:32:48","slug":"how-ok-search-brings-many-years-of-kernel-experience-to-apple-silicon-the-berkeley-synthetic-intelligence-analysis-weblog","status":"publish","type":"post","link":"https:\/\/techtrendfeed.com\/?p=17282","title":{"rendered":"How Ok-Search Brings Many years of Kernel Experience to Apple Silicon \u2013 The Berkeley Synthetic Intelligence Analysis Weblog"},"content":{"rendered":"<p> <br \/>\n<\/p>\n<div id=\"\">\n  <br \/>\n<meta name=\"twitter:title\" content=\"From CUDA to MLX: How K-Search Brings Decades of Kernel Expertise to Apple Silicon\"\/><\/p>\n<p><meta name=\"twitter:card\" content=\"summary_large_image\"\/><\/p>\n<p><meta name=\"twitter:image\" content=\"https:\/\/bair.berkeley.edu\/static\/blog\/cuda-to-mlx-k-search\/cover.png\"\/><\/p>\n<p><meta name=\"keywords\" content=\"CUDA, MLX, Apple Silicon, kernel optimization, evolutionary search, K-Search, FlashAttention, Mamba, state space models, Metal\"\/><\/p>\n<p><meta name=\"description\" content=\"IBM Research extends K-Search, the evolutionary kernel search framework from Berkeley Sky Lab, with a CUDA-to-MLX translation layer that transfers expert kernel knowledge to Apple Silicon, reaching 97% of FlashAttention performance and a ~20x faster Mamba SSM prefill.\"\/><\/p>\n<p><meta name=\"author\" content=\"Shiyi Cao, Gal Bloch, Assaf Toledo, Michael Factor, Gil Vernik, Joseph E. Gonzalez\"\/><\/p>\n<p class=\"center\">\n<img decoding=\"async\" src=\"https:\/\/bair.berkeley.edu\/static\/blog\/cuda-to-mlx-k-search\/cover.svg\" alt=\"Kernel knowledge transfer from CUDA to MLX\"\/><\/p>\n<p class=\"cuda-mlx-fig-caption\"><strong>Determine 1: CUDA-to-MLX optimization translation map.<\/strong> CUDA optimization data will be translated into architecture-native MLX methods moderately than copied instruction-for-instruction.<\/p>\n<p>We face a brand new epoch in computing. {Hardware} is altering quickly \u2014 not simply sooner GPUs, however a rising vary of chips from totally different distributors, every with its personal structure and sometimes tailor-made to particular AI workloads. Software program is altering simply as quick, and AI coding instruments now generate in minutes what took months of effort a couple of years in the past.<\/p>\n<p><\/p>\n<p>With a lot of computing now centered on AI, GPU kernels are an important element of its success. These are the low-level applications that run contained in the GPU, and writing environment friendly ones is way from apparent \u2014 it takes years of experience to get proper. Transferring a kernel from one vendor\u2019s {hardware} to a different is tougher nonetheless, and sometimes means rediscovering the identical optimizations from scratch. The CUDA ecosystem, for instance, has collected a long time of hard-won kernel experience: hand-tuned implementations of consideration, state house fashions, and different vital operations representing 1000&#8217;s of engineering hours. Newer {hardware} ecosystems (Apple Silicon, customized AI accelerators, and others) are rising quick however lack this depth.<\/p>\n<p>On this work we ask whether or not that experience will be transferred mechanically. We constructed on <a rel=\"nofollow\" target=\"_blank\" href=\"https:\/\/arxiv.org\/abs\/2602.19128\">Ok-Search<\/a>, an evolutionary kernel search framework launched by Cao et al. at Berkeley Sky Lab that makes use of AI to optimize GPU kernels, and prolonged it with a backend for MLX \u2014 Apple\u2019s machine-learning framework for its personal Apple Silicon chips. We developed a novel structured CUDA-to-MLX translation layer that lets Ok-Search take present CUDA kernels as a data base and adapt them into high-quality GPU kernels for Apple Silicon, moderately than rebuilding from scratch.<\/p>\n<p>We present that our method reaches near-expert stage efficiency on Apple Silicon with 0.97x speedup in comparison with the native MLX Consideration kernel, and as much as a 20x prefill speedup over the neighborhood mlx-lm implementation on the Mamba SSM kernel; we report the numbers, and the way a lot of the achieve comes from the interpretation layer, within the sections under. Though we concentrate on MLX kernels for Apple Silicon, the tactic just isn&#8217;t particular to MLX and applies to any ecosystem the place CUDA experience is transferable.<\/p>\n<h2 id=\"why-mlx\">Why MLX?<\/h2>\n<p>Apple\u2019s MLX framework has seen outstanding adoption since late 2023. With Apple Silicon in a whole bunch of thousands and thousands of MacBooks and Mac Studios, MLX permits native AI inference with out cloud prices. The unified reminiscence structure makes it particularly enticing for mid-sized fashions (7B\u201370B parameters on M sequence chips).<\/p>\n<p>But beneath this momentum lies a big hole: many performance-critical kernels that the NVIDIA ecosystem takes as a right: paged consideration, optimized SSM scan kernels, fused MoE routing are both absent or naive with out hardware-specific tuning. MLX runs fashions accurately however usually leaves important efficiency on the desk.<\/p>\n<p>This hole is what motivates the remainder of this put up.<\/p>\n<h2 id=\"what-is-k-search\">What&#8217;s Ok-Search?<\/h2>\n<p>Ok-Search is an evolutionary kernel optimization framework initially developed by our first creator Shiyi Cao at UC Berkeley Sky Lab. Given a naive kernel and a {hardware} specification, it runs an iterative optimization loop: an LLM causes about which optimizations to attempt subsequent, a code-writing mannequin generates candidate kernels, and people candidates are compiled and benchmarked on actual {hardware}.<\/p>\n<p>Measurements feed again into the search, which retains refining, pursuing promising instructions and dropping useless ends till efficiency converges.<\/p>\n<p class=\"center\">\n<img decoding=\"async\" src=\"https:\/\/bair.berkeley.edu\/static\/blog\/cuda-to-mlx-k-search\/algorithm-01-k-search.svg\" alt=\"Pseudocode for K-Search via co-evolving world models\" width=\"460\"\/><\/p>\n<p class=\"cuda-mlx-fig-caption\"><strong>Algorithm 1: Ok-Search through co-evolving world fashions.<\/strong> The search alternates between choosing probably the most promising motion, instantiating and evaluating code till enchancment stagnates, and evolving the world mannequin by means of insert, replace, and prune operations. Tailored from <a rel=\"nofollow\" target=\"_blank\" href=\"https:\/\/arxiv.org\/abs\/2602.19128\">Cao et al. (2026)<\/a>.<\/p>\n<p>Search is grounded by a Spec: a domain-specific doc encoding {hardware} guidelines, optimization patterns, and mathematical constraints which retains generated code from hallucinating invalid primitives and ensures candidates will really compile and run effectively.<\/p>\n<p>In our runs, a single mannequin (Gemini 3.5 Professional Preview) performs each roles: it maintains the reasoning state and writes the kernels. The reasoning half is prompted as a \u201cGPU kernel efficiency engineer\u201d and requested to work by means of a set evaluation earlier than proposing something: classify the kernel (discount, scan, consideration\/softmax, \u2026), rewrite the reference computation in canonical kind, map out knowledge format and entry patterns, and hypothesize the seemingly bottleneck (bandwidth, latency, compute, or synchronization) in every runtime regime. Solely then does it emit candidate optimizations, every as a single change implementable in a single iteration.<\/p>\n<p>We name the persistent reasoning state a <em>world mannequin<\/em>. Moderately than a flat record of issues to attempt, it&#8217;s a determination (prefix) tree: every root\u2192leaf path composes a full optimization plan, and sibling branches are competing options. Each node is scored \u2014 an <code class=\"language-plaintext highlighter-rouge\">overall_rating<\/code> in [0, 10], a <code class=\"language-plaintext highlighter-rouge\">confidence<\/code> in [0, 1], and per-node <code class=\"language-plaintext highlighter-rouge\">impacts<\/code> on reminiscence bandwidth, register stress, and compute\/{hardware} match \u2014 so the search can rank partial plans and increase probably the most promising ones. The tree persists and grows throughout rounds: refining an concept provides a baby node moderately than overwriting its guardian, and if the perfect rating fails to enhance for a couple of rounds (a stagnation window) the search backs off to discover an alternate department. A single node, because it seems mid-run on the eye kernel, seems like this:<\/p>\n<div class=\"post-code-compact\">\n<div class=\"language-json highlighter-rouge\">\n<div class=\"highlight\">\n<pre class=\"highlight\"><code><span class=\"p\">{<\/span><span class=\"w\">\n  <\/span><span class=\"nl\">\"motion\"<\/span><span class=\"p\">:<\/span><span class=\"w\"> <\/span><span class=\"s2\">\"Exchange the threadgroup-memory softmax discount\n             with a register-only discount: every SIMD group\n             owns 8 question rows and reduces throughout lanes with\n             simd_shuffle_xor, eradicating a threadgroup_barrier.\"<\/span><span class=\"p\">,<\/span><span class=\"w\">\n  <\/span><span class=\"nl\">\"difficulty_1_to_5\"<\/span><span class=\"p\">:<\/span><span class=\"w\"> <\/span><span class=\"mi\">4<\/span><span class=\"p\">,<\/span><span class=\"w\">\n  <\/span><span class=\"nl\">\"impacts\"<\/span><span class=\"p\">:<\/span><span class=\"w\"> <\/span><span class=\"p\">{<\/span><span class=\"w\">\n    <\/span><span class=\"nl\">\"memory_bandwidth\"<\/span><span class=\"p\">:<\/span><span class=\"w\">  <\/span><span class=\"mi\">8<\/span><span class=\"p\">,<\/span><span class=\"w\">\n    <\/span><span class=\"nl\">\"register_pressure\"<\/span><span class=\"p\">:<\/span><span class=\"w\"> <\/span><span class=\"mi\">4<\/span><span class=\"p\">,<\/span><span class=\"w\">   <\/span><span class=\"err\">\/\/<\/span><span class=\"w\"> <\/span><span class=\"err\">threat:<\/span><span class=\"w\"> <\/span><span class=\"err\">spill<\/span><span class=\"w\"> <\/span><span class=\"err\">if<\/span><span class=\"w\"> <\/span><span class=\"err\">Br<\/span><span class=\"w\"> <\/span><span class=\"err\">&gt;<\/span><span class=\"w\"> <\/span><span class=\"mi\">8<\/span><span class=\"w\">\n    <\/span><span class=\"nl\">\"compute_hw_fit\"<\/span><span class=\"p\">:<\/span><span class=\"w\">    <\/span><span class=\"mi\">9<\/span><span class=\"w\">    <\/span><span class=\"err\">\/\/<\/span><span class=\"w\"> <\/span><span class=\"err\">SIMD<\/span><span class=\"w\"> <\/span><span class=\"err\">width<\/span><span class=\"w\"> <\/span><span class=\"mi\">32<\/span><span class=\"err\">;<\/span><span class=\"w\"> <\/span><span class=\"err\">preserve<\/span><span class=\"w\"> <\/span><span class=\"err\">tile<\/span><span class=\"w\"> <\/span><span class=\"mi\">8<\/span><span class=\"err\">x<\/span><span class=\"mi\">8<\/span><span class=\"w\">\n  <\/span><span class=\"p\">},<\/span><span class=\"w\">\n  <\/span><span class=\"nl\">\"overall_rating_0_to_10\"<\/span><span class=\"p\">:<\/span><span class=\"w\"> <\/span><span class=\"mi\">8<\/span><span class=\"p\">,<\/span><span class=\"w\">\n  <\/span><span class=\"nl\">\"confidence_0_to_1\"<\/span><span class=\"p\">:<\/span><span class=\"w\"> <\/span><span class=\"mf\">0.7<\/span><span class=\"w\">\n<\/span><span class=\"p\">}<\/span><span class=\"w\">\n<\/span><\/code><\/pre>\n<\/div><\/div>\n<\/div>\n<p class=\"cuda-mlx-fig-caption\"><strong>Itemizing 1: Instance Ok-Search world-model node.<\/strong> Every candidate optimization data a concrete motion, estimated {hardware} impacts, an general precedence ranking, and the mannequin&#8217;s confidence.<\/p>\n<p class=\"center\">\n<img decoding=\"async\" src=\"https:\/\/bair.berkeley.edu\/static\/blog\/cuda-to-mlx-k-search\/best-figure-01-ksearch-loop.svg\" alt=\"Overview of the K-Search loop\" width=\"700\"\/><\/p>\n<p class=\"cuda-mlx-fig-caption\"><strong>Determine 2: Overview of Ok-Search.<\/strong> The framework operates on a <strong>Search State<\/strong> $S_t$ structured as a search tree. The tree consists of Closed nodes (blue, visited states with connected program like $x_{12}$) and a Frontier of Open nodes (orange, pending hypotheses like $u_{13}$). The workflow iterates by means of three phases: (1) <strong>Motion Choice<\/strong>, the place probably the most promising motion node is retrieved from the frontier based mostly on world mannequin estimated precedence rating $V$; (2) <strong>Native Refinement<\/strong>, the place a stochastic coverage $pi_{mathrm{code}}$ samples concrete implementations till stagnation; and (3) <strong>World Mannequin Replace<\/strong>, the place the LLM causes over the trajectory to replace the search tree through <em>Insert<\/em> (including new actions), <em>Replace<\/em> (adjusting $V$, e.g., $u_{11}$ dropping from 0.9 to 0.6), and <em>Prune<\/em> (eradicating much less promising nodes like $u_{10}$).<\/p>\n<p>The unique Ok-Search paper evaluated this search technique on CUDA kernels from FlashInfer. Throughout GQA decode, MLA decode, MLA prefill, and MoE, Ok-Search improved extra persistently than OpenEvolve and ShinkaEvolve over the identical 120-iteration finances. These outcomes set up the search framework we construct on right here; the rest of this put up asks whether or not its optimization data can switch past CUDA.<\/p>\n<p class=\"center\">\n<img decoding=\"async\" src=\"https:\/\/bair.berkeley.edu\/static\/blog\/cuda-to-mlx-k-search\/best-figure-03-ksearch-main-results.svg\" alt=\"K-Search benchmark results compared with OpenEvolve and ShinkaEvolve\" width=\"900\"\/><\/p>\n<p class=\"cuda-mlx-fig-caption\"><strong>Determine 3: Essential outcomes from the unique Ok-Search paper.<\/strong> Throughout three runs, Ok-Search achieves stronger best-so-far search scores, per-workload kernel efficiency, and speedup distributions than OpenEvolve and ShinkaEvolve on 4 FlashInfer CUDA kernels. Reproduced precisely from <a rel=\"nofollow\" target=\"_blank\" href=\"https:\/\/arxiv.org\/abs\/2602.19128\">Cao et al. (2026)<\/a>.<\/p>\n<h2 id=\"building-an-mlx-backend\">Constructing an MLX backend<\/h2>\n<p>To convey Ok-Search to Apple Silicon, we first constructed a local MLX backend. We carried out a full MLX-specific process adapter for Ok-Search, together with:<\/p>\n<ul>\n<li>An MLX process backend in <code class=\"language-plaintext highlighter-rouge\">k_search\/duties\/<\/code> dealing with kernel compilation and execution on Apple Silicon through MLX\u2019s Metallic\/C++ APIs.<\/li>\n<li>Up to date kernel generator prompts for writing and modifying Metallic\/MLX kernels.<\/li>\n<li>MLX-specific benchmarking integration utilizing <code class=\"language-plaintext highlighter-rouge\">mlx.core<\/code> measurement utilities.<\/li>\n<\/ul>\n<h2 id=\"translating-cuda-expertise-to-mlx\">Translating CUDA experience to MLX<\/h2>\n<p>Nonetheless, the extra attention-grabbing problem was not merely working Ok-Search on MLX. The important thing perception is that knowledgeable CUDA kernels encode a long time of optimization data that&#8217;s transferable to Apple GPU should you can bridge the conceptual hole. Merely handing an LLM a CUDA kernel and asking it to port it isn&#8217;t sufficient: with out deep {hardware} context, it produces code that&#8217;s syntactically legitimate however architecturally unsuitable (unsuitable tile sizes, invalid primitives, mismatched reminiscence assumptions).<\/p>\n<p>Our translation layer consists of:<\/p>\n<ul>\n<li><strong>Idea mapping tables:<\/strong> A structured glossary of CUDA primitives and their MLX\/Metallic equivalents with arduous constraints. For instance:\n<ul>\n<li><code class=\"language-plaintext highlighter-rouge\">__shared__<\/code> maps to Metallic <code class=\"language-plaintext highlighter-rouge\">threadgroup<\/code> reminiscence however with a tough 32 KB restrict (vs. NVIDIA\u2019s 48 KB)<\/li>\n<li><code class=\"language-plaintext highlighter-rouge\">warp_reduce<\/code> maps to MMA (most well-liked)<\/li>\n<li><code class=\"language-plaintext highlighter-rouge\">__syncthreads()<\/code> turns into <code class=\"language-plaintext highlighter-rouge\">threadgroup_barrier(mem_flags::mem_tg)<\/code><\/li>\n<li>H100\u2019s ~3.35 TB\/s HBM3 maps to M3 Max\u2019s ~400 GB\/s unified DRAM a bandwidth distinction that reshapes which optimizations are price pursuing.<\/li>\n<\/ul>\n<\/li>\n<li><strong>MLX-specific hints and patterns:<\/strong> Concrete code-level patterns for operations with no direct CUDA equal, reminiscent of register-based row reductions utilizing <code class=\"language-plaintext highlighter-rouge\">simd_shuffle_xor<\/code> in an 8\u00d78 MMA tile format, or the \u201cexp2 trick\u201d (changing $exp(x)$ with $exp_2(x log_2 e)$) for sooner softmax on Apple\u2019s quick $exp_2$ {hardware} instruction.<\/li>\n<li><strong>Reusable assertions:<\/strong> Professional kernel behaviors reframed as properties the evolutionary search should protect, moderately than code to repeat.<\/li>\n<\/ul>\n<h2 id=\"matching-expert-kernel-performance-the-attention-kernel\">Matching knowledgeable kernel efficiency: the Consideration kernel<\/h2>\n<p>We consider three configurations of an MLX consideration kernel for Apple Silicon: (1) a naive baseline, (2) pure evolution with no further supplied context, and (3) a full context translation layer, which provides the optimizer with architecture-specific implementation data extracted from high-performance kernels (e.g., FlashAttention-2), letting the evolutionary search cause about implementation methods moderately than ranging from a naive kernel. Collectively, these three configurations allow us to isolate the precise affect of the interpretation layer.<\/p>\n<p class=\"center\">\n<img decoding=\"async\" src=\"https:\/\/bair.berkeley.edu\/static\/blog\/cuda-to-mlx-k-search\/best-figure-02-attention-optimizations.svg\" alt=\"Performance scaling of the Attention Kernel through stacked optimizations\" width=\"700\"\/><\/p>\n<p class=\"cuda-mlx-fig-caption\"><strong>Determine 4:<\/strong> Efficiency scaling of the Consideration Kernel by means of stacked optimizations. The &#8220;Full Context&#8221; configuration efficiently discovers and implements superior methods like double buffering and loop unrolling, reaching near-expert efficiency.<\/p>\n<p>The leap from 0.26\u00d7 to 0.97\u00d7 the velocity of Apple\u2019s state-of-the-art consideration kernel \u2014 illustrates how a lot the interpretation layer issues. With full context, the advanced kernel independently discovers the important thing optimizations in FlashAttention 2: threadgroup reminiscence tiling, on-line softmax, Ok-transposition for reminiscence entry, and the exp2 trick. The final of those replaces each softmax exponential with a base-2 exponential,<\/p>\n<p>[e^x = 2^{x log_2 e},]<\/p>\n<p>which is actual and lets the kernel use Apple\u2019s quick <code class=\"language-plaintext highlighter-rouge\">quick::exp2()<\/code> {hardware} instruction instantly as an alternative of paying for a base conversion at runtime.<\/p>\n<h2 id=\"a-20-faster-prefill-the-mamba-ssm-kernel\">A 20\u00d7 sooner prefill: the Mamba SSM kernel<\/h2>\n<p>To judge whether or not Ok-Search generalizes past consideration kernels, we utilized it to the state-space mannequin (SSM) kernel utilized by Mamba. In contrast to consideration, the computational bottleneck is a recurrent state replace moderately than a softmax, offering a considerably totally different optimization problem. We evaluate the advanced implementation towards the neighborhood MLX implementation (mlx-lm) and the PyTorch reference implementation (mamba.py) on an M1 Max.<\/p>\n<p>Evaluated on mamba-370m f16, M1 Max 64GB:<\/p>\n<div class=\"cuda-mlx-results-table\">\n<table>\n<thead>\n<tr>\n<th>Metric<\/th>\n<th>mlx-mamba (ours)<\/th>\n<th>mlx-lm (neighborhood)<\/th>\n<th>mamba.py<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Decode<\/td>\n<td>152 tok\/s<\/td>\n<td>116 tok\/s<\/td>\n<td>40 tok\/s<\/td>\n<\/tr>\n<tr>\n<td>Prefill L=512<\/td>\n<td>5,751 tok\/s<\/td>\n<td>329 tok\/s<\/td>\n<td>1,089 tok\/s<\/td>\n<\/tr>\n<tr>\n<td>Prefill L=1024<\/td>\n<td>6,010 tok\/s<\/td>\n<td>327 tok\/s<\/td>\n<td>1,127 tok\/s<\/td>\n<\/tr>\n<tr>\n<td>Prefill L=2048<\/td>\n<td>6,612 tok\/s<\/td>\n<td>326 tok\/s<\/td>\n<td>1,092 tok\/s<\/td>\n<\/tr>\n<tr>\n<td>Prefill L=4096<\/td>\n<td>6,743 tok\/s<\/td>\n<td>339 tok\/s<\/td>\n<td>1,042 tok\/s<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p class=\"cuda-mlx-fig-caption\"><strong>Desk 1:<\/strong> Prefill and decode throughput on mamba-370m (f16, M1 Max 64GB). mlx-mamba (ours) reaches ~20\u00d7 larger prefill throughput than the neighborhood mlx-lm baseline, whereas decode stays comparable.<\/p>\n<p>The ~20\u00d7 prefill speedup over mlx-lm comes down to 1 distinction: mlx-lm doesn&#8217;t implement a parallel scan for the SSM. The state recurrence<\/p>\n<p>[h_t = bar{a}_t h_{t-1} + bar{b}_t]<\/p>\n<p>seems inherently sequential, however every step will be written as a pair $(bar{a}_t, bar{b}_t)$ beneath the associative mix<\/p>\n<p>[(a_2, b_2) circ (a_1, b_1) = left(a_2 a_1, a_2 b_1 + b_2right),]<\/p>\n<p>which reproduces the recurrence precisely. As a result of the operator is associative, the entire sequence will be evaluated with a parallel (prefix) scan in $O(log N)$ dependent steps as an alternative of $O(N)$. mlx-lm skips this and processes tokens one after the other, leaving most of Apple Silicon\u2019s compute idle; our advanced Metallic kernel applies the scan and makes a lot fuller use of GPU throughput. The achieve exhibits up in prefill, the place the total sequence is accessible to scan in parallel, and never in single-token decode, the place there is just one new token per step and no scan to parallelize \u2014 which is why the decode row is roughly flat whereas prefill is ~20\u00d7.<\/p>\n<p>mamba.py is sluggish on each prefill and decode as a result of it&#8217;s a PyTorch reference implementation that falls again to CPU or MPS on Apple Silicon, forgoing the hardware-specific optimizations that MLX\u2019s Metallic backend makes doable.<\/p>\n<h2 id=\"whats-next\">What\u2019s subsequent?<\/h2>\n<p>On the 2 kernels we studied, AI-driven evolutionary kernel search grounded in structured cross-platform translation data reached near-expert efficiency on Apple Silicon with no group of GPU specialists ranging from scratch. We don&#8217;t but know the way far this generalizes, however the result&#8217;s encouraging.<\/p>\n<p>For us the primary takeaway is that the bottleneck was not the LLM\u2019s capacity to write down Metallic code, however the high quality of the context and constraints we gave it. Our CUDA translation layer converts present NVIDIA kernel experience into actionable steering for Apple Silicon, and lets Ok-Search\u2019s evolutionary search do the remaining.<\/p>\n<p>We&#8217;re actively extending this work in a number of instructions: supporting new architectures, with present efforts targeted on creating new kernels for the IBM Spyre AIU and broader {hardware} targets; including extra kernels reminiscent of paged consideration and fused MoE routing; and bettering integration with the Ok-Search evolution loop to make translation context much more computerized.<\/p>\n<h2 id=\"acknowledgements\">Acknowledgements<\/h2>\n<p>This work was carried out by IBM Analysis and builds on Ok-Search from the UC Berkeley Sky Lab (<a rel=\"nofollow\" target=\"_blank\" href=\"https:\/\/arxiv.org\/abs\/2602.19128\">Cao et al., 2026<\/a>). We welcome collaboration and suggestions from the MLX and broader AI programs communities. If you&#8217;re engaged on kernel optimization for non-CUDA {hardware}, we&#8217;d love to listen to from you.<\/p>\n<hr\/>\n<h2 id=\"citation\">Quotation<\/h2>\n<div class=\"language-bibtex highlighter-rouge\">\n<div class=\"highlight\">\n<pre class=\"highlight\"><code><span class=\"nc\">@article<\/span><span class=\"p\">{<\/span><span class=\"nl\">cao2026k<\/span><span class=\"p\">,<\/span>\n  <span class=\"na\">title<\/span><span class=\"p\">=<\/span><span class=\"s\">{Ok-Search: LLM Kernel Technology through Co-Evolving Intrinsic World Mannequin}<\/span><span class=\"p\">,<\/span>\n  <span class=\"na\">creator<\/span><span class=\"p\">=<\/span><span class=\"s\">{Cao, Shiyi and Mao, Ziming and Gonzalez, Joseph E and Stoica, Ion}<\/span><span class=\"p\">,<\/span>\n  <span class=\"na\">journal<\/span><span class=\"p\">=<\/span><span class=\"s\">{arXiv preprint arXiv:2602.19128}<\/span><span class=\"p\">,<\/span>\n  <span class=\"na\">12 months<\/span><span class=\"p\">=<\/span><span class=\"s\">{2026}<\/span>\n<span class=\"p\">}<\/span>\n<\/code><\/pre>\n<\/div>\n<\/div>\n<div class=\"post-appendix\">\n<h2 id=\"appendix-try-it-yourself\">Appendix: Attempt it your self<\/h2>\n<p>The MLX backend is constructed on prime of the open-source Ok-Search repo, so the outcomes right here will be reproduced instantly. The steps are:<\/p>\n<p>1. Clone and set up<\/p>\n<div class=\"language-bash highlighter-rouge\">\n<div class=\"highlight\">\n<pre class=\"highlight\"><code>git clone https:\/\/github.com\/caoshiyi\/Ok-Search.git\n<span class=\"nb\">cd <\/span>Ok-Search\n\nuv pip <span class=\"nb\">set up <\/span>openai wandb\nuv pip <span class=\"nb\">set up <\/span>git+https:\/\/github.com\/caoshiyi\/flashinfer-bench-ksearch.git\n<\/code><\/pre>\n<\/div><\/div>\n<p>2. Set your credentials<\/p>\n<p>Open the related script beneath scripts\/ and set three variables on the prime:<\/p>\n<div class=\"language-bash highlighter-rouge\">\n<div class=\"highlight\">\n<pre class=\"highlight\"><code><span class=\"nv\">KSEARCH_ROOT<\/span><span class=\"o\">=<\/span>\/path\/to\/Ok-Search\n<span class=\"nv\">API_KEY<\/span><span class=\"o\">=<\/span>your-llm-api-key\n<\/code><\/pre>\n<\/div><\/div>\n<p>3. Run kernel search<\/p>\n<div class=\"language-bash highlighter-rouge\">\n<div class=\"highlight\">\n<pre class=\"highlight\"><code><span class=\"c\"># Optimize Flash Consideration on Apple Silicon (world-model mode)<\/span>\nbash scripts\/mac_flash_attention_wm.sh\n\n<span class=\"c\"># Or a Mamba SSM kernel, e.g. the selective scan<\/span>\nbash scripts\/mamba_selective_scan_fwd_wm.sh\n<\/code><\/pre>\n<\/div><\/div>\n<p>Full CLI reference and documentation are within the README.<\/p>\n<\/div>\n<\/div>\n\n","protected":false},"excerpt":{"rendered":"<p>Determine 1: CUDA-to-MLX optimization translation map. CUDA optimization data will be translated into architecture-native MLX methods moderately than copied instruction-for-instruction. We face a brand new epoch in computing. {Hardware} is altering quickly \u2014 not simply sooner GPUs, however a rising vary of chips from totally different distributors, every with its personal structure and sometimes tailor-made [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":17284,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[55],"tags":[1395,311,310,110,414,7229,9992,312,4943,9991,193,3391],"class_list":["post-17282","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-machine-learning","tag-apple","tag-artificial","tag-berkeley","tag-blog","tag-brings","tag-decades","tag-expertise","tag-intelligence","tag-kernel","tag-ksearch","tag-research","tag-silicon"],"_links":{"self":[{"href":"https:\/\/techtrendfeed.com\/index.php?rest_route=\/wp\/v2\/posts\/17282","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/techtrendfeed.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/techtrendfeed.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/techtrendfeed.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/techtrendfeed.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=17282"}],"version-history":[{"count":1,"href":"https:\/\/techtrendfeed.com\/index.php?rest_route=\/wp\/v2\/posts\/17282\/revisions"}],"predecessor-version":[{"id":17283,"href":"https:\/\/techtrendfeed.com\/index.php?rest_route=\/wp\/v2\/posts\/17282\/revisions\/17283"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/techtrendfeed.com\/index.php?rest_route=\/wp\/v2\/media\/17284"}],"wp:attachment":[{"href":"https:\/\/techtrendfeed.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=17282"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/techtrendfeed.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=17282"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/techtrendfeed.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=17282"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}<!-- This website is optimized by Airlift. Learn more: https://airlift.net. Template:. Learn more: https://airlift.net. Template: 69d9690a190636c2e0989534. Config Timestamp: 2026-04-10 21:18:02 UTC, Cached Timestamp: 2026-08-01 05:43:17 UTC -->