Serving a large language model spends most of its time in the decode loop, where each step streams weights and cached keys and values through the GPU to produce only a few new tokens. This report describes a two-week effort, in the Muse Spark Open Kernel Challenge, to make one H200 GPU's share of a mixture-of-experts decoder layer faster than the kernels shipped by SGLang. The implementation was carried out through Claude Code agents under my direction: a single agent for ten days, then a coordinated team of agents with research, build and measurement roles. Every change passed exact-output checks and was timed against an untouched copy of the incumbent under the judge's CUDA-graph, cold-cache protocol. Final speedups over SGLang were 2.10× for attention decode, 1.98× for 4-bit routed experts, 1.85× for the whole decoder layer and 1.48× for 16-bit projections, ranking 618th of 2,014 entrants overall (top 31%). The gains came in three phases: original kernels, attributed ports of stronger open-source entries, and instruction-ordering and routing refinements. I report a 70-entry change log, the full cost (about $70 in AI costs), and six lessons on measuring small effects under noise.
Keywords: GPU kernels · LLM inference · mixture of experts · attention decoding · low-precision weights · AI coding agents
Summary of final results. Speedup is SGLang's time divided by mine, as a geometric mean over each board's scored shapes.
Serving a large language model is a loop. Each decode step reads the model's weights and the cache of past tokens, does a small amount of arithmetic for a handful of new tokens, and emits one token per request. At the batch sizes production servers run, that step is limited by memory traffic and by the latency of launching and chaining GPU kernels, not by arithmetic throughput [3, 4].
The Muse Spark Open Kernel Challenge asked entrants to replace the kernels for one GPU's share of such a step in a mixture-of-experts (MoE) model [6], and scored them against the kernels shipped by SGLang [1], a widely used open-source inference server. Results had to stay numerically correct at the given precisions, with no caching or replaying of outputs, and the organisers rerun the top entries on held-out shapes after the close, so only real speedups count.
All implementation was carried out by Claude Code agents [13] under my direction. I set the goals, the rules and the pass bars, and held every change to the same standard: careful measurement, small experiments, and a clear separation of real results from noise.
Contributions.
In plain decode each request adds one token per step. With speculative decoding [5], a cheap draft model proposes 8 tokens and the main model checks all 8 in one "verify" step, so each attention call has 8 query rows per request against the same 80K-token cache.
At batch 1 the whole step only has to move about 40 µs worth of data at full memory speed, and SGLang's kernels are already well tuned. The time left to win is spent waiting: on memory, on gaps between kernel launches, on stalls inside a kernel, and on the order the compiler chose for instructions. Raw arithmetic is not the bottleneck.
SGLang [1] is the baseline. Its attention path uses FlashAttention-3 [2], which exploits asynchrony and low precision on Hopper GPUs. Splitting a long cache into chunks that SMs scan in parallel follows Flash-Decoding [3], and the cache is paged as in PagedAttention [4]. For 4-bit weights, Marlin [7] is the established mixed-precision kernel, and Stream-K [8] balances matrix-multiply work evenly across all SMs. Kernels here were written in CUDA, PTX [10] and Triton [9]. Several of the strongest designs in this report come from public Apache-2.0 entries by other competitors, zhebrak [11] and vjeux [12], and are credited wherever used.
The challenge ran on NVIDIA H200 SXM GPUs. Each problem is one slice of the model's decoder layer, with SGLang's kernel as the opponent (Table 1, Figure 1).
Table 1. The four scored problems.
| Problem | What it computes | Shapes scored |
|---|---|---|
| Attention decode | Attention over an 80K-token cache of past keys and values, stored in 8-bit (FP8); 16 query heads share 2 key/value heads; sliding-window and full-cache layers | 12: batch 1/16/32, decode and 8-token verify |
| Routed experts | Each token is sent to 8 of 256 "expert" sub-networks whose weights are 4-bit (NVFP4); this GPU holds 32 of them | 6: batch 1, 8, 16, 32, 128, 256 |
| Dense projections | A few token vectors times large 16-bit (BF16) weight matrices: the five linear layers around attention and routing | 30: 1 to 256 tokens |
| Whole decoder layer | All of the above in one graph, plus every norm and residual | 12 |
The model shards each layer across eight GPUs. One GPU holds 1/8 of the attention heads and 32 of the 256 experts, and the cross-GPU reductions are left out of the timing. For every new token the layer runs the chain in Figure 2, top row then bottom row.
The judge records each kernel as a CUDA graph (a pre-recorded batch of GPU work, so launch overhead is tiny) and replays it with the GPU's cache cleared, as a busy server would see it. It divides SGLang's time by mine on each shape and averages those ratios as a geometric mean. The overall board combines the four problems.
Each problem allowed a daily quota of free check runs, which are timed but kept off the board, plus a smaller quota of scored runs; the best scored run became the board row. Machine-to-machine noise was ±1–3% per shape, so a single scored run often could not tell a 0.5% improvement from luck.
For the first ten days, Oct 20 to Oct 29, one Claude Code agent did everything: reading, writing kernels and running checks. On Oct 30 I switched to a team of agents, because one agent could no longer keep four boards, their notes and their experiments in view at once. From then on I set the goals, the rules and every judgement call on what counted as fair, and a coordinating agent ran the loop.
A fifteen-role research team of agents studied one problem at a time. Its roles included lens researchers, a silicon designer, a numerics specialist, two statisticians and a challenger. The team argued from NVIDIA's instruction manual, the shipped code and the judge's logs to a blueprint of one or two experiments. Builder agents then turned each blueprint into code, and the coordinator ran it on the judge.
Every proposal went through the same loop (Figure 3), designed so that a loss was cheap and a win was real.
Each board improved in three phases. First came my own kernels. Then, where another competitor had published a stronger design under an open licence, I ported it with attribution and checked it line by line. Last came my own tuning on top. Table 2 summarises each phase; Appendix A lists every step.
Table 2. What moved each board, by phase. Figures are the board score reached at the end of each phase.
Every board began at SGLang's own speed, 1.00×, on Oct 20. Table 3 compares the final row on each board with that board's median, top quarter and leader. Projections placed highest relative to the field (top 25%); the other three boards finished above their medians. The overall rank moved from about 767 of 1,725 on Oct 31 to 618 of 2,014 when submissions closed.
Table 3. Final standings. Scores are speedups over SGLang.
| Board | My row | Rank | Percentile | Median | Top 25% | Leader |
|---|---|---|---|---|---|---|
| Attention decode | 2.0993 | 576 / 1379 | top 42% | 1.907 | 2.603 | 3.339 |
| Routed experts | 1.9830 | 666 / 1425 | top 47% | 1.917 | 2.365 | 2.844 |
| Whole layer | 1.8452 | 617 / 1299 | top 47% | 1.786 | 2.236 | 2.614 |
| Projections | 1.4843 | 428 / 1746 | top 25% | 1.247 | 1.479 | 1.728 |
| Overall | – | 618 / 2014 | top 31% |
Standings when submissions closed, Nov 4, 23:59 PT. On Oct 31 the overall rank was about 767 of 1,725. Ranks are provisional until the organisers' review reruns.
Figure 4 traces each board from the baseline to its final row. The large steps coincide with ported designs; the long flat stretches between them are many small, individually measured refinements.
All of the engineering ran through Claude Code agents on a personal subscription. All GPU timing ran on the challenge's own judge, inside its free daily quotas.
The ≈ $70 figure is about $63 of subscription, prorating each plan's monthly price over the days it covered ($100/mo for 11 days, then $200/mo for the last 4: 11 × $100/30 + 4 × $200/30), plus a few dollars of extra usage credits. Billed as whole months, the two plans cost $100 and $200.
Working through a team of agents, I produced kernels 1.48–2.10× faster than a production inference stack on every problem of a public kernel challenge, for about $70 in AI costs. The decisive factor was less any single kernel than the discipline around them: exact-output gates, in-process comparisons against a null, and failures that were cheap and written down.
Several shipped kernels began as public, Apache-2.0-licensed entries by other competitors: zhebrak's stream-K experts kernel, cold-pair experts kernels and attention kernels [11], and vjeux's BF16 projection kernels, sk2 and gqx [12]. I ported them as attributed text, explained them in my notes, and changed them further. The FlashAttention-3 head fold re-implements a technique from zhebrak's entry. My detailed notes, judge logs and every experiment's numbers live in my project repository.
Each row is a version that became the board row, or a step whose technique is still in the final file. Scores are the judge's speedup over SGLang. Open a board to see its history.