arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2611.23339cs.LGcs.AI
收藏

先优化波束,再优化内核:针对生成式推荐推理的束搜索优化

Optimize the Cob, Then the Kernel: Optimizing Beam Search for Generative Recommendation Inference

Huawei Technologies Co., Ltd.(华为技术有限公司)

Shing Wai Pun, Kai Wu, Pengfei Xia, Hui Zang, Wei Guo, Yong Liu

AI总结:

本研究针对生成式推荐推理的束搜索优化,采用 Tree Attention 等技术,在不使用自定义内核的情况下,将昇腾 NPU 上的端到端延迟较 vLLM 降低最多 25 倍,验证了生成流水线整体优化的有效性。

摘要:

生成式推荐(GR)推理与传统大语言模型(LLM)服务存在显著差异,其特点是输入序列长、束搜索范围广,且仅输出少量固定 token。现有 LLM 服务引擎(如 vLLM)将束视为批量独立序列处理,导致对共享提示前缀的 KV 缓存访问冗余。此外,vLLM 将束搜索的每个生成步骤作为独立引擎调用执行,在解码步骤间产生主机侧束处理开销,并在 PagedAttention 中产生大量运行时 KV 块管理开销。本研究采用 Tree Attention 沿序列维度拼接束以消除冗余 KV 访问,还通过预生成部分注意力掩码、静态 KV 缓存分配、循环展开生成调度、TorchAir 图编译、自动算子融合及词汇约束解码进一步优化执行。在不使用自定义内核的情况下,本方法在昇腾(Ascend)NPU 上相较于 vLLM 将端到端延迟降低了最多 25 倍,且达到了使用自定义内核的 SOTA 方案的生成延迟水平,表明应在诉诸自定义内核开发前对生成流水线进行整体优化。

英文摘要:

Generative recommendation (GR) inference differs substantially from conventional LLM serving, featuring long input sequences, wide beam search, and only a few fixed output tokens. Existing LLM serving engines such as vLLM process beams as batched independent sequences, causing redundant KV cache accesses over the shared prompt prefix. Furthermore, vLLM executes each beam search generation step as a separate engine invocation, incurring host-side beam processing overhead between decoding steps and substantial runtime KV block management in PagedAttention. Using Tree Attention, we concatenate beams along the sequence dimension to eliminate redundant KV accesses, and further optimize execution through pre-generated partial-attention masks, static KV cache allocation, loop-unrolled generation dispatch, TorchAir graph compilation, automatic operator fusion, and vocabulary-constrained decoding. Without the use of custom kernels, our approach reduces end-to-end latency by up to 25x over vLLM on Ascend NPUs, and achieves generation latency comparable to a SOTA solution using custom kernels, showing that the generation pipeline should be optimized holistically before resorting to custom kernel development.

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

↑