arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2606.17518cs.DC
收藏

SpecGen: 利用推测生成加速智能体内核优化

SpecGen: Accelerating Agentic Kernel Optimization with Speculative Generation

Fudan University(复旦大学);Shanghai AI Lab(上海人工智能实验室);Shanghai Jiao Tong University(上海交通大学);Hong Kong University of Science and Technology(香港科技大学);The Chinese University of Hong Kong(香港中文大学);Sensetime Research(商汤科技研究院)

Jihu Guo, Sitian Lu, Tenghui Ma, Wei Gao, Zhisheng Ye, Xingcheng Zhang, Dahua Lin

AI总结:

针对智能体内核优化中生成延迟长、反馈不足和资源利用率低的问题,提出SpecGen系统,通过推测生成在推理过程中提前产生候选内核,并行验证剖析,动态调整资源,并利用远程KV缓存减少前缀重计算,显著降低端到端时间并提升内核加速比。

摘要:

智能体内核优化通过迭代生成、验证和剖析,利用推理LLM自动进行手动GPU内核调优,将优化任务转化为反馈引导的搜索。然而,我们的工作负载特征揭示了三个限制搜索效率的系统级低效问题:(1) LLM推理导致的长生成延迟,(2) 不充分的剖析反馈,(3) 验证/剖析资源利用不足。我们的关键洞察是,正在进行的推理生成在完成之前暴露了一个产生额外候选内核的窗口,允许系统在出现满意内核时提前终止推理。我们提出了SpecGen,一个具有推测生成的智能体内核优化系统。首先,SpecGen在推理轨迹中精心选择的触发点分叉出非推理生成以产生内核,增加每次迭代的候选内核数量。这些内核与正在进行的推理并行进行验证和剖析,增加剖析反馈,并在生成期间保持资源忙碌。当内核满足终止条件时,SpecGen提前终止推理生成以减少生成延迟。其次,SpecGen根据到达率动态重新分配验证和剖析GPU池,并优先处理请求,以减少突发推测生成负载下的剖析反馈延迟。此外,SpecGen利用验证/剖析GPU的空闲内存作为远程KV缓存存储,以消除在有限内存预算下推测生成的前缀重计算。在H200上使用两个推理LLM的实验表明,与三个基线系统相比,SpecGen减少了端到端时间,同时产生了更多的剖析反馈,提高了资源利用率,并在固定的时间和令牌预算下改善了内核加速比。

英文摘要:

Agentic kernel optimization automates manual GPU kernel tuning via iterative generation, validation, and profiling with reasoning LLMs, casting the optimization task as feedback-guided search. However, our workload characterization reveals three system-level inefficiencies that limit search efficiency: (1) long generation latency due to LLM reasoning, (2) insufficient profiling feedback, and (3) underutilized validation/profiling resources. Our key insight is that the ongoing reasoning generation exposes a window for producing additional candidate kernels before it completes, allowing the system to terminate reasoning early once a satisfactory kernel appears. We present SpecGen, an agentic kernel optimization system with \emph{speculative generation}. First, SpecGen forks non-reasoning generations at well-chosen trigger points in the reasoning trace to yield kernels, increasing the candidate kernel count per iteration. These kernels are validated and profiled in parallel with the ongoing reasoning, increasing profiling feedback, and keeping resources busy during generation. When a kernel meets the termination criterion, SpecGen terminates the reasoning generation early to reduce the generation latency. Second, SpecGen dynamically reallocates validation and profiling GPU pools based on the arrival rate and prioritizes requests to reduce profiling feedback latency under bursty speculative generation load. Furthermore, SpecGen utilizes spare memory of the validation/profiling GPUs as remote KV cache storage to eliminate prefix recomputation of speculative generations under limited memory budget. Experiments with two reasoning LLMs on H200 show that SpecGen reduces end-to-end time over three baseline systems, while producing more profiling feedback, increasing resource utilization, and improving kernel speedup under a fixed time and token budget.

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

↑