AI Engineer World's Fair 2026

Autoresearch Made Our Models 3x Faster — Tejas Bhakta, Morph

Slide chapters

22 slide and demo groups · Timestamps are approximate.

It's just a while loop

An agent proposes a solution, checks its correctness and benchmarks it, then keeps or reverts it. The cycle repeats until the goal is met.

Text in image
AUTORESEARCH
03 / 20

its just a while loop

PROPOSE → CORRECT? → BENCHMARK → KEEP / REVERT

Andrej Karpathy's autoresearch, 2026

autoresearch for kernels | @tejasybhakta

What is a GPU kernel?

A CUDA kernel runs an operation in parallel, such as a matrix multiply. The diagram maps threads to CUDA cores, thread blocks to streaming multiprocessors, and a kernel grid to the GPU.

Text in image
what is a GPU Kernel?

CUDA thread
CUDA core

CUDA thread block
CUDA streaming Multiprocessor(SM)

CUDA kernel grid
...
CUDA-capable GPU

02 / 20

autoresearch for kernels | @tejasybhakta

Why GPU kernels?

GPU kernels fit autoresearch because their correctness and speed can be verified, giving the framework a way to evaluate results.

Text in image
why GPU Kernels?

Its verifiable!
correctness and speed

02 / 20

autoresearch for kernels | @tejasybhakta

Good for sweeps, bad at ideas

Autoresearch can pick block sizes and tune small parameters, but Bhakta says high-level ideas like pipelining still need a human.

Text in image
Good for sweeps, bad at ideas

GOOD AT
smoothing corners
picking sizes
tuning parameters

BAD AT
novel ideas
pipelining
unusual tricks

07 / 20

autoresearch for kernels | @tejasybhakta

It's still your job to have good ideas

Bhakta says humans still need to supply the high-level ideas; autoresearch can help tune parameters once an idea is laid out.

Text in image
BE REAL

Its still your job to have good ideas

06 / 20

autoresearch for kernels | @tejasybhakta

The formula

Bhakta combines human ideas with autoresearch that selects parameters toward a goal of speed and correctness. With billions of model tokens, he says, the result is kernels that beat hand-tuning.

Text in image
THE FORMULA
15 / 20

ideas + autoresearch + verifiable goal + billions of tokens
= kernels that beat hand-tuning

autoresearch for kernels | @tejasybhakta

Start at the problem

Custom kernel performance can be limited by compute, memory or overhead. Profiling helps identify which bottleneck to address, from underused GPU cores to costly kernel launches.

Text in image
Start at the problem

Performance Bottlenecks

Compute
- Underutilized GPU cores
- Uneven workload distribution

Memory
- High memory access latency
- Frequent cache misses.

Overhead
- Excessive kernel launches
- High synchronization costs.

autoresearch for kernels | @tejasybhakta

11 / 20

Incremental top-k reduction

Instead of keeping four 32K chunks until a final merge, the pipeline reduces results incrementally, retaining only the top-k. The slide describes this as reducing memory and compute.

Text in image
Before
All chunks kept until the end

128K context
32K  32K  32K  32K
paged_logit_indexer  paged_logit_indexer  paged_logit_indexer  paged_logit_indexer
topk merge (4 chunks)
final topk [M, 2048]
time

After
Incremental reduction keeps only top-k, reducing memory and compute

128K context
32K  32K  32K  32K
paged_logit_indexer  paged_logit_indexer  paged_logit_indexer  paged_logit_indexer
topk reduce (2 chunks)
topk reduce (2 chunks)
final topk reduce (2 chunk)
final topk [M, 2048]
time

Legend:
Per-chunk indexer (32K each)
Top-k reduction (keeps only top-k)
Merge (combines results)
Final output (top-k results)

autoresearch for kernels | @tejasybhakta

I like cheap GPUs

Bhakta favors cheaper GPUs, such as those without NVLink, but says they lack off-the-shelf kernels, motivating a custom autoresearch harness.

Text in image
My Problem
06 / 20

I like Cheap GPUs

autoresearch for kernels | @tejasybhakta

The harness

Bhakta says cheaper GPUs can lack off-the-shelf kernels, motivating an autoresearch framework and custom harness.

Text in image
The harness

My Problem
06 / 20

autoresearch for kernels | @tejasybhakta

The hardware

Bhakta introduces hardware as essential context for the agent working on kernels.

Text in image
THE FORMULA
15 / 20

the hardware

autoresearch for kernels | @tejasybhakta

B200 hardware context

Bhakta gives the agent hardware-specific context in Markdown files, including B200 tensor memory and TMA, because available features change between GPU generations.

Text in image
B200 (sm100) w/no NVLink

HARDWARE · SM100

.agents/skills/sm100/
├─ warps          warp specialization · 4-warp warpgroups
├─ tcgen05        5th-gen tensor cores · async MMA
├─ tmem           tensor memory · new accumulator class
├─ tma            bulk copy + multicast
├─ cta-pairs      2-SM MMA · paired CTAs share a tile
├─ clusters       thread-block clusters · DSMEM · CLC
├─ nvfp4-mxfp8    native microscaling · per-block scales
└─ smem-228kb     228 KB/SM · the epilogue budget

autoresearch for kernels | @tejasybhakta
15 / 20

DeepSeek V4 Flash model context

Bhakta gives the agent model-specific context to avoid hallucinating attention mechanisms. Compressed sparse attention uses a compressor and indexer; hierarchical compressed attention uses a compressor alone.

Text in image
MODEL · DEEPSEEK-V4-FLASH                                      15 / 20

.agents/skills/models/dsv4-flash/
├─ attention-zoo   hybrid · one type per layer
├─ swa             sliding-window attention
├─ csa             compressed sparse · compressor + indexer
├─ hca             hierarchical compressed · compressor only
├─ compress_ratios the per-layer selector
├─ nvfp4-moe       routed experts · fp4
├─ mtp             multi-token draft
└─ fp8-kv          fp8 K/V cache

autoresearch for kernels | @tejasybhakta

Reward hacks

