arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2610.35336cs.PFcs.DCcs.LG
收藏

单个巨型内核不够:为流式推理预测应在何处进行切割

One Megakernel is Not Enough: Predicting Where to Cut for Streaming Inference

NVIDIA(英伟达)

Aditya Chatterjee, Anand Joseph X M, Sanjay Singh Chauhan

AI总结:

该研究针对流式推理的内核融合问题,提出多巨型内核组合的框架,在13种模型与批量组合中验证其优于单巨型内核,可显著降低延迟并提升吞吐量。

摘要:

我们解决一个基础问题:内核融合应延伸到何种程度,以及哪些边界值得保留?与在小批量规模下使用单个整体巨型内核,或仅将模型的部分组件作为巨型内核、其余部分作为常规图的常规做法不同,我们表明最佳配置是多个无重叠常规图组件的巨型内核的组合,或是完全的常规图。我们提出了一个框架,该框架从常规图轮廓和独立内核基准中选择流式推理模型中的巨型内核区域,无需端到端运行任何候选设计。它模拟每个候选的 tile 图和事件图以预测首次输出时间,并在我们测试的13种模型与批量大小的组合中选择实测最佳设计。在NH-TTS、Qwen3-TTS和Llama-1B上,最佳配置范围为2到4个巨型内核,直至完全常规执行,且无一种是单个巨型内核。我们引入了四类模型(巨型内核稳定型/后退型/前进型/厌恶型),用于捕捉模型的最佳巨型内核配置如何随批量大小变化。在H100 NVL GPU上使用NH-TTS模型,我们证明保留三个专用巨型内核可在引入额外内核边界的同时改善延迟和吞吐量。在批量大小为32时,该设计的平均批量p95首次音频时间(TTFA)比评估的整体巨型内核低21.4%,吞吐量高28%;与常规TensorRT图执行相比,其引擎级平均批量TTFA p95降低4.05倍,吞吐量提高19.7%。

英文摘要:

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%.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