AI Engineer World's Fair 2026
Can LLMs Write Fast Multi-GPU Kernels? — Simran Arora, Together AI
Read the talk
Can LLMs Write Fast Multi-GPU Kernels?
Simran Arora explains why communication has become a limiting resource in many production distributed training and inference workloads, distills multi-GPU kernel design into transfer and scheduling choices, and tests whether models can make those choices across 87 practical problems.
From a talk by Simran Arora
At a glance
Ideas worth remembering
Communication now deserves explicit optimization: the reported A100-to-B200 gains are 7.2× for BF16 compute, 3× for intra-node communication, and 2× for inter-node communication.
Fast multi-GPU kernels match the transfer path to message size, GPU resource use, desired overlap, and any need for in-network reduction.
Scheduling is operation-specific: intra-SM overlap works when computation and communication align around the same data, while inter-SM specialization helps when their resources or communication patterns diverge.
Correctness and speed are separate benchmark outcomes. The best zero-shot result is 28 correct kernels out of 87, with 22 faster than the reference; more samples reach 36 correct while correct-and-faster performance plateaus near 31%.
A shell-equipped agent harness improves iteration—Gemini 3 Pro reaches 35 solved problems and 26 faster solutions—but ordering, partitioning, scheduling, and transfer selection remain difficult after compilation errors are repaired.
Limited aggregate coverage can still yield useful kernels, including the reported NeMo, Hyena, and SAM 3 examples, but reliable reasoning about evolving multi-GPU systems remains open.
The bottleneck moves between GPUs
Work inside one GPU has improved through kernels such as FlashAttention, memory-efficient architectures, sparse attention, and better domain-specific languages. Arora’s starting point is the consequence of that progress: as single-GPU execution gets better, communication between GPUs becomes a larger share of the remaining runtime. The new problem is to make kernels spanning several GPUs fast without requiring months of specialized engineering for each operator.
The hardware explains why data movement matters. Threads and blocks execute on processors distributed across the GPU. Those processors retrieve weights and activations through a hierarchy that includes a relatively small L2 cache and much larger high-bandwidth memory. Registers sit closest to computation and can supply data at a cited 130 terabytes per second on an H100, but their capacity is limited. Moving farther away generally provides more storage at the cost of slower access.
Multiple GPUs extend that hierarchy into a network. PCIe carries CPU–GPU traffic, while communication across nodes can use InfiniBand or TCP. Within the NVIDIA systems emphasized in the talk, NVLink connects GPUs point to point and NVSwitch joins NVLink endpoints into a nonblocking fabric. NVSwitch can also accelerate operations such as multicast and reductions in the network rather than requiring every step to run on a GPU.
Closest to computation and very fast, but scarce.
Within a GPU, fast, scarce registers give way to larger memories farther from computation. Beyond the GPU, communication links provide access to remote memory; the links are not additional storage tiers.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
Workloads and hardware are becoming more network-shaped
Several optimization layers have advanced together: architectures reduce compute and memory requirements, hardware-aware algorithms improve execution, programming tools make kernels easier to express, and megakernels overlap work across operators. Yet distributed training and inference still exchange data. Arora reports that communication increasingly consumes most of the runtime in many production workloads, leaving low model FLOP utilization as systems scale.
Networking is also less uniform than matrix multiplication or memory hierarchies. The talk contrasts AMD’s point-to-point XGMI links, TPU systems using a 3D torus with optical wraparound links, and NVIDIA’s NVSwitch fabric with in-network reductions. Arora cites up to 900 gigabytes per second of unidirectional NVLink bandwidth between remote GPUs’ high-bandwidth memories on a particular NVIDIA generation. That hardware qualification matters: it is an example of one system, not a universal link rate.
The workloads themselves now cross more boundaries. KV-cache storage can span GPU memory, CPU memory, disk, and remote machines. Inference systems can place speculative decoding, prefill, and decode on different hardware. Arora also describes scale-up domains reaching 72 GPUs and cites a plan for a 576-GPU system in 2027. Device-side tensor memory acceleration adds asynchronous transfers to this environment, giving kernels finer control over when communication begins and how it overlaps with other work.
Compute has nevertheless improved faster than the links carrying its data. From NVIDIA’s A100 in 2020 to B200 in 2024, the reported BF16 tensor-core gain is 7.2×, compared with 3× for intra-node communication and 2× for inter-node communication. Faster arithmetic cannot remove that mismatch. It increases the amount of useful computation that can sit idle while communication catches up.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
Convenient collectives leave a performance gap
NCCL makes common multi-GPU operations accessible, but its bulk-transfer orientation does not fit every kernel. It works naturally with large contiguous chunks. Fine-grained communication, tightly fused collectives, and communication that must overlap with a particular computation require more control. In the team’s benchmark, most simple PyTorch-plus-NCCL baselines fall below 50% of their communication-aware roofline, leaving headroom even after accounting for the communication limit.
The available alternatives each carry a cost:
- Higher-level frameworks: Systems built around bulk NCCL collectives often synchronize before and after transfers, preserving the same coarse execution structure.
- Compilers and distributed DSLs: These can offer better abstractions, but tuning may not transfer across rapidly changing network architectures. Arora cites a distributed compiler configuration tuned around eight H800 GPUs that did not adapt efficiently to H100s in the team’s results.
- Hand-tuned operators: Specialized kernels can reach peak performance, but the work does not scale. Arora says adapting some implementations from one precision to another can take five or six months.
This leads to the project’s core research question: can a small set of reusable principles capture the important decisions in multi-GPU kernel design? The team first investigated those decisions manually through ParallelKittens, a compact set of primitives and patterns used to build high-performance kernels across several parallelism schemes. Only after developing that understanding did they ask whether language models could apply it.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
Choose the transfer mechanism to fit the message
The first reusable decision is how data crosses GPUs. A copy engine performs host-initiated transfers and suits large messages that can approach peak communication bandwidth. Because the transfer does not occupy the GPU’s compute processors or consume many of its registers, those resources remain available for other parts of the workload.
Device-initiated communication offers two other paths. Tensor memory acceleration, or TMA, can saturate NVLink with relatively small messages while consuming few registers and few processors, making it useful for fine-grained overlap. Register-level transfer instructions also support fine-grained movement and can exploit the in-network reductions that NVSwitch provides. TMA cannot effectively use those in-network computations in the design space Arora describes.
There is no single best path. Large independent transfers favor the copy engine’s resource isolation. Small transfers interleaved with computation favor device initiation. Operations that need reduction inside the switch may justify register-level instructions. The kernel writer must trade message size against register pressure, processor use, overlap, and network functionality.
Host-initiated; strong for large messages; leaves processors and registers available.
The useful choice depends on message size, GPU resource consumption, desired overlap, and whether the operation needs computation inside NVSwitch.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
Overlap work within an SM—or divide it across SMs
After choosing a transfer mechanism, the kernel must schedule computation, memory work, and communication. An intra-SM schedule assigns different warps or threads inside one streaming multiprocessor to compute and communication concurrently. This is effective when both activities consume the same data in compatible patterns. When their data or resource needs diverge, packing them into one SM can create awkward competition for registers and shared memory.
An inter-SM schedule instead gives different streaming multiprocessors distinct responsibilities for computation, communication, or memory work. This can avoid misaligned resource sharing and can better drive NVLink when intra-SM overlap cannot. Arora’s examples are operation-specific: intra-SM overlap works well for GEMM plus reduce-scatter, while inter-SM overlap works well for GEMM plus all-reduce when it uses NVSwitch’s in-network reduction capability.
Buffering and synchronization between senders and receivers remain part of the design. ParallelKittens packages these choices into programming primitives and templates while preserving developer control over them. Arora reports that the approach typically adds roughly a dozen lines to a single-GPU kernel and is used in production at Together AI and Cursor. The displayed comparisons show state-of-the-art results against strong reference baselines across data, sequence, and expert parallelism.
Different warps in one SM specialize in compute or communication. Best when their data patterns align.
The schedule follows data alignment and resource pressure; neither strategy is universally superior.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
ParallelKernelBench tests practical distributed design
ParallelKernelBench asks whether promising single-GPU kernel-generation results carry over to multi-GPU design. Each task gives a model an unoptimized PyTorch reference using distributed NCCL operations and a topology specifying the rank count and intra-node hardware. The model must replace that reference with a performant CUDA kernel that uses unified virtual addressing.
The search space grows combinatorially because a transformer layer can be parallelized across data, sequence, tensor, context, layer, pipeline, and expert dimensions. Each composition changes which data must move, which ranks participate, and when communication occurs. The team built a taxonomy covering these patterns and selected 87 problems arising in inference, reinforcement learning, and post-training, drawing from real repositories, optimized libraries, and existing DSL implementations.
The benchmark is intended to produce useful kernels rather than isolated programming puzzles. Its references represent work that practitioners already express through PyTorch and NCCL, while the candidates must provide an optimized implementation for the supplied topology. The public ParallelKernelBench repository contains the benchmark and evaluation harness.
Unoptimized implementation using distributed NCCL operations.
A topology-aware rewrite must preserve per-rank behavior while replacing coarse distributed operations with a faster kernel.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
Correctness improves faster than performance
The evaluation separates two outcomes. pass@K asks whether at least one correct kernel appears within K attempts. The performance-oriented fast₁@K also requires the candidate to beat the PyTorch-plus-NCCL reference. That distinction matters because a compiling, numerically correct kernel may still communicate inefficiently or leave hardware idle.
In the zero-shot setting, the best tested frontier model solves 28 of 87 problems, and 22 of those solutions beat the reference. Drawing additional samples raises the number of correct solutions to 36, but the correct-and-faster share plateaus at roughly 31%. More parallel generations therefore find additional valid implementations without producing a comparable rise in high-performance ones.
When a solution is correct, its speedup often comes from removing NCCL staging and replacing it with direct NVLink loads and stores. Success clusters around familiar collective primitives, tensor-parallel GEMMs, and Ulysses-style context parallelism. Arora interprets this concentration as a sign that models perform best on patterns well represented online. It suggests uneven generalization, although the distribution alone cannot reveal the reasoning process behind any individual solution.
The talk identifies GPT 5.5 as the strongest model in the displayed comparison and reports that its qualifying solution count drops quickly as the required speedup rises. Beating a coarse reference on some tasks is therefore a lower bar than consistently finding kernels with substantial gains.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
Retries fix syntax more readily than distributed design
The persistent failures are deeper than CUDA syntax. Multiple samples or error feedback often get a kernel to compile, but models still mishandle collective ordering, data partitioning, intra-SM versus inter-SM scheduling, and transfer selection. Generated kernels also often omit TMA and register-level transfer instructions. Compilation proves that the program is expressible; it does not prove that the model chose the right communication design.
The team also placed Gemini 3 Pro in a multi-turn mini-SWE-agent harness with access to a local shell. This improved the result from 24 solved problems to 35 of 87, with 26 candidates beating the reference. More execution time eventually reached another plateau. The environment helps the model inspect failures and revise code, but it does not supply the missing judgment about data movement and scheduling.
Aggregate limitations do not make the benchmark fruitless. Arora reports useful new examples for NeMo vocabulary-parallel filtering, Hyena context parallelism, and intersection-over-union suppression for the SAM 3 video-segmentation model. The talk does not give individual speedups for these kernels, so they demonstrate practical directions rather than quantified wins.
The ending preserves the central tension. A small set of primitives can express many effective multi-GPU patterns, yet the tested models still fail to apply their tradeoffs reliably even when those ideas are supplied in context. Arora points toward better methods for attacking the benchmark and toward architectures designed for larger scale-up domains, less dependence on scale-out, and much larger on-chip memories. Kernel generation is only one part of that opportunity: models and systems must ultimately be designed around the changing balance among computation, memory, and networking.
Suggest correction
This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.
Resources
From the talk
The public benchmark and evaluation harness for turning PyTorch-plus-NCCL references into fine-grained multi-GPU kernels, including generation and local evaluation workflows.
Arora’s personal site for her research and contact information.
Arora’s GitHub profile, including pinned systems and kernel projects.
The recording’s official read-along page with video chapters and a timestamped transcript.
Related talks
- AI Kernel Generation: What's Working, What's Not, What's Next
A companion discussion of progress, limitations, and next steps in AI kernel generation.
- What every AI engineer needs to know about GPUs
A broader introduction to GPUs for AI engineers.
- Homa: The End of TCP for AI Clusters — John Ousterhout, Stanford
Explores Homa as an alternative to TCP for communication in AI clusters.
Read the complete timestamped transcript
- 0:01
[music]
- 0:12
Hi everyone. Uh, sorry it's a bit loud
- 0:15
in here. Was not expecting this. Um, I'm
- 0:18
Siman. I'm a principal scientist at
- 0:20
Together AI. Um, I previously did my PhD
- 0:23
in the Hazy Research Lab with Chris Ray
- 0:25
at Stanford and I'm an incoming
- 0:27
professor at Caltech. Um I lead the
- 0:30
frontier performance research team at
- 0:33
together where we develop systems,
- 0:34
frameworks and algorithms to extract as
- 0:37
much performance as possible out of
- 0:39
modern um AI hardware. Today I want to
- 0:42
share a little bit about our
- 0:44
contributions towards simplifying the
- 0:46
development of uh multi-GPU AI kernels.
- 0:51
A few years ago, um, GPU utilization
- 0:54
used to be limited by poor intraGPU
- 0:57
memory access and single GPU kernels.
- 1:01
But with significant investment in
- 1:03
better kernels like flash attention, uh,
- 1:06
memory efficient architectures like from
- 1:08
deepseek, sparse attentions, mambas and
- 1:11
so on, um, and better DSLs, we've sort
- 1:14
of shifted the bottleneck to multi-GPU
- 1:17
communication.
- 1:21
During this talk, I'll start by telling
- 1:23
you a little bit about why now, why GPU
- 1:26
networking now. Then I'll tell you about
- 1:29
um the sort of problem space. So what
- 1:31
are the challenges in maximizing
- 1:33
hardware utilization and development
- 1:35
simplicity for multiGPU kernels. Um
- 1:38
three, we'll talk a little bit about the
- 1:40
fundamentals be behind designing
- 1:42
effective multiGGPU kernels. Four, we'll
- 1:45
look at whether frontier AI models can
- 1:49
uh leverage these fundamental
- 1:51
principles. Do they understand them? Can
- 1:53
they reason about them? Um, you know, in
- 1:55
theory, these models are very good at
- 1:57
reasoning. Um, and then five, we'll talk
- 2:00
through the results of these frontier
- 2:01
models on a benchmark that we've
- 2:03
developed called um parallel kernel
- 2:06
bench for multiGPU kernel generation
- 2:08
evaluation.
- 2:12
Okay, before we dive into those five
- 2:14
parts, just basic preliminaries. So,
- 2:17
this is an Nvidia GPU, uh, an H100 GPU
- 2:21
that you can see on the screen. Um, I
- 2:24
always like to help ground people in GPU
- 2:27
kernels via looking at the hardware. So,
- 2:30
these rainbow colored dots are
- 2:32
processors where actual compute is
- 2:34
happening. um all of the you know
- 2:36
parallel threads are operating within
- 2:38
one of those colored dots and there's
- 2:41
typically you know 100 200 of them on
- 2:44
modern AI GPUs.
- 2:47
Um around those processors you can see
- 2:50
um some of the memory that these
- 2:52
processors retrieve data so large
- 2:55
weights activations from. So these
- 2:58
rectangles between the colored dots are
- 3:01
an L2 cache slightly faster memory. um
- 3:04
not a ter like crazy large amount of it.
- 3:07
And then these black boxes are high
- 3:09
bandwidth memory. So when you Nvidia Smi
- 3:12
and see you know 80 gigabytes, 1008
- 3:15
gigabytes, whatever it is on your GPU,
- 3:17
that's that memory.
- 3:19
Um a GPU is operating a highly parallel
- 3:23
program. So multiple threads are
- 3:26
combined together in uh into larger
- 3:29
coarser units. and we schedule these
- 3:32
threads and and blocks onto these
- 3:34
processors to perform our AI compute.
- 3:38
Beyond the GPU, we'll have multiple GPUs
- 3:41
and we'll also have, you know, CPUs um
- 3:44
that have memory as well.
- 3:49
Um so to perform computation um the
- 3:53
memory that these threads use is going
- 3:55
to be stored in a really fast register
- 3:57
memory that's right next to the
- 3:59
computation units. um simple physics if
- 4:02
I am pulling data from very very close
- 4:06
to my proc my compute unit it's really
- 4:08
fast to get to it because it you know
- 4:10
that data is right next to me but
- 4:12
there's not a large radius and not a
- 4:14
large volume of space that's close by to
- 4:17
my process uh my my compute units and so
- 4:20
I don't have very much of it so you can
- 4:22
see that the fastest memory here the
- 4:24
registers is sup is you know 130
- 4:27
terabytes per second on an H100 but we
- 4:29
don't have very much on of it and as we
- 4:32
go to the further away memory we have a
- 4:34
lot more of it but it takes longer to
- 4:36
reach it. Uh again simple physics.
- 4:40
So in multiGPU systems in particular um
- 4:44
there is a hierarchy of interconnects.
- 4:46
So we will have something called PCIe um
- 4:49
as the channel for CPUGGPU
- 4:51
communications. We'll have multiGPU or
- 4:54
multi- uh node communications over
- 4:57
infiniband TCP and then in the we're
- 5:01
going to focus mostly on the Nvidia
- 5:03
sphere here. Um in uh the intraGPU
- 5:06
regime we'll have NVLink um providing
- 5:09
point-to-point connections between GPUs
- 5:12
and the NV switch. NV switch connects
- 5:15
all NVLink in endpoints into a
- 5:18
non-blocking fabric for full GPUGGPU
- 5:21
communication and NV switch is exciting
- 5:24
because it also provides support for in
- 5:26
network offdevice acceleration for oper
- 5:30
like communication primitives like
- 5:33
multiccast and reductions.
- 5:37
Okay, so diving in with the
- 5:39
preliminaries in mind. Why GPU
- 5:42
networking now?
- 5:44
So as I mentioned at the beginning,
- 5:46
we've really put a lot of effort into
- 5:49
making AIO uh more efficient over recent
- 5:52
years. Um again, we have uh
- 5:55
architectures that use less compute,
- 5:57
less memory like Mamba or sparse
- 5:59
attentions. We have algorithms that make
- 6:02
AI more hardware affair aware like flash
- 6:05
attention. We have tools to make it easy
- 6:08
to map AI algorithms to the hardware
- 6:10
like tileang, mojo, triton, gluon,
- 6:13
thunder kittens. Um, and we have new
- 6:16
techniques to overlap uh execution
- 6:19
across many AI operators very tightly
- 6:21
like mega kernels. And we also have
- 6:24
tools to make it easy to run on multiple
- 6:27
vendor and silicon platforms like
- 6:29
thunder mittens for Apple silicon or or
- 6:32
hipkittens for AMD and so on.
- 6:35
Um, at this point we really believe that
- 6:38
GPU networking offers many new and
- 6:40
exciting opportunities for AI
- 6:42
efficiency.
- 6:45
Modern AI workloads are getting very big
- 6:47
and require kernels that span multiple
- 6:50
um, you know, GPUs. So on many
- 6:53
production um distributed training and
- 6:56
inference workloads, communication is
- 6:58
increasingly consuming the majority of
- 7:01
the runtime and yields low model flop
- 7:04
utilization at scale.
- 7:08
So the uh pace of innovation and
- 7:11
diversity of approaches that different
- 7:13
hardware providers are taking in their
- 7:15
networking stacks is another reason why
- 7:17
it's an exciting time to study um you
- 7:20
know networking and communication. So we
- 7:22
can see here um AMD hardware with uh
- 7:26
what's called XGMI interconnects um
- 7:29
providing pointto-point links between
- 7:31
different GPUs in a scaleup domain. We
- 7:35
can see here TPU and uh interconnect uh
- 7:39
as well. So the TPU will use a 3D Taurus
- 7:42
and also have optical wraparound links.
- 7:45
So yet another diverse form of the
- 7:48
topology and links. Um and then again
- 7:50
for Nvidia we'll have the INV um switch
- 7:54
which integrates um compute capabilities
- 7:57
directly into the interconnect fabric
- 8:00
like for in network reductions and then
- 8:03
we'll have our NV link providing up to
- 8:05
you know 900 gigabytes of unidirectional
- 8:07
bandwidth between any two remote GPUs
- 8:10
high bandwidth memory um on you know
- 8:14
particular generation of Nvidia hardware
- 8:19
um Beyond the diversity in the
- 8:20
networking stacks, there's also a lot of
- 8:23
evolution in um how AI workloads are
- 8:27
adapting to take advantage of this
- 8:29
hardware and the diversity of types of
- 8:32
um you know hardware that we're we're
- 8:34
using simultaneously for one AI
- 8:36
workload. So um KV cache memory in
- 8:40
modern inference systems is going to
- 8:41
beworked across GPU, CPU, disk and
- 8:44
remote machines. um inference systems
- 8:47
increasingly disagregate different steps
- 8:50
of inference across different hardware
- 8:52
backends. So you could run speculative
- 8:54
decoding on some hardware, decode on
- 8:57
different hardware, prefill on different
- 8:58
hardware. Um hardware is also evolving
- 9:02
to have larger scaleup domains than ever
- 9:04
before with you know 72 GPUs and a
- 9:07
scaleup domain in in the coming um chips
- 9:10
and Nvidia planning on a single system
- 9:12
in 2027 with 576 GPUs.
- 9:17
Um at the same time to take advantage of
- 9:19
these more uh intensive scaleup domains
- 9:22
we're getting richer uh primitives for
- 9:24
fine grained control and kernel writing
- 9:27
over these domains. So we have something
- 9:30
called tensor memory acceleration where
- 9:32
we can provide uh perform asynchronous
- 9:35
network transfers from the device side
- 9:37
um on these GPUs.
- 9:40
So all of these changes are opening up
- 9:42
new opportunities and challenges in um
- 9:45
both AI you know how do we build models
- 9:48
that take advantage of these trends and
- 9:50
in systems.
- 9:53
Okay, so the problems that we're going
- 9:56
to go after um how do we get peak
- 9:58
hardware utilization and also
- 10:00
development simplicity um for these
- 10:03
multiGPU kernels.
- 10:06
So um it's been very difficult to write
- 10:10
multiGGPU kernels and there's a lot of
- 10:12
there are a lot of papers a lot of
- 10:14
systems reports that document you know
- 10:16
challenges here. Um, one of the things
- 10:19
here is it's compounded by the fact that
- 10:21
communication hardware around GPUs has
- 10:24
progressed a lot more slowly relative to
- 10:27
compute and memory. Um, so comparing
- 10:30
NVIDIA A100's in 2020 to B200s in 2024,
- 10:36
u BF16 tensor core speeds improved by
- 10:39
7.2x.
- 10:40
um while intra node communication by
- 10:43
just 3x and inter node communication by
- 10:46
just 2x. Um and coming back to my points
- 10:49
about how diverse networking is right
- 10:51
now things like tensor cores that run
- 10:54
map moles and our memory hierarchies are
- 10:57
pretty consistent and resemble one
- 10:59
another across diverse AI vendors and
- 11:01
multisilicon. Um but again as I I
- 11:04
mentioned the networking stack is
- 11:05
something that is really different
- 11:06
across vendors still
- 11:10
um you know a first step as we went
- 11:12
about all this work is to just study the
- 11:14
baselines um that are out there. So um
- 11:17
one of the popular tools for um
- 11:21
communications is this nickel library or
- 11:24
Rickle on AMD um that both you know
- 11:27
companies respectively spend a lot of
- 11:29
you know engineering investment into
- 11:31
releasing to make it easy for people to
- 11:33
do multiGPU work. Um but they're not
- 11:36
very flexible. So they're tuned for bulk
- 11:38
transfers for large contiguous chunks of
- 11:41
data transfers. And the design really
- 11:44
breaks down when you care about peak
- 11:46
performance, fine grain communication,
- 11:48
um, and sort of non-trivial collectives
- 11:51
that you want to fuse together.
- 11:54
So as a result, you can achieve much
- 11:56
higher performance by writing custom
- 11:58
communication kernels that directly
- 12:01
address these needs.
- 12:03
If we look at a naive baseline that's
- 12:05
representative of very popular libraries
- 12:08
in machine learning stacking pietorch
- 12:10
with nickel um we can we find that
- 12:13
across um you know the many uh problems
- 12:17
in our parallel kernel bench benchmark
- 12:19
that the majority of these um simple
- 12:22
baselines will fall below 50% of their
- 12:26
communication aware roof line bound. So
- 12:30
there's a lot of room for improvement
- 12:32
here.
- 12:33
Um the current frameworks beyond um
- 12:36
nickel which is popular in like Megatron
- 12:39
LM, Flex Flow, Nanoflow um you know all
- 12:43
again these systems are primarily
- 12:45
orchestrating bulk collectives via
- 12:47
nickel um and require synchronization
- 12:50
before and after data transfers. So
- 12:52
beyond th those off-the-shelf libraries,
- 12:54
we have compilers and DSLs that exist.
- 12:58
So there's Triton distributed is one of
- 13:01
them. Um and uh you know tile link is
- 13:04
another one. Um we have found that it's
- 13:07
very difficult to support the rapid pace
- 13:10
of networking improvements within these
- 13:12
frameworks. So our benchmarks and our
- 13:15
papers highlight results where Triton
- 13:17
distributed originally tuned around 8 uh
- 13:20
H800 GPUs fails to adapt efficiently to
- 13:24
other architectures like H100s.
- 13:27
And then the third category of how
- 13:30
people can proceed here is to really
- 13:32
handtune specific AI operators one by
- 13:36
one. So there's a lot of popular work um
- 13:38
DPP um comet ring attention um flux
- 13:43
flashdoe
- 13:45
um and then several distributed gem
- 13:47
kernels from cutless and these methods
- 13:50
achieve peak performance but often um
- 13:54
they do not you know some of these
- 13:56
methods have been designed in one
- 13:58
precision and it takes five or six
- 14:00
months to scale it to another precision
- 14:02
and just the scalability of this hand
- 14:04
tuning and um fine grain kernel writing
- 14:07
is not very um effective.
- 14:10
So um with this landscape in mind, our
- 14:13
research question was really about
- 14:15
whether there is a small set of
- 14:17
principles and fundamentals that really
- 14:20
governs multiGPU kernel writing and
- 14:23
whether there are methods that can
- 14:25
leverage those principles if they exist
- 14:27
to simplify the development of these
- 14:29
kernels.
- 14:32
Um I'll briefly highlight two works here
- 14:34
that um govern like that that represent
- 14:37
our approach. So first we think it's
- 14:40
important to build our own fundamental
- 14:42
understanding and to manually do the
- 14:44
work to understand it rather than just
- 14:46
throwing say an LLM at the problem. So
- 14:50
we spent the time to build out parallel
- 14:52
kittens which is a small set of minimal
- 14:55
primitives and patterns for multiGPU
- 14:57
kernels. Um we use this to understand
- 15:00
the trade-offs of multiGPU kernels and
- 15:03
to one write a large collection of um
- 15:06
peak performance kernels for a variety
- 15:09
of parallelism schemes. Um and this I
- 15:12
will use to hopefully you know educate
- 15:15
and bring us all on the same page on
- 15:16
what patterns we figured out. Um and
- 15:19
then once we found that there is indeed
- 15:22
a small set of trade-offs governing this
- 15:24
landscape, we were curious whether
- 15:26
models, especially these models right
- 15:28
now that claim to be very good at kernel
- 15:31
writing and also reasoning um could
- 15:34
reason about these trade-offs when we
- 15:36
provide them in context to actually
- 15:38
generate a bunch of net new multiGPU
- 15:40
kernels for us. Unfortunately, we found
- 15:44
they were not very good, but we'll dive
- 15:45
into more of that at the end.
- 15:48
Um so just the fundamental section this
- 15:50
is going to be more you know educational
- 15:52
what are the trade-offs that go into
- 15:54
these kernels.
- 15:56
So there are three main ways to do um
- 15:59
intraGPU data transfers. Um there's the
- 16:03
per GPU what's called copy engine and
- 16:06
this is host or CPU initiated work. It's
- 16:09
really good for large message transfers.
- 16:12
So when your message size, the amount of
- 16:15
data being transferred is really big um
- 16:17
and it can get to sort of like peak
- 16:19
bandwidth um on on the communication
- 16:22
side. In contrast, you can use device
- 16:25
initiated or GPU initiated transfers via
- 16:28
that tensor memory accelerator that I
- 16:30
mentioned or via register level
- 16:32
instructions called uh in sort of their
- 16:35
PTX lingo like LDST red multime. Um, and
- 16:40
the uh T TMA is really nice. These
- 16:43
device initiated ones are really nice
- 16:45
because they can saturate our NVLink
- 16:47
bandwidth using relatively small message
- 16:51
sizes. And this means that they can be
- 16:53
really nice when we're trying to do fine
- 16:55
grain communication rather than sending
- 16:57
bulk amounts of data over the links all
- 16:59
at once coarsely.
- 17:02
Um, there are some trade-offs here. So
- 17:05
the copy engine is really nice because
- 17:07
it doesn't take away or you know waste a
- 17:10
lot of our precious registers that I
- 17:12
mentioned are important for compute on
- 17:14
the GPU. Um and it doesn't also use any
- 17:18
of those rainbow colored dots the
- 17:20
processors on our GPU allowing us to
- 17:22
repurpose those for memory or um
- 17:25
computation on our uh you know other
- 17:27
parts of the AI pipeline. Um, TMA, the
- 17:31
second option here, consumes very few
- 17:33
registers, which is why it's nice. Um,
- 17:36
and it also can achieve high utilization
- 17:38
using very few of our processors. So,
- 17:41
it's a nice useful tool for fine grain
- 17:44
overlapping. Um, TMA does have
- 17:47
limitations. It can't effectively take
- 17:49
advantage of these in network um,
- 17:51
computations that I mentioned are
- 17:53
feasible with technologies like NV
- 17:55
switch. And the register level
- 17:58
instructions are really nice for being
- 18:00
able to take advantage of um you know
- 18:03
those those sort of in network
- 18:05
reductions that NV switch offers.
- 18:08
So again there are different tradeoffs
- 18:11
different functionalities that these
- 18:13
transfer mechanisms offer and they face
- 18:15
different trade-offs.
- 18:18
Second um beyond transfer mechanism the
- 18:21
trade-off is around how to overlap
- 18:24
compute memory and uh communication in
- 18:28
GPU kernels. So there's two main
- 18:30
categories of schedules. The first is
- 18:34
intraSM within one of those rainbow dots
- 18:38
um where we'll we'll have different
- 18:39
warps or threads within that processor
- 18:42
specialized to handle either compute or
- 18:45
one specialized for communication
- 18:47
concurrently. Um we can dedicate you
- 18:49
know different warps to each of these.
- 18:52
The challenge with this intm overlapping
- 18:55
is that the communication and
- 18:57
computation pattern really need to like
- 18:59
align and jive with one another. they
- 19:01
need to use the same data as inputs for
- 19:04
the computation and communication. When
- 19:07
they don't align, you could use
- 19:08
something like interm um schedules that
- 19:12
are shown on your right here where we'll
- 19:15
now have each of the different rainbow
- 19:17
colored dots on our GPUs, those
- 19:19
different processors specialized to
- 19:21
compute communication and memory. Um and
- 19:26
so this this is nice when the colonel
- 19:29
would others wise need to split across
- 19:31
resources like the register file or
- 19:33
shared memory um across these different
- 19:36
steps in misaligned ways.
- 19:41
Um this is also really nice when it's
- 19:43
hard to maximize NVLink traversal with
- 19:45
intram
- 19:47
overlapping.
- 19:50
So I just wanted to highlight one quick
- 19:52
example here where each of the patterns
- 19:54
excels in popular you know AI uh uh like
- 19:57
kind of patterns that you'll see. So on
- 20:00
a gem plus uh reduced uh scatter here we
- 20:04
can see that the um intraSM overlapping
- 20:08
scheduleuler schedule is very effective
- 20:11
in the gem plus all reduce we can see
- 20:14
that the interSM which again leverages
- 20:17
the in network reductions of envy switch
- 20:19
is very effective. So we face these
- 20:22
trade-offs and you can read more about
- 20:24
um the design decisions that go into
- 20:26
them in our parallel kittens paper.
- 20:30
Um, and then finally, ideally,
- 20:31
abstraction should allow the developer
- 20:33
flexibility to control how they're
- 20:35
buffering and synchronizing between data
- 20:39
senders and receivers.
- 20:41
So, we encapsulated these ideas into
- 20:44
parallel kittens. Again, a simple set of
- 20:46
programming primitives and templates for
- 20:49
these multiGPU kernels. Parallel Kittens
- 20:52
is used in production at Together AI as
- 20:54
well as our partner um you know Cursor
- 20:57
and other uh companies in the AI space.
- 21:01
Um here's some sample code. I won't
- 21:03
spend too much time here, but we usually
- 21:05
add roughly a dozen lines of code over a
- 21:07
single GPU kernel to insert these
- 21:10
multiGPU primitives.
- 21:13
Um, and you can see here across data
- 21:16
sequence and expert parallelism how our
- 21:19
parallel kittens kernels are achieving
- 21:22
state-of-the-art results um, compared to
- 21:24
strong reference baselines. And you can
- 21:26
check out our repo to learn more.
- 21:30
Okay, so we understand a little bit
- 21:33
about um the trade-offs that underly
- 21:35
these multiGPU kernels and there's just
- 21:37
a couple main, you know, ones that
- 21:39
exist. So can models reason through them
- 21:42
um and give us these uh you know kernels
- 21:45
models are getting better at reasoning
- 21:47
today. Um do they generalize well to
- 21:50
these problems or are we benchmaxed on
- 21:53
you know benchmarks of the past which
- 21:55
are more single GPU centric
- 21:58
uh models right now are showing really
- 22:00
promising results on single GPU uh
- 22:02
benchmarks. So it's a ripe time to to
- 22:05
extend it.
- 22:07
In our benchmark parallel kernel bench,
- 22:10
each task presents the model with an
- 22:12
unoptimized reference implementation
- 22:14
written in PyTorch with torch
- 22:16
distributed um nickel operations and
- 22:19
then a system topology that specifies
- 22:22
the number of ranks and intraode
- 22:24
hardware configuration. And the model
- 22:26
needs to rewrite the reference into a
- 22:28
performance CUDA kernel that uh uses
- 22:31
unified virtual addressing.
- 22:37
The um multiGPU problem space expands
- 22:40
combinatorally beyond single GPU um
- 22:44
cases. So a standard transformer layer
- 22:46
can be parallelized across data
- 22:49
sequence, tensor, context, layer,
- 22:51
pipeline and expert dimensions. and each
- 22:53
composition um induces a different
- 22:56
communication pass uh pattern. So to
- 22:58
make sure that our benchmark has high
- 23:01
coverage over the representative types
- 23:03
of multiGPU problems um we created this
- 23:06
taxonomy um that you can read more about
- 23:09
in our paper and then picked
- 23:10
representative problems for each part of
- 23:12
the taxonomy.
- 23:15
Um these are all patterns that arise in
- 23:18
real AI workloads from inference to RL
- 23:20
to post-training.
- 23:23
There are 87 problems overall um drawn
- 23:26
from GitHub repositories that we found
- 23:29
to be very informative. Um and we uh and
- 23:34
like optimized library implementations
- 23:36
and DSLs that people have written
- 23:38
multiGPU kernels in.
- 23:40
Um, we wanted to really make sure that
- 23:42
solving PK this parallel kernel bench
- 23:45
would lead to net new useful production
- 23:47
kernels rather than artificial or
- 23:49
useless kernels.
- 23:51
Okay, so that's parallel kernel bench.
- 23:54
How do models perform?
- 23:58
So we measured to sorry that this is a
- 24:00
bit small. We measured two main metrics.
- 24:03
Um pass at K which is the number of
- 24:06
correct kernels generated after K
- 24:08
attempts and then fast um one at K which
- 24:13
counts solutions that are both correct
- 24:16
and outperform the speed of the pi torch
- 24:19
plus nickel baseline.
- 24:21
Um so pass K just correctness fast one
- 24:25
at K is whether you're getting a 1x or
- 24:28
higher speed up over the reference. So
- 24:30
performanceoriented
- 24:32
um we found that in the zeroot setting
- 24:35
the best of the frontier models we tried
- 24:37
solves 28 out of 87 problems and 22 of
- 24:41
those problems are faster than the
- 24:42
pietorch plus nickel baseline.
- 24:45
If we make multiple samples, you know,
- 24:47
standard uh scaling up test time
- 24:50
compute, we can uh get that number from
- 24:54
say like to to 36 correct solutions, but
- 24:57
the fast uh one performance still
- 25:01
plateaus out at roughly 31%. So we don't
- 25:05
see much room from continuing to scale
- 25:07
there as we increase the number of
- 25:09
parallel generations.
- 25:12
Um we find that the correct once
- 25:14
correctness is established um speedups
- 25:16
naturally come from eliminating nickel
- 25:18
staging overhead in favor of direct
- 25:20
NVLink loads in stores.
- 25:24
Um the success patterns here are really
- 25:27
concentrated into familiar patterns. So
- 25:30
collective primitives, tensor parallel
- 25:32
gems and Ulyses style context
- 25:34
parallelism. So in other words, patterns
- 25:37
that we see heavily represented um on
- 25:40
the internet rather than necessarily
- 25:43
patterns that the model has used its
- 25:45
reasoning abilities to think through.
- 25:50
Okay, even the best available model that
- 25:53
we benchmarked here GPT 5.5 drops off
- 25:56
very quickly as the speed up threshold
- 25:59
increases. So on the x-axis here, we're
- 26:02
increasing the speed up threshold over
- 26:04
that pietor torch plus nickel baseline.
- 26:07
And then we're showing the number of
- 26:09
correct kernels that are faster than
- 26:11
that baseline or this much faster than
- 26:13
the baseline on the y-axis.
- 26:16
So GPT 5.5 is this orange line here and
- 26:20
then DeepSeek V4 Pro is the aqua line at
- 26:24
the bottom.
- 26:28
um we found that there's deeper issues
- 26:31
than CUDA syntax. So we found that if
- 26:34
you do multiple sampling or have the
- 26:36
model kind of look at its errors and
- 26:38
correct them, it can often compile the
- 26:41
kernels. But the models really struggle
- 26:44
to reason through the tradeoffs that we
- 26:46
talked about in the prior section. um
- 26:48
collective ordering, data partitioning,
- 26:50
thinking about intra versus interm
- 26:53
scheduling or deciding between the
- 26:55
different transfer mechanisms. Um we
- 26:58
find that they often do not use things
- 27:00
like the register transfer instructions
- 27:02
or tensor memory acceleration when
- 27:04
writing the kernels.
- 27:07
Um we wanted to try a pretty simple
- 27:10
instantiation of something like a clawed
- 27:12
code um coding agent. So, we took uh the
- 27:17
mini sui agent multi-turn harness and
- 27:20
one of the best performing models,
- 27:21
Gemini 3 Pro, and gave it access to a
- 27:24
local bash environment to sort of mimic
- 27:26
the standard claude code setup. We found
- 27:29
that this could help the agent um go
- 27:33
from solving 24 problems to 35 of 87
- 27:36
problems um with um 26 achieving over a
- 27:41
1x speed up over the reference. But we
- 27:44
found that as we scaled the amount of
- 27:46
time um the performance plateaued as uh
- 27:50
and we find that additional techniques
- 27:52
would be required to continue seeing the
- 27:54
scaling there. Again these results are
- 27:57
discussed in more detail in our paper.
- 28:00
Um we think this is a really exciting
- 28:02
you know just to wrap up here we hope
- 28:04
that people out here can use both
- 28:05
parallel kittens and parallel kernel
- 28:07
bench. We think that the kernels
- 28:09
generated from solving parallel kernel
- 28:11
bench will lead to net new production
- 28:14
kernels that are important bottlenecks
- 28:16
for inference in RL right now. um
- 28:19
they're you know we tried our best to
- 28:21
make them you know non-artificial and we
- 28:23
can already see signs of life and
- 28:25
exciting results where people have not
- 28:27
invested a bunch of time to handw write
- 28:29
a multiGPU kernel and we've gotten some
- 28:31
net new interesting ones like this Nemo
- 28:34
vocab parallel um you know filtering
- 28:37
kernel um a hyena architecture context
- 28:41
parallelism kernel
- 28:44
and uh the SAM 3 video segmentation
- 28:48
model um IOU suppression kernel.
- 28:52
Just to conclude here um we're really
- 28:54
excited about um how uh well just
- 28:59
talking about the lessons. First off, we
- 29:00
think there aren't that many patterns
- 29:02
that are involved in writing intragpu
- 29:05
effective kernels again encapsulated by
- 29:08
our small set of programming primitives.
- 29:11
Um, but unfortunately models do not
- 29:13
currently understand how to reason
- 29:15
through these trade-offs even when we
- 29:16
provide them in context. Um, we're
- 29:19
really excited about methods that can
- 29:21
help attack this benchmark. We're
- 29:23
excited about architectures that can
- 29:25
grow with the trends of how networking
- 29:27
stacks are evolving. Um, you know,
- 29:29
larger scale up domains shift away from
- 29:32
scale out um and massive onchip memory
- 29:35
structures. And we hope that uh you know
- 29:38
we can also extend and you you can feel
- 29:40
free to reach out to me at my email.
- 29:42
Thanks.