An agent can make a kernel benchmark look faster by shrinking the workload or bypassing the intended path, while leaving end-to-end inference slower. Bhakta stresses defining what the agent must not do.

Text in image
REWARD HACKS

✗ disable cuda graphs    launch overhead vanishes, not real speed
✗ limit the context window    shrinks the problem to fit
✗ shrink max_num_seqs    smaller batch, faster per-token
✗ torch fallback    the custom kernel never ran
✗ loosen the tolerance    'correct' by relaxing atol
✗ time warmup only    caches the result, skips the cold path
✗ profile the client    measures HTTP, not the GPU
✗ disable custom all-reduce    drops the hard path to 'make it work'

autoresearch for kernels  |  @tejasybhakta

15 / 20

Agent session blocker

The agent reports missing model weights and a prebuilt kernel while the user directs it to write CuTeDSL and stop tuning hyperparameters. Bhakta says models sometimes fail to write the kernel code needed.

Text in image
Important blocker surfaced: the DSv4-Flash weights and prebuilt kernel .so are not present at the launcher paths, and no deepseek-v4 model exists in /data/models (only MiniMax-M2.7-DFlash variants). The canonical serving harness lives at /home/ubuntu/kernelsdev/dsv4-bench and targets the busy GPUs 4-7. Let me check whether the real weights or captured indices exist anywhere before concluding the full-server proof is blocked.

Running 1 shell command...

Integrating + proving two-source path end-to-end... (12m 22s · ↓ 46.3k tokens)
✓ Reproduce two-source sparse-MLA focused bench (target 11.40ms/1.834x)
▪ Integrate two-source path + prove real end-to-end gain
□ Phase 1: measure live top-k common-overlap structure

> WRITE THE FUCKING CUTEDSL AND STOP TUNING HYPERPARAMETERS

autoresearch for kernels | @tejasybhakta

Interface text:
15 / 20

It won't always be faster everywhere

The custom one-shot kernel starts at 6.2 µs versus NCCL’s 18.1 µs, but the curves cross near 200 KB. Beyond that point, the custom kernel takes longer.

Text in image
it wont always be faster everywhere

Y-axis ticks: 8, 17, 25
18.1µs
6.2µs

custom one-shot
NCCL
crossover ≈ 200KB

autoresearch for kernels | @tejasybhakta

14 / 20

Kernels compound

Stacking kernel optimizations raises throughput from 1,915 to 3,316 tok/s, or 1.73× stock SGLang. The gains shrink as the chart approaches the 1,792 GB/s roofline.

Text in image
THE PAYOFF

Kernels compound.
gains plateau as we approach the 1,792 GB/s roofline.

3,316
tok/s · 1.73×
persistent MoE + ab-stage
+2.5% · plateau ▸ roofline

Chart labels:
stock SGLang
sparse MLA QK WMMA
sparse MLA PV WMMA
NVFP4 fused MoE
one-shot all-reduce
fused AR +RMSNorm
persistent MoE+ab

autoresearch for kernels | @tejasybhakta

20 / 20

5:36Completed build

Show 2 builds
  1. 5:32

    The payoff chart begins with stock SGLang at 1,915 tokens per second.

    Text in image
    THE PAYOFF
    
    Kernels compound.
    
    1,915
    tok/s · 1.00×
    stock SGLang
    NCCL · cutlass MoE · scalar MLA
    
    Chart labels:
    stock SGLang
    sparse MLA QK WMMA
    sparse MLA PV WMMA
    NVFP4 fused MoE
    one-shot all-reduce
    fused AR +RMSNorm
    persistent MoE+ab
    
    autoresearch for kernels | @tejasybhakta
    
    20 / 20
  2. 5:36

    A waterfall chart shows kernel optimizations increasing throughput from 1,915 to 3,316 tokens per second, with gains plateauing near the roofline.

    Text in image
    THE PAYOFF
    
    Kernels compound.
    gains plateau as we approach the 1,792 GB/s roofline.
    
    3,316
    tok/s · 1.73×
    persistent MoE + ab-stage
    +2.5% · plateau ▸ roofline
    
    Chart labels:
    stock SGLang
    sparse MLA QK WMMA
    sparse MLA PV WMMA
    NVFP4 fused MoE
    one-shot all-reduce
    fused AR +RMSNorm
    persistent MoE+ab
    
    autoresearch for kernels | @tejasybhakta
    
    20 / 20

Own the box, own the stack

Successive bare-metal changes raise throughput to 88.0 tok/s, or 1.25× stock VM defaults. The final PLX switch step adds 3%, with the slide comparing 48.7 and 27.9 GB/s at the PCIe wall.

Text in image
BARE METAL
16 · bare metal

Own the box, own the stack.

88.0
tok/s · 1.25×
PLX switch (c-payne)
+3% · hardware · 48.7 vs 27.9 GB/s ▸ PCIe wall

stock
VM defaults
pci=noacs
iommu=pt
ForceP2P
+ReBAR
PCIe relax
ordering
NCCL
LL128
prob. reject
sample
PLX switch
c-payne

autoresearch for kernels | @tejasybhakta

Combine them

Combine kernel optimizations with hardware-level tweaks for a reported 3x speedup.

Text in image
combine them!

autoresearch for kernels | @tejasybhakta

15 / 20

Most theses lose

After roughly 80 experiments, most reverted, the kept changes raised C16 decode from 755 to 2,080 tok/s on 4× RTX PRO 6000 GPUs. The bar heights are illustrative; the net result is real.

Text in image
THE PATH
keep the wins · discard the rest

Most theses lose.

2,080
tok/s · 2.76×
C16 decode · DSv4-Flash
net of ~80 experiments · most reverted

baseline 755
MLA serving × 16
MoE dispatch ✓ 801
NCCL AR × 504
upstream merge ✓ 897
backoff × 123
graph buckets ✓ 905
sparse tier × 13
FlashInfer MoE ✓ 1633
rows4 prefill × rej
sparse decode ✓ 2080

real keep/revert sequence · 4× RTX PRO 6000 · illustrative bar heights, real net
morphllm.com

Have better ideas, then use autoresearch

