ForgeMegakernel: A General Framework for Efficient Auto-Regressive Model Decode Megakernels

📅 2026-09-10
📈 Citations: 0
Influential: 0
📄 PDF
🤖 AI Summary
本文提出ForgeMegakernel,通过编码代理生成高性能解码巨核,解决自回归模型解码带宽受限问题,确保跨模型通用性和正确性。
📝 Abstract
Auto-regressive model decode is bandwidth-bound, since every weight and key/value-cache byte crosses high-bandwidth memory once per token. A megakernel is an ideal solution, but existing automatic megakernel generation approaches cannot achieve both generalization across models and correctness guarantees. We present ForgeMegakernel, which generates a per-model high-performance decode megakernel using coding agents. ForgeMegakernel pairs a universal knowledge base of ten progressive milestones with an independent mid-state test oracle. The milestones provide the megakernel's structural properties: a fine-grained instruction stream for each SM, dependency counters replacing the global synchronization, and a shared-memory buffer pool for workload balance across SMs and greater parallelism. The test oracle derives the mid-states of the megakernel and checks the performance, error and precision during the generation process, guaranteeing a correct and trustworthy forged megakernel. We evaluated ForgeMegakernel on 14 representative decoding operations across eight model families spanning 0.6B-13B parameters. The generated megakernels achieved 50.5-85.9% MBU and geometric mean speedups of 1.21x over SGLang 0.5.18 and 1.54x over a megakernel compiler under identical configurations. Inside SGLang, evaluated on GSM8K with ragged prompts, all 14 megakernels decoded faster than the SGLang engine at comparable answer accuracy.
Problem

Research questions and friction points this paper is trying to address.

auto-regressive model
decode
bandwidth-bound
megakernel
correctness
Innovation

Methods, ideas, or system contributions that make the work stand out.

megakernel
auto-regressive model decode
coding agents
mid-state test oracle
workload balance
🔎 Similar Papers
No similar papers found.
💼 Related Jobs
No related jobs found.
L
Leshan Li
Tsinghua University
Z
Zhui Zhu
Tsinghua University
X
Xianglong Deng
University of Chinese Academy of Sciences
Y
Yaojian Chen
ModelBest Inc.
Q
Qingfeng He
Tsinghua University
Y
Yuxuan Li
ModelBest Inc.
R
Rong Zhao
Tsinghua University
Xu Han
Xu Han
Research Assistant Professor, Tsinghua University
Natural Language ProcessingLarge Language ModelKnowledge GraphInformation Extraction
Z
Zhiyuan Liu
Tsinghua University