arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2604.23467cs.LGcs.AIcs.AR
收藏

混合JIT-CUDA图优化用于低延迟大语言模型推理

Hybrid JIT-CUDA Graph Optimization for Low-Latency Large Language Model Inference

Department of Computer Science(计算机科学系);University of Wisconsin-Milwaukee(威斯康星大学密尔沃基分校);Milwaukee, WI, USA(美国威斯康星州密尔沃基)

Divakar Kumar Yadav, Tian Zhao

AI总结:

本文提出一种混合运行时框架,结合JIT编译与CUDA图执行,以降低启动开销并保持自回归解码的运行时灵活性,通过静态组件和动态组件的分离,有效减少短序列LLM推理的延迟和方差。

摘要:

大型语言模型(LLMs)在自然语言和多模态任务中表现出色,但其实际部署仍受推理延迟和内核启动开销限制,尤其是在交互式短序列设置中。本文提出了一种混合运行时框架,结合即时编译(JIT)与CUDA图执行,以减少启动开销并保持运行时灵活性。该框架将Transformer推理分为静态组件,通过CUDA图回放执行,以及动态组件,通过JIT编译内核处理,从而实现解码步骤中的异步图捕获和重用。我们在LLaMA-2 7B上使用单GPU、批大小为1的推理,测试提示长度从10到500个token。实验结果表明,该混合运行时将时间到第一个token(TTFT)减少了高达66.0%,并在该范围内实现了比TensorRT-LLM更低的P99延迟。这些结果表明,混合JIT-CUDA图执行可以有效减少短序列LLM工作的延迟和方差,使其成为对延迟敏感的AI应用的实用优化策略。

英文摘要:

Large Language Models (LLMs) have achieved strong performance across natural language and multimodal tasks, yet their practical deployment remains constrained by inference latency and kernel launch overhead, particularly in interactive, short-sequence settings. This paper presents a hybrid runtime framework that combines Just-In-Time (JIT) compilation with CUDA Graph execution to reduce launch overhead while preserving runtime flexibility during autoregressive decoding. The framework partitions transformer inference into static components executed via CUDA Graph replay and dynamic components handled through JIT-compiled kernels, enabling asynchronous graph capture and reuse across decoding steps. We evaluate the proposed approach on LLaMA-2 7B using single-GPU, batch-size-one inference across prompt lengths from 10 to 500 tokens. Experimental results show that the hybrid runtime reduces Time-to-First-Token (TTFT) by up to 66.0% and achieves lower P99 latency compared with TensorRT-LLM in this regime. These results indicate that hybrid JIT-CUDA Graph execution can effectively reduce inference latency and variance for short-sequence LLM workloads, making it a practical optimization strategy for latency-sensitive AI applications.

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

↑