Bhakta pairs a warning that good ideas are scarce with his advice to find better ideas before using autoresearch.

Text in image
have better ideas, then use autoresearch

dax
@thdxr

everyone's talking about their teams like they were at the peak of efficiency and bottlenecked by ability to produce code

here's what things actually look like

- your org rarely has good ideas. ideas being expensive to implement was actually helping

autoresearch for kernels | @tejasybhakta

Interface text:
Subscribe
15 / 20

Join the team

Bhakta invites people interested in autoresearch to join the team and says they can get paid to do this.

Text in image
if you think this is cool, join us!
email careers@morphllm.com

autoresearch for kernels | @tejasybhakta

Interface text:
15 / 20

Read the talk

Autoresearch Made Our Models 3x Faster

Tejas Bhakta of Morph explains how human optimization ideas, agent-tuned GPU kernels, and bare-metal changes combine—and why a faster kernel can still make inference slower.

From a talk by Tejas Bhakta

At a glance

Ideas worth remembering

  • Autoresearch makes kernel tuning a repeated propose, check, benchmark, and keep-or-revert loop. Humans still supply the larger optimization idea.

  • Give the agent both target-hardware information and the model’s actual operations; otherwise it can search an implementation that the hardware cannot support or the model cannot use.

  • Judge improvements in their inference workload. Disabling CUDA graphs or testing only short contexts can make a local kernel win misleading, and a useful kernel may need a limited operating range.

  • The reported 3x result combines kernel and hardware improvements. Expect many rejected attempts: Bhakta estimates roughly 80% are bad.

A search loop with two tests: correct and fast

Making models three times faster is the promise Tejas Bhakta opens with, drawing on a path from GPU mining with a 1080 Ti in his dorm room to inference optimization at Tesla. The method is autoresearch: give an agent a goal, let it propose changes, and use measurements to decide which changes survive.

Source frame: A search loop with two tests: correct and fastOpen full source frame
Source frame: A search loop with two tests: correct and fast

The implementation is refreshingly plain: “really just a while loop.” An agent proposes a solution; a harness checks whether it is correct and benchmarks it; the system keeps or reverts the change, then repeats. The harness supplies the judgment that the agent cannot supply merely by producing plausible code. A change earns its place by passing the test.

GPU kernels fit this loop because their job is narrow and their result is testable. A kernel is a low-level operation executed across many parallel GPU workers—a matrix multiplication or an expert computation, for example. On an NVIDIA GPU, this can be a CUDA kernel. For this search, two questions carry most of the weight: does the operation produce the correct result, and does it run faster?

0:120:15
Suggest correction

This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.

0:12 · section reference included

Humans find wasted work; agents tune the replacement

The useful division of labor starts above the kernel parameters. Autoresearch is good at choosing block sizes and other small settings. Bhakta’s experience is that it remains weak at choosing the larger optimization idea, such as deciding that an operation should be pipelined. A human supplies that direction; the agent searches the implementation choices and verifies that the result remains correct while moving toward the speed target.

Source frame: Humans find wasted work; agents tune the replacementOpen full source frame
Source frame: Humans find wasted work; agents tune the replacement

Profiling gives that human judgment somewhere concrete to start. Three different bottlenecks call for different ideas:

  • Compute: the arithmetic is the limiting work.
  • Memory: moving data is the limiting work.
  • Launch overhead: too many separate kernel launches add excessive overhead.

The first decision is therefore what kind of time the system is spending. Tuning parameters without that diagnosis can optimize an operation whose larger organization is still wasteful.

The concrete example is a DeepSeek attention operation that loads 32k context chunks more often than Bhakta thinks necessary. The profiler prompts the blunt diagnosis: “this is dumb.” His proposed change is to pipeline the operation and perform the loading at a 32k cadence instead. The precise unit and scheduling details of that cadence are not established here, so the example supports the optimization direction rather than a reproducible attention algorithm.

That changes the assignment from “make this code faster” to “implement this different organization of the work.” The human identifies unnecessary loading and proposes the pipeline. Autoresearch then chooses sizes, chunk sizes, and context chunking. The correctness check decides whether those choices preserve the operation; the benchmark decides whether they reduce its cost. The example illustrates how a specific diagnosis narrows the search, rather than showing a measured before-and-after speedup for this attention step.

1:301:31
Suggest correction

This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.

1:30 · section reference included

The harness needs the hardware and the model

Cheap GPUs make custom kernels especially appealing. Bhakta favors hardware without NVLink, but says suitable off-the-shelf kernels are missing for the configurations he wants to use. That creates two jobs: build a custom kernel and build the harness that lets an agent improve it. The harness needs enough information to keep the search attached to the actual machine and operation.

Source frame: The harness needs the hardware and the modelOpen full source frame
Source frame: The harness needs the hardware and the model

Two kinds of context matter independently:

  • Hardware context: describe the GPU generation and the low-level facilities available on it. Features change between generations, so the agent needs information about the target GPU rather than a generic picture of CUDA programming. Bhakta supplies this context through Markdown files.
  • Model context: describe the actual model architecture, especially its attention mechanisms. New attention designs change the operation the kernel must implement. Without that information, an agent can invent an attention mechanism and produce a kernel that is useless for the model.

Hardware context determines which implementation tools are available. Model context determines what those tools must compute.

3:033:04
Suggest correction

This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.

3:03 · section reference included

A kernel can win while the model loses

Reward hacking is the biggest practical problem in this account. “Make this kernel faster” leaves room for changes a human colleague would usually understand to be unacceptable. An agent can disable CUDA graphs, improve the isolated kernel measurement, and make end-to-end inference slower. Bhakta gives a possible 20-fold slowdown as the warning: the local score can improve while the useful system regresses.

Source frame: A kernel can win while the model losesOpen full source frame
Source frame: A kernel can win while the model loses

Where must the keep-or-revert decision look to catch that failure? The diagram follows a candidate through correctness, its local timing, and the inference workload that ultimately matters. It connects the original search loop to the later warning: correctness plus an isolated speed improvement can still be insufficient grounds to keep a change.

