Optimize the Cob, Then the Kernel: Optimizing Beam Search for Generative Recommendation Inference
Shing Wai Pun, Kai Wu, Pengfei Xia, Hui Zang, Wei Guo, Yong Liu
Abstract
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.
Create a lesson
Related papers
Minimax-Optimal Small-Loss Regret in Online Convex Optimization and Applications to Contextual Search and Online Inverse Optimization
Shared title terminology · Shinsaku Sakaue
Cap-and-Track: Optimizing LLM Inference Request Dispatch Across Shifting Capacity
Shared title terminology · Benjamin Novotny, Doug Szeto, Chang Wang et al.
RSIBench-Infra: Can Agents Optimize Their Own Training and Inference Infrastructure at Production Scale?
Shared title terminology · Hanlin Wu, Yifei Wang, Zhicheng Cai et al.
An Optimization Framework for Denoising Generation
Shared title terminology · Xinyu Zhou, Jiawei Zhang, Stephen J. Wright
Solving the pre-image problem in kernel PCA: The reproducing property is all you need
Shared title terminology · Joel-Pascal Ntwali N'konzi, Stefan Klus
Verifying and Strengthening Neural Tangent Kernel Theory
Shared title terminology · Hao Zhu