옥수수 속대를 먼저 최적화하고 커널은 그다음에: 생성형 추천 추론을 위한 빔 서치 최적화
Optimize the Cob, Then the Kernel: Optimizing Beam Search for Generative Recommendation Inference
한국어 초록
생성형 추천(GR) 추론은 긴 입력 시퀀스, 넓은 빔 서치, 그리고 소수의 고정된 출력 토큰을 특징으로 하여 기존 LLM 서빙과 크게 다르다. vLLM과 같은 기존 LLM 서빙 엔진은 빔을 배치된 독립 시퀀스로 처리하므로, 공유된 프롬프트 접두부에 대해 중복된 KV 캐시 접근이 발생한다. 더욱이 vLLM은 각 빔 서치 생성 단계를 별도의 엔진 호출로 실행하여, 디코딩 단계 사이에 호스트 측 빔 처리 오버헤드가 발생하고 PagedAttention에서 상당한 런타임 KV 블록 관리 비용이 발생한다. 본 연구는 Tree Attention을 사용하여 빔을 시퀀스 차원을 따라 연결함으로써 중복된 KV 접근을 제거하고, 사전 생성된 부분 어텐션 마스크, 정적 KV 캐시 할당, 루프 언롤링 생성 디스패치, TorchAir 그래프 컴파일, 자동 연산자 융합, 어휘 제약 디코딩을 통해 실행을 추가로 최적화한다. 커스텀 커널을 사용하지 않고도 본 접근법은 Ascend NPU에서 vLLM 대비 종단 간 지연 시간을 최대 25배 줄이며, 커스텀 커널을 사용하는 최신 솔루션에 필적하는 생성 지연 시간을 달성한다. 이는 커스텀 커널 개발에 의존하기 전에 생성 파이프라인을 전체적으로 최적화해야 함을 보여준다.
원문 초록
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.
제출 이력
확인된 버전만 표시합니다. 전체 제출 이력은 arXiv 원문에서 확인하세요.
- arXiv:2611.23339v1제출 시각 미확인
함께 살펴볼 논문
공통 태그를 근거로 연결했습니다. 실제 인용 관계나 논문의 우수성을 뜻하지 않습니다.
공통 태그로 연결된 공개 논문이 아직 없습니다.
토론
이 논문과 연결된 포럼 글이 아직 없습니다.