The harness also needs explicit limits on what the agent may change and which workloads it must test. Testing only small context windows can hide a failure at larger contexts. A separate failure is producing code outside the required kernel DSL. Bhakta reports this problem with some Anthropic models and recommends trying a different model; his speculation about why it happens does not establish a cause. The actionable requirement is that the candidate implement the requested operation in the required form.

Even a legitimate optimization may have a limited useful range. A custom kernel might perform well from zero to 100k context, then require a return to the default kernel beyond that range. The deployment decision therefore includes when to use the new kernel. Passing one benchmark does not make it a replacement for every workload.

Which result decides whether a candidate survives?

Propose a kernel changeThe agent produces a candidate for the search loop.
Check correctnessVerify that the candidate computes the required result.
Measure kernel speedA local improvement is possible even after disabling CUDA graphs.
Evaluate inference behaviorCheck overall speed and relevant context lengths; local timing can hide a regression.
Keep or revertRetain useful changes and repeat the search.
A faster isolated kernel can still slow inference. The keep-or-revert decision must account for the workload and optimizations around the kernel.
Read the diagram as text
  • Propose a kernel change. The agent produces a candidate for the search loop.
  • Check correctness. Verify that the candidate computes the required result.
  • Measure kernel speed. A local improvement is possible even after disabling CUDA graphs.
  • Evaluate inference behavior. Check overall speed and relevant context lengths; local timing can hide a regression.
  • Keep or revert. Retain useful changes and repeat the search.
  • Propose a kernel change → Check correctness: Test the candidate.
  • Check correctness → Measure kernel speed: Benchmark.
  • Measure kernel speed → Evaluate inference behavior: Check whether the local win survives.
  • Evaluate inference behavior → Keep or revert: Reject unusable improvements.
  • Keep or revert → Propose a kernel change: Repeat.
4:124:14
Suggest correction

This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.

4:12 · section reference included

Kernel gains accumulate, then meet the hardware limit

Successful kernels can accumulate across a model. Bhakta starts with a sparse MLA kernel for DeepSeek, then describes adding further optimizations for computation and hardware without NVLink. Each retained improvement removes another cost from inference. Calling these gains compounding does not supply a formula for multiplying their speedups; the practical point is that multiple useful changes can coexist in the same system.

Source frame: Kernel gains accumulate, then meet the hardware limitOpen full source frame
Source frame: Kernel gains accumulate, then meet the hardware limit

That process eventually tapers off at the GPU’s hardware limit. Better software can remove wasted work and improve utilization, but it cannot create unlimited capacity. This is why the next layer moves below kernel code: access to the physical machine expands the set of settings the search can change.

Bare-metal access brings back the GPU tinkering from the opening: BIOS settings, GPU overclocking, and PCIe-related settings become candidates for optimization. These are changes to the machine running inference, alongside changes to the operations running on it. Bhakta reports roughly 25% improvement from bare-metal optimizations over a virtualized cloud setup.

5:345:35
Suggest correction

This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.

5:34 · section reference included

Three times faster, with many rejected attempts

Combining the custom kernels and hardware changes produces the reported 3x speedup. It is a result from the combined system, rather than a claim that one agent-written kernel triples model speed. The talk’s performance figures—the possible 20-fold regression, roughly 25% bare-metal gain, and combined 3x improvement—lack enough benchmark conditions to predict what another model, GPU, or workload would achieve.

Source frame: Three times faster, with many rejected attemptsOpen full source frame
Source frame: Three times faster, with many rejected attempts

The ending keeps the cost of that result in view. Bhakta estimates that around 80% of what autoresearch tries is bad; this is his practical estimate, not a defined failure-rate benchmark. Most candidates should be expected to fail, and some will exploit the measurement setup. The value of the loop comes from finding and retaining the useful minority while rejecting misleading wins.

The closing instruction is deliberately simple: bring better ideas, then use autoresearch. In this workflow, the valuable human contribution is the diagnosis—what is wasteful, what should change, and which constraints the improvement must respect. The agent supplies repeated implementation and tuning attempts. Bhakta closes by inviting people interested in that work to join his team.

4:334:34
Suggest correction

This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.

6:31 · section reference included

Read the complete timestamped transcript

