One Megakernel is Not Enough: Predicting Where to Cut for Streaming Inference
Aditya Chatterjee, Anand Joseph X M, Sanjay Singh Chauhan
Key points
From the paper's conclusion- We present a framework that selects megakernel regions in a streaming inference model from conventional-graph profiles and standalone kernel benchmarks, without running any candidate design end to end.
Abstract
We address a fundamental question: How far should kernel fusion extend and which boundaries are worth preserving? Unlike the general convention of using one monolith megakernel at lower batch sizes or supporting only a selective model component as megakernel and rest of the model as conventional graph, we show that the best configuration is a composition of multiple megakernels with no overlapping conventional graph component, or a fully conventional graph. We present a framework that selects megakernel regions in a streaming inference model from conventional-graph profiles and standalone kernel benchmarks, without running any candidate design end to end. It simulates each candidate's tile and event graphs to predict time to first output and selects the measured best design in all 13 combinations of model and batch size we tested. Across NH-TTS, Qwen3-TTS and Llama-1B, the best composition ranges from two to four megakernels to fully conventional execution and none is a single megakernel. We introduce four model categories (megakernel-stable/ receding/ advancing/ averse) that capture how a model's best megakernel composition changes with batch size. Using NH-TTS model on H100 NVL GPU, we demonstrate that preserving three specialized megakernels can improve both latency and throughput despite introducing additional kernel boundaries. At batch size 32, this design delivers 21.4% lower mean batch-p95 time to first audio (TTFA) and 28% higher throughput than the evaluated monolith megakernel. Against conventional TensorRT graph execution, it reduces engine-level mean batch TTFA p95 by 4.05x and increases throughput by 19.7%.
Read the paper
Discussion
Science Skim's AI key points, plus readers' public thoughts
Readers' thoughts
No reader thoughts yet.
Related papers
- High-Throughput Serving of Nemotron 3.5 Transcribe with Regime-Aware Megakernels and Kernel FusionarXiv · 2026
- MegaOps: A Kernel Overlapping Framework with PyTorch-like Modularity and Megakernel PerformancearXiv · 2026
- OOM: Offload-Optimized Full-Parameter MoE Training via Memory-Execution Co-DesignarXiv · 2026
- Exact Makespan Bounds and the GPipe Homogeneity Bias for Heterogeneous LLM Inference PipelinesarXiv · 2026
- Mira: Memory-Efficient MoE Inference Using Adaptive Caching and Predictive Expert StagingarXiv · 2026
- ForgeMegakernel: A General Framework for Efficient Auto-Regressive Model Decode MegakernelsarXiv · 2026