arXiv:2611.00495cs.DCOct 2026

Manuscript Offprint

arXiv:2611.00495

Understanding GPU Megakernels: Why Residency Can Mislead

Xinwei Qiang, Ziyi Xu, Chang Chen, Zaifeng Pan, Zhongkai Yu, Yue Guan, Yufei Ding

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

ABSTRACT

Megakernels let one persistent GPU program prepare dependent operators early and execute ready tasks together. We study the benefits and costs of these capabilities by reconstructing two LLM megakernels, ThunderKittens (TK) and VDCores, as separate kernels on H100 using their original operator code. Our results show that CTA residency can misrepresent opportunities for useful overlap in both directions. By overlapping startup and operand loading with programmatic dependent launch (PDL), the reconstructions reduce decode-step latency by 5.7% in TK and achieve comparable performance in VDCores when both executions enforce the required memory ordering. Under whole-operator dependencies, TK's persistent execution still gains more from prefetch, but runtime and completion-signal ordering costs outweigh this advantage. Both startup overlap and prefetch depend on resource availability. Persistent CTAs can reuse storage before retiring, whereas separate successors must acquire their full CTA footprints before initializing or loading operands. This admission constraint in both reconstructions motivates finer resource sharing across kernels. Beyond early preparation, joint execution requires ready work and spare capacity in the bottleneck resource. Reserving SMs for communication can add GEMM waves that erase overlap gains, while filling idle SMs offers little benefit once memory bandwidth is saturated. These findings clarify benefits and costs of megakernels and motivate GPU support for earlier resource reuse across kernels.

1 INTRODUCTION

Efficient GPU execution is central to low-latency LLM decoding, where tokens are generated sequentially. Conventional inference systems compose a model from GPU kernels optimized for its individual operators (Zheng et al., 2024; Kwon et al., 2023). In small-batch decoding, short operator executions make startup and data preparation between kernels a significant part of latency.

Recent work explores a different organization: megakernels, which execute multiple operators within a single persistent GPU grid (Cheng et al., 2026; Jin et al., 2026; Zheng et al., 2025a). Keeping a GPU program running across operators can reduce repeated startup, load successor operands early, and schedule ready work together. ThunderKittens' Llama megakernel (TK) (Spector et al., 2025) uses a GPU-resident interpreter to execute a static task schedule, while VDCores (He et al., 2026) decouples memory and compute execution to overlap their work.

What does megakernel execution contribute to inference performance, and when is it preferable to separate kernels? End-to-end comparisons conflate operator implementations, synchronization protocols, and execution organization. We seek to isolate benefits and costs of execution organization and determine which benefits separate kernels can recover.

We conduct an attribution study of execution organization in small-batch LLM decoding on H100. We reconstruct TK as separate kernels using its original operator code, with VDCores as a complementary case study. We vary successor launch and operand-loading times to distinguish startup overlap from prefetch benefits. Traces show when preparation begins and what delays it. We further compare joint and separate execution to identify when overlapping computation with communication or combining ready tasks reduces latency, and when resource-sharing and coordination costs outweigh the gains.

This study reveals a key insight: CTA residency can misrepresent opportunities for useful overlap in both directions. Separate kernels can be blocked from preparing early despite unused capacity, while allowing tasks to execute together need not improve throughput (Figure 1).

In our reconstructions, programmatic dependent launch (PDL) recovers opportunities for early preparation by allowing successor kernels to initialize and load operands before their producers finish. After correcting completion-signal ordering in the persistent implementations, the separate-kernel reconstructions reduce decode-step latency by 5.7% in TK and achieve comparable performance in VDCores. Our ablations nevertheless show that TK's persistent execution gains more from prefetch, although its higher runtime and synchronization costs outweigh that advantage.

TK's larger prefetch benefit motivates examining what lim-

¹University of California, San Diego ²RadixArk.

Figure

Figure 1. How execution organization changes opportunities for useful overlap. Separate kernels retain storage until CTA retirement; persistent CTAs reuse it for prefetch but incur runtime and ordering costs. Red numbers connect mechanisms in (a,b) to findings in (c). Pink marks exposed time or unused capacity; light and dark orange mark runtime costs and completion-signal releases. A/B are operators; W is a weight load.

its early preparation across separate kernels. A persistent CTA can load successor weights into unused storage while the producer is still computing. A separate successor, however, must acquire its full CTA footprint before it can begin preparing. Whole-CTA admission can thus block the loader even when its warps and first weight buffer could fit beside the producer. These constraints motivate GPU interfaces that let preparation acquire resources before a full CTA fits, while preserving efficient operator code.

Beyond preparing dependent operators early, joint scheduling can coordinate work that is ready to run concurrently. We study two such opportunities: overlapping computation with communication and combining ready tiles from independent tasks to fill partial waves. In compute-communication overlap, reserving SMs for communication can force GEMM into additional waves, offsetting the overlap. Worker traces show that idle workers can lack ready tasks. Even with ready work, partial-wave CTAs can saturate bandwidth, so more resident CTAs need not increase useful throughput.

Our main contributions are:

  • Reconstructions of two megakernels, with controlled experiments in TK that distinguish startup and prefetch benefits from execution costs, including the cost of ordering completion signals (Section 4).

  • A diagnosis of how whole-CTA admission blocks useful preparation despite unused producer capacity, motivating interfaces for resource reuse before CTA retirement (Section 5).

  • An analysis of when co-resident execution improves performance, and when dependencies, extra compute waves, or bandwidth saturation leave throughput unchanged or

slow computation (Sections 6 and 7).

References (49)