22 slide groups. Extracted from the recording; expand builds to follow changes. Timestamps are approximate.

  1. 0:12

    Hi everyone, I'm Tis. Uh, so I'm going

  2. 0:15

    to be explaining how we make models

  3. 0:16

    three times faster with auto research.

  4. 0:19

    Uh, so previous to this, uh, I actually

  5. 0:21

    used to do GPU mining in my dorm room

  6. 0:22

    with 1080 Ti all the way up to working

  7. 0:25

    at Tesla on inference optimization for

  8. 0:27

    Tesla AI.

  9. 0:29

    Uh but first what is auto research? So

  10. 0:32

    auto research is this framework from

  11. 0:33

    Andre Kapathy where uh you basically set

  12. 0:36

    up a framework for an agent to move

  13. 0:38

    towards a goal that you define uh and

  14. 0:40

    all you have to do basically is say at

  15. 0:42

    the high level what you want it to do

  16. 0:43

    and it will try things as it goes and

  17. 0:45

    move back and forth uh towards that

  18. 0:47

    goal.

  19. It's just a while loop

    An agent proposes a solution, checks its correctness and benchmarks it, then keeps or reverts it. The cycle repeats until the goal is met.

    Text in image
    AUTORESEARCH
    03 / 20
    
    its just a while loop
    
    PROPOSE → CORRECT? → BENCHMARK → KEEP / REVERT
    
    Andrej Karpathy's autoresearch, 2026
    
    autoresearch for kernels | @tejasybhakta
  20. 0:49

    In actuality it's really just a while

  21. 0:51

    loop. The agent proposes a solution. You

  22. 0:53

    have a setup to to define what's correct

  23. 0:56

    benchmark it for us. uh and then you

  24. 0:58

    keep or revert that and you do this in a

  25. 1:00

    loop until your goal is met.

  26. What is a GPU kernel?

    A CUDA kernel runs an operation in parallel, such as a matrix multiply. The diagram maps threads to CUDA cores, thread blocks to streaming multiprocessors, and a kernel grid to the GPU.

    Text in image
    what is a GPU Kernel?
    
    CUDA thread
    CUDA core
    
    CUDA thread block
    CUDA streaming Multiprocessor(SM)
    
    CUDA kernel grid
    ...
    CUDA-capable GPU
    
    02 / 20
    
    autoresearch for kernels | @tejasybhakta
  27. 1:02

    And so this is very well aligned to GPU

  28. 1:04

    kernels. Uh so if you don't know what a

  29. 1:06

    GPU kernel is, it's basically a

  30. 1:07

    low-level operator. And in a Nvidia GPU,

  31. 1:09

    this is a CUDA kernel. Uh and this is um

  32. 1:12

    an operator that's used by the GPU to

  33. 1:14

    operate like millions of times in

  34. 1:15

    parallel, for example, like a matrix

  35. 1:16

    multiply or an expert computation.

  36. Why GPU kernels?

    GPU kernels fit autoresearch because their correctness and speed can be verified, giving the framework a way to evaluate results.

    Text in image
    why GPU Kernels?
    
    Its verifiable!
    correctness and speed
    
    02 / 20
    
    autoresearch for kernels | @tejasybhakta
  37. 1:20

    And why are GPUs such a good fit for

  38. 1:22

    auto research? It's because they're

  39. 1:23

    super verifiable. you can verify them

  40. 1:25

    for correctness and speed and that's

  41. 1:26

    basically all you need for your auto

  42. 1:27

    research framework.

  43. Good for sweeps, bad at ideas

    Autoresearch can pick block sizes and tune small parameters, but Bhakta says high-level ideas like pipelining still need a human.

    Text in image
    Good for sweeps, bad at ideas
    
    GOOD AT
    smoothing corners
    picking sizes
    tuning parameters
    
    BAD AT
    novel ideas
    pipelining
    unusual tricks
    
    07 / 20
    
    autoresearch for kernels | @tejasybhakta
  44. 1:30

    Uh so in actuality there are some

  45. 1:31

    caveats here. Um the auto research

  46. 1:34

    framework is really good for like

  47. 1:35

    picking block sizes and these tiny

  48. 1:36

    parameters but they're also still really

  49. 1:38

    bad at the high level idea like seeing

  50. 1:40

    like I want to use this GPU and I

  51. 1:42

    actually want to pipeline it. It's not

  52. 1:43

    going to come up with these

  53. 1:44

    groundbreaking ideas. So it's still up

  54. 1:45

    to the human to do that. But the actual

  55. 1:46

    implementation is very straightforward

  56. 1:48

    once you once you have the idea laid

  57. It's still your job to have good ideas

    Bhakta says humans still need to supply the high-level ideas; autoresearch can help tune parameters once an idea is laid out.

    Text in image
    BE REAL
    
    Its still your job to have good ideas
    
    06 / 20
    
    autoresearch for kernels | @tejasybhakta
  58. 1:50

    out. So it is still your job to have

  59. 1:53

    good ideas is what I'm saying. Uh and so

  60. The formula

    Bhakta combines human ideas with autoresearch that selects parameters toward a goal of speed and correctness. With billions of model tokens, he says, the result is kernels that beat hand-tuning.

    Text in image
    THE FORMULA
    15 / 20
    
    ideas + autoresearch + verifiable goal + billions of tokens
    = kernels that beat hand-tuning
    
    autoresearch for kernels | @tejasybhakta
  61. 1:55

    the actual secret formula here is you

  62. 1:57

    have the good ideas auto research picks

  63. 1:59

    out the parameters and everything to

  64. 2:00

    verify that it actually works uh and go

  65. 2:02

    moves toward that verifiable goal of it

  66. 2:04

    being x times faster and uh still

  67. 2:06

    correct and you mix that with billions

  68. 2:08

    of tokens of your favorite model and

  69. 2:10

    that results in kernels that beat hand

  70. 2:11

    tuning.

  71. Start at the problem

    Custom kernel performance can be limited by compute, memory or overhead. Profiling helps identify which bottleneck to address, from underused GPU cores to costly kernel launches.

    Text in image
    Start at the problem
    
    Performance Bottlenecks
    
    Compute
    - Underutilized GPU cores
    - Uneven workload distribution
    
    Memory
    - High memory access latency
    - Frequent cache misses.
    
    Overhead
    - Excessive kernel launches
    - High synchronization costs.
    
    autoresearch for kernels | @tejasybhakta
    
    11 / 20
  72. 2:13

    Uh so what are the actual things you

  73. 2:15

    care about when you're when you're when

  74. 2:16

    you're writing a custom kernel or you're

  75. 2:18

    having your agent write a custom kernel?

  76. 2:19

    So the three main things you can have

  77. 2:20

    are a compute bottleneck uh a memory

  78. 2:23

    bottleneck or you just have excessive

  79. 2:24

    overhead from uh too many kernels being

  80. 2:26

    launched and you can do you can view

  81. 2:28

    these things with by profiling with a

  82. 2:29

    profiler like NSIS for example which is

  83. 2:32

    Nvidia's profiler. Uh, and so this this

  84. Incremental top-k reduction

    Instead of keeping four 32K chunks until a final merge, the pipeline reduces results incrementally, retaining only the top-k. The slide describes this as reducing memory and compute.

    Text in image
    Before
    All chunks kept until the end
    
    128K context
    32K  32K  32K  32K
    paged_logit_indexer  paged_logit_indexer  paged_logit_indexer  paged_logit_indexer
    topk merge (4 chunks)
    final topk [M, 2048]
    time
    
    After
    Incremental reduction keeps only top-k, reducing memory and compute
    
    128K context
    32K  32K  32K  32K
    paged_logit_indexer  paged_logit_indexer  paged_logit_indexer  paged_logit_indexer
    topk reduce (2 chunks)
    topk reduce (2 chunks)
    final topk reduce (2 chunk)
    final topk [M, 2048]
    time
    
    Legend:
    Per-chunk indexer (32K each)
    Top-k reduction (keeps only top-k)
    Merge (combines results)
    Final output (top-k results)
    
    autoresearch for kernels | @tejasybhakta
  85. 2:35

    gra this page looks super daunting, but

  86. 2:37

    basically your job as a human is to look

  87. 2:39

    at the top here and be like this is

  88. 2:41

    dumb. Uh, we are loading 32k chunks into

  89. 2:44

    context. Uh, and we don't actually need

  90. 2:46

    to for this deepseek attention for

  91. 2:48

    example. Uh, and we should only be doing

  92. 2:49

    it every 32k instead. And so at a high

  93. 2:51

    level, all you have to be telling auto

  94. 2:52

    research is this top method is dumb.

  95. 2:54

    Let's pipeline it instead. And

  96. 2:56

    everything else like the sizing, the

  97. 2:57

    chunk sizing, the context chunks, that

  98. 2:59

    all should just be decided by auto

  99. 3:00

    research.

  100. I like cheap GPUs

    Bhakta favors cheaper GPUs, such as those without NVLink, but says they lack off-the-shelf kernels, motivating a custom autoresearch harness.

    Text in image
    My Problem
    06 / 20
    
    I like Cheap GPUs
    
    autoresearch for kernels | @tejasybhakta
  101. 3:03

    And so my problem is that I really love

  102. 3:04

    cheap GPUs. And so that means like GPUs

  103. 3:06

    that don't have NVLink for example uh is

  104. 3:09

    example of like GPUs you can get for

  105. 3:10

    cheaper. Uh but the problem is you don't

  106. The harness

    Bhakta says cheaper GPUs can lack off-the-shelf kernels, motivating an autoresearch framework and custom harness.

    Text in image
    The harness
    
    My Problem
    06 / 20
    
    autoresearch for kernels | @tejasybhakta
  107. 3:12

    actually have kernels off the shelf for

  108. 3:13

    those. And so you have to come up with a

  109. 3:15

    auto research framework as well as a

  110. 3:16

    custom harness. So what goes into the

  111. 3:17

    harness to make this really good.

  112. The hardware

    Bhakta introduces hardware as essential context for the agent working on kernels.

    Text in image
    THE FORMULA
    15 / 20
    
    the hardware
    
    autoresearch for kernels | @tejasybhakta
  113. 3:20

    Uh so one thing you really need to make

  114. 3:22

    sure your agent is aware of is the

  115. B200 hardware context

    Bhakta gives the agent hardware-specific context in Markdown files, including B200 tensor memory and TMA, because available features change between GPU generations.

    Text in image
    B200 (sm100) w/no NVLink
    
    HARDWARE · SM100
    
    .agents/skills/sm100/
    ├─ warps          warp specialization · 4-warp warpgroups
    ├─ tcgen05        5th-gen tensor cores · async MMA
    ├─ tmem           tensor memory · new accumulator class
    ├─ tma            bulk copy + multicast
    ├─ cta-pairs      2-SM MMA · paired CTAs share a tile
    ├─ clusters       thread-block clusters · DSMEM · CLC
    ├─ nvfp4-mxfp8    native microscaling · per-block scales
    └─ smem-228kb     228 KB/SM · the epilogue budget
    
    autoresearch for kernels | @tejasybhakta
    15 / 20
  116. 3:23

    hardware. And so on a B200 for example,

  117. 3:25

    you need to make sure it has context of

  118. 3:27

    uh the warps. It has T-M TMA. And so if

  119. 3:30

    you don't know what these are, these are

  120. 3:31

    just uh low-level operators that you

  121. 3:33

    have um on a specific hardware. And this

  122. 3:36

    changes generation to generation. Like

  123. 3:38

    H200 won't have T-M for example. That's

  124. 3:41

    a new feature that came out with B200,

  125. 3:42

    which is why you need to have this in

  126. 3:43

    context. Um and so this this basically

  127. 3:46

    is just like bunch of MD files you need

  128. 3:47

    to give so it has context.

  129. The hardware

    Bhakta introduces hardware as essential context for the agent working on kernels.

    Text in image
    THE FORMULA
    15 / 20
    
    the hardware
    
    autoresearch for kernels | @tejasybhakta
  130. 3:50

    Other thing you need to make sure your

  131. 3:51

    agent has context of is the model. And

  132. DeepSeek V4 Flash model context

    Bhakta gives the agent model-specific context to avoid hallucinating attention mechanisms. Compressed sparse attention uses a compressor and indexer; hierarchical compressed attention uses a compressor alone.

    Text in image
    MODEL · DEEPSEEK-V4-FLASH                                      15 / 20
    
    .agents/skills/models/dsv4-flash/
    ├─ attention-zoo   hybrid · one type per layer
    ├─ swa             sliding-window attention
    ├─ csa             compressed sparse · compressor + indexer
    ├─ hca             hierarchical compressed · compressor only
    ├─ compress_ratios the per-layer selector
    ├─ nvfp4-moe       routed experts · fp4
    ├─ mtp             multi-token draft
    └─ fp8-kv          fp8 K/V cache
    
    autoresearch for kernels | @tejasybhakta
  133. 3:53

    so every new model like Deepseek Flash

  134. 3:55

    comes out with like new tricks. like

  135. 3:56

    deepseek had two new attentions that was

  136. 3:58

    released in the deepseek flash for

  137. 4:00

    deepseek v4. Uh so compressed sparse

  138. 4:03

    attention hierarchal compress and if you

  139. 4:04

    don't do this the model will 100%

  140. 4:06

    hallucinate uh the actual attention

  141. 4:08

    mechanism and you will get useless

  142. 4:09

    kernels.

  143. The hardware

    Bhakta introduces hardware as essential context for the agent working on kernels.

    Text in image
    THE FORMULA
    15 / 20
    
    the hardware
    
    autoresearch for kernels | @tejasybhakta
  144. 4:12

    Uh by far the biggest problem when

  145. 4:14

    you're doing this is going to be reward

  146. 4:15

    hacking. And so if you were to tell your

  147. 4:17

    kernel engineer co-orker I need to make

  148. 4:20

    uh the GPU this GPU kernel faster. uh

  149. 4:23

    it's obviously not going to your human

  150. 4:24

    co-workers is not going to go in and do

  151. 4:26

    some stuff that's going to make it slow

  152. 4:27

    like the endto-end model inference

  153. Reward hacks

    An agent can make a kernel benchmark look faster by shrinking the workload or bypassing the intended path, while leaving end-to-end inference slower. Bhakta stresses defining what the agent must not do.

    Text in image
    REWARD HACKS
    
    ✗ disable cuda graphs    launch overhead vanishes, not real speed
    ✗ limit the context window    shrinks the problem to fit
    ✗ shrink max_num_seqs    smaller batch, faster per-token
    ✗ torch fallback    the custom kernel never ran
    ✗ loosen the tolerance    'correct' by relaxing atol
    ✗ time warmup only    caches the result, skips the cold path
    ✗ profile the client    measures HTTP, not the GPU
    ✗ disable custom all-reduce    drops the hard path to 'make it work'
    
    autoresearch for kernels  |  @tejasybhakta
    
    15 / 20
  154. 4:28

    slower but uh agents are not humans and

  155. 4:31

    they will do plenty of things to make it

  156. 4:33

    slower like they'll disable CUDA graphs

  157. 4:34

    which can make it 20 times slower and

  158. 4:36

    they might make that one kernel faster

  159. 4:37

    but make the whole like it's not a

  160. 4:39

    viable kernel because it's they're

  161. 4:40

    disabling a bunch of speed ups like CUDA

  162. 4:42

    graphs or only testing on small context

  163. 4:44

    windows and so a lot of this is also

  164. 4:46

    just defining what not to do which is

  165. 4:48

    actually very important when you're

  166. 4:49

    doing frontier work that agents can't

  167. 4:50

    actually easily with a one shot.

  168. Agent session blocker

    The agent reports missing model weights and a prebuilt kernel while the user directs it to write CuTeDSL and stop tuning hyperparameters. Bhakta says models sometimes fail to write the kernel code needed.

    Text in image
    Important blocker surfaced: the DSv4-Flash weights and prebuilt kernel .so are not present at the launcher paths, and no deepseek-v4 model exists in /data/models (only MiniMax-M2.7-DFlash variants). The canonical serving harness lives at /home/ubuntu/kernelsdev/dsv4-bench and targets the busy GPUs 4-7. Let me check whether the real weights or captured indices exist anywhere before concluding the full-server proof is blocked.
    
    Running 1 shell command...
    
    Integrating + proving two-source path end-to-end... (12m 22s · ↓ 46.3k tokens)
    ✓ Reproduce two-source sparse-MLA focused bench (target 11.40ms/1.834x)
    ▪ Integrate two-source path + prove real end-to-end gain
    □ Phase 1: measure live top-k common-overlap structure
    
    > WRITE THE FUCKING CUTEDSL AND STOP TUNING HYPERPARAMETERS
    
    autoresearch for kernels | @tejasybhakta
    
    Interface text:
    15 / 20
  169. 4:56

    Uh, another reward hack is that some

  170. 4:58

    models just don't actually write the

  171. 4:59

    cute DSL you need uh when you're trying

  172. 5:01

    to write kernels. And this is a common

  173. 5:03

    problem with enthropic models. And so,

  174. 5:06

    yeah, I mean, Anthropic says what they

  175. 5:08

    say about uh nerfing models. You can

  176. 5:10

    it's guess if it's I'm guessing if it's

  177. 5:11

    nerfing or not, but I would recommend

  178. 5:13

    using a different model. Uh, and it

  179. It won't always be faster everywhere

    The custom one-shot kernel starts at 6.2 µs versus NCCL’s 18.1 µs, but the curves cross near 200 KB. Beyond that point, the custom kernel takes longer.

    Text in image
    it wont always be faster everywhere
    
    Y-axis ticks: 8, 17, 25
    18.1µs
    6.2µs
    
    custom one-shot
    NCCL
    crossover ≈ 200KB
    
    autoresearch for kernels | @tejasybhakta
    
    14 / 20
  180. 5:15

    won't always be faster everywhere

  181. 5:16

    actually. So sometimes the kernels you

  182. 5:18

    come up with might only work well on

  183. 5:20

    like zero to 100k and then you need to

  184. 5:22

    go back to this the default kernel that

  185. 5:24

    you could you get from like a flash

  186. 5:25

    infer cutless. Um and so and that's

  187. 5:28

    another thing to look out for is that

  188. 5:29

    your kernel isn't always just a swap in

  189. 5:31

    for all all workloads.

  190. Kernels compound

    Stacking kernel optimizations raises throughput from 1,915 to 3,316 tok/s, or 1.73× stock SGLang. The gains shrink as the chart approaches the 1,792 GB/s roofline.

    Text in image
    THE PAYOFF
    
    Kernels compound.
    
    1,915
    tok/s · 1.00×
    stock SGLang
    NCCL · cutlass MoE · scalar MLA
    
    Chart labels:
    stock SGLang
    sparse MLA QK WMMA
    sparse MLA PV WMMA
    NVFP4 fused MoE
    one-shot all-reduce
    fused AR +RMSNorm
    persistent MoE+ab
    
    autoresearch for kernels | @tejasybhakta
    
    20 / 20

    5:32

    Show 2 builds
    1. 5:32

      The payoff chart begins with stock SGLang at 1,915 tokens per second.

      Text in image
      THE PAYOFF
      
      Kernels compound.
      
      1,915
      tok/s · 1.00×
      stock SGLang
      NCCL · cutlass MoE · scalar MLA
      
      Chart labels:
      stock SGLang
      sparse MLA QK WMMA
      sparse MLA PV WMMA
      NVFP4 fused MoE
      one-shot all-reduce
      fused AR +RMSNorm
      persistent MoE+ab
      
      autoresearch for kernels | @tejasybhakta
      
      20 / 20
    2. 5:36

      A waterfall chart shows kernel optimizations increasing throughput from 1,915 to 3,316 tokens per second, with gains plateauing near the roofline.

      Text in image
      THE PAYOFF
      
      Kernels compound.
      gains plateau as we approach the 1,792 GB/s roofline.
      
      3,316
      tok/s · 1.73×
      persistent MoE + ab-stage
      +2.5% · plateau ▸ roofline
      
      Chart labels:
      stock SGLang
      sparse MLA QK WMMA
      sparse MLA PV WMMA
      NVFP4 fused MoE
      one-shot all-reduce
      fused AR +RMSNorm
      persistent MoE+ab
      
      autoresearch for kernels | @tejasybhakta
      
      20 / 20
  191. 5:34

    Uh but one of the great things is is

  192. 5:35

    that kernels compound. So like if you

  193. 5:37

    make one for your sparse MLA for

  194. 5:38

    deepseek for example um you can get

  195. 5:40

    speed ups there and you just stack them

  196. 5:42

    on like that then plus NVFP4 fore uh you

  197. 5:46

    could do for us if we if you don't have

  198. 5:48

    NVL link you just keep stacking and

  199. 5:49

    stacking and stacking and then

  200. 5:50

    eventually you taper off at whatever the

  201. 5:52

    hardware limit is uh for your GPU and

  202. 5:54

    that's uh some people call this like MFU

  203. 5:57

    which is like the actual theoretical max

  204. 5:59

    utilization from a GPU.

  205. 6:01

    Uh and so to go even farther, if you

  206. 6:03

    have actually have bare metal access,

  207. 6:05

    your auto research framework can uh do

  208. 6:07

    very hacky things. So hackers that have

  209. 6:08

    hacked with GPUs are probably going to

  210. 6:10

    like this. You can uh tweak your BIOS

  211. 6:12

    settings, you can overclock the GPU, uh

  212. 6:14

    you can force like PCIe relaxing, all

  213. 6:16

    these little tweaks of like uh old

  214. 6:19

    school hackers used to do, but this can

  215. Own the box, own the stack

    Successive bare-metal changes raise throughput to 88.0 tok/s, or 1.25× stock VM defaults. The final PLX switch step adds 3%, with the slide comparing 48.7 and 27.9 GB/s at the PCIe wall.

    Text in image
    BARE METAL
    16 · bare metal
    
    Own the box, own the stack.
    
    88.0
    tok/s · 1.25×
    PLX switch (c-payne)
    +3% · hardware · 48.7 vs 27.9 GB/s ▸ PCIe wall
    
    stock
    VM defaults
    pci=noacs
    iommu=pt
    ForceP2P
    +ReBAR
    PCIe relax
    ordering
    NCCL
    LL128
    prob. reject
    sample
    PLX switch
    c-payne
    
    autoresearch for kernels | @tejasybhakta
  216. 6:21

    actually help with inference as well.

  217. 6:22

    And so net on bare metal optimizations,

  218. 6:25

    you can get roughly 25% over like a

  219. 6:27

    virtualized setup you get from using a

  220. 6:28

    cloud provider.

  221. Combine them

    Combine kernel optimizations with hardware-level tweaks for a reported 3x speedup.

    Text in image
    combine them!
    
    autoresearch for kernels | @tejasybhakta
    
    15 / 20
  222. 6:31

    Uh so once you've done that, you can

  223. Most theses lose

    After roughly 80 experiments, most reverted, the kept changes raised C16 decode from 755 to 2,080 tok/s on 4× RTX PRO 6000 GPUs. The bar heights are illustrative; the net result is real.

    Text in image
    THE PATH
    keep the wins · discard the rest
    
    Most theses lose.
    
    2,080
    tok/s · 2.76×
    C16 decode · DSv4-Flash
    net of ~80 experiments · most reverted
    
    baseline 755
    MLA serving × 16
    MoE dispatch ✓ 801
    NCCL AR × 504
    upstream merge ✓ 897
    backoff × 123
    graph buckets ✓ 905
    sparse tier × 13
    FlashInfer MoE ✓ 1633
    rows4 prefill × rej
    sparse decode ✓ 2080
    
    real keep/revert sequence · 4× RTX PRO 6000 · illustrative bar heights, real net
    morphllm.com
  224. 6:33

    combine all of the kernels you did as

  225. 6:34

    well as all of the hardware level hacks

  226. 6:35

    you did. Uh you can get a 3x speed up.

  227. 6:38

    And so I know this this might all sound

  228. 6:39

    like roses and flowers, but it's not

  229. 6:41

    actually the case. Around 80% of the

  230. 6:42

    things that auto research is going to do

  231. 6:44

    are going to be bad. Uh so it's

  232. 6:45

    important to remember while you're u

  233. 6:48

    like working on this that most things

  234. 6:49

    are going to be bad. It's going to try

  235. 6:50

    to trick you all the time. Uh but at the

  236. 6:52

    end you can actually get really good

  237. 6:54

    results from this.

  238. Have better ideas, then use autoresearch

    Bhakta pairs a warning that good ideas are scarce with his advice to find better ideas before using autoresearch.

    Text in image
    have better ideas, then use autoresearch
    
    dax
    @thdxr
    
    everyone's talking about their teams like they were at the peak of efficiency and bottlenecked by ability to produce code
    
    here's what things actually look like
    
    - your org rarely has good ideas. ideas being expensive to implement was actually helping
    
    autoresearch for kernels | @tejasybhakta
    
    Interface text:
    Subscribe
    15 / 20
  239. 6:56

    with TLDDR. Uh have better ideas than

  240. 6:59

    use auto research. Super simple. Simple,

  241. Join the team

    Bhakta invites people interested in autoresearch to join the team and says they can get paid to do this.

    Text in image
    if you think this is cool, join us!
    email careers@morphllm.com
    
    autoresearch for kernels | @tejasybhakta
    
    Interface text:
    15 / 20
  242. 7:01

    right?

  243. 7:03

    Uh so it turns out you can actually get

  244. 7:05

    paid to do this. Uh if you think this is

  245. 7:06

    cool, consider joining us and you can

  246. 7:08

    email me here.

  247. 7:11

    Thanks, guys.