Skip to main content
QUICK REVIEW

[논문 리뷰] 98$ imes$ Faster LLM Routing Without a Dedicated GPU: Flash Attention, Prompt Compression, and Near-Streaming for the vLLM Semantic Router

X Liu, Bowei He|arXiv (Cornell University)|2026. 03. 13.
Network Packet Processing and OptimizationComputer Science인용 수 0
한 줄 요약

이 논문은 공유 GPU에서 전용 가속기가 필요 없는 거의 100×에 근접한 속도의 LLM 라우팅을 달성하기 위해 Flash Attention, 프롬프트 압축, 근처 스트리밍을 포함한 다단계 최적화를 제시합니다. 또한 PCIe-공유 AMD MI300X 구현을 통해 8K–32K 토큰 라우팅이 GPU footprint 800 MB 미만으로 가능함을 보여줍니다.

ABSTRACT

System-level routers that intercept LLM requests for safety classification, domain routing, and PII detection must be both fast and operationally lightweight: they should add minimal latency to every request, yet not require a dedicated GPU -- an expensive resource better used for LLM inference itself. When the router co-locates on the same GPU as vLLM serving instances, standard attention's $O(n^2)$ memory makes long-context classification (8K--32K tokens) impossible: at 8K tokens, three concurrent classifiers need ${\sim}$4.5\,GB for attention masks alone, far exceeding the memory left by vLLM. We present three staged optimizations for the vLLM Semantic Router, benchmarked on AMD Instinct MI300X, that solve both the latency and the memory problem. \emph{Stage~1}: a custom CK Flash Attention operator for ONNX Runtime on ROCm reduces attention memory from $O(n^2)$ to $O(n)$ and end-to-end (E2E) latency from 4{,}918\,ms to 127\,ms ( extbf{38.7$ imes$}), enabling 8K--32K tokens where SDPA OOMs. \emph{Stage~2}: classical NLP prompt compression (TextRank, position weighting, TF-IDF, and novelty scoring) reduces all inputs to ${\sim}$512 tokens without neural inference, capping both latency and GPU memory at a constant regardless of original prompt length (E2E 127$ o$62\,ms, extbf{2.0$ imes$}). \emph{Stage~3}: near-streaming body processing with adaptive chunking and zero-copy JSON eliminates serialization overhead (E2E 62$ o$50\,ms, extbf{1.2$ imes$}). Cumulatively: extbf{98$ imes$} improvement (4{,}918\,ms to 50\,ms), 16K-token routing in 108\,ms, and a total router GPU footprint under 800\,MB -- small enough to share a GPU with LLM serving and removing the need for a dedicated accelerator. Stage~1 targets AMD ROCm (NVIDIA GPUs already have FlashAttention via cuDNN); Stages~2 and~3 are hardware-agnostic.

연구 동기 및 목표

  • LLM 요청에 대한 안전성, 도메인 라우팅, PII 탐지를 강제하면서도 전용 GPU를 소모하지 않는 빠르고 경량화된 시스템 수준 라우팅을 동기화하려는 동기화.
  • L2에서 LLM 추론 인스턴스와 함께 같은 GPU에 상주하는 경우 라우팅 시 제곱형(attention)으로 인한 메모리 및 지연 병목을 극복.
  • 정확도와 처리량을 유지하면서 소비자급/기업용 GPU에서 장문 컨텍스트 라우팅을 가능하게 하는 하드웨어 독립적 기법 개발.
  • Envoy ext_proc와의 통합이 복잡한 분류 신호를 허용하면서도 낮은 대기 시간을 유지하는 방법을 보이는 것.

제안 방법

  • ONNX Runtime용 CK Flash Attention를 ROCm에서 도입하여 주의(attention) 메모리를 O(n^2)에서 O(n)으로, 엔드투엔드(latency)를 4,918 ms에서 127 ms로 줄여 8K–32K 프롬프트에 대해 달성합니다.
  • 고전적 NLP 특징(TextRank, 위치 가중치, TF-IDF, novelty scoring)을 이용한 프롬프트 압축 파이프라인을 구현하여 신경망 추론 없이 입력을 약 512 토큰으로 감소시킵니다.
  • 적응형 청크링과 제로 카피(JSON)로 호출 과정에서 Envoy ext_proc의 직렬화 오버헤드를 피하는 근사 스트리밍 바디 처리 설계.
  • 라우터를 vLLM 서비스 인스턴스와 동일한 MI300X GPU에 위치시켜 GPU 밀도 개선 및 전용 가속기 회피.
  • 하드웨어 특화 최적화(Fa on ROCm with CK)와 하드웨어 독립적 단계(압축 및 스트리밍)를 제공하여 GPU나 CPU에 적용 가능하게 합니다.

실험 결과

연구 질문

  • RQ1Flach Attention을 ROCm의 ONNX Runtime에 통합하여 공동 배치된 GPU에서 OOM 없이 장문 컨텍스트 라우팅을 가능하게 할 수 있는가?
  • RQ2고전적 NLP 프롬프트 압축이 라우팅의 지연 및 메모리를 얼마나 감소시키면서 분류기 정확도를 보존하는가?
  • RQ3near-streaming 바디 처리로 JSON 직렬화 오버헤드를 제거하고 Envoy ext_proc 라우팅의 엔드투엔드 지연을 더 줄일 수 있는가?
  • RQ48K–16K 토큰 프롬프트에서 FA, 압축, near-streaming을 결합할 때 누적 지연/메모리 영향은 어느 정도인가?
  • RQ5전용 가속기가 없는 라우팅 작업에 GPU와 LLM 추론의 동시 배치가 viable한가?

주요 결과

  • CK 오퍼레이터를 통한 Flash Attention 통합은 주의 메모리를 O(n^2)에서 O(n)으로 감소시키고 8K 프롬프트에 대해 E2E 지연을 4,918 ms에서 127 ms로 떨어뜨립니다.
  • 신경망 추론 없이 약 512 토큰으로 축소된 프롬프트 압축은 약 19 ms의 압축 지연을 제공하고 GPU 메모리를 일정하게 유지하여 추가 GPU 압력 없이 8K–16K 토큰 라우팅을 가능하게 합니다.
  • 적응형 청크링과 제로-카피 JSON을 갖춘 근사 스트리밍은 8K 토큰에서 E2E 지연을 62 ms에서 50 ms로, 16K 토큰에서 108 ms로 감소시켜 공유 GPU에서 16K-토큰 라우팅을 가능하게 합니다.
  • 전체적으로 스택은 약 98×의 개선(4,918 ms에서 50 ms)과 총 라우터 GPU footprint를 800 MB 아래로 달성하여 전용 가속기 없이도 vLLM 서비스와의 동시 배치를 가능하게 합니다.
  • 1단계는 AMD ROCm를 목표로; 2단계와 3단계는 하드웨어에 독립적이며 어떤 백엔드에도 이점을 제공합니다.
  • GPU+FA와 스트리밍 및 압축은 8K 토큰에서 50 ms E2E 지연, 16K 토큰에서 108 ms를 달성합니다; 16K+ 토큰은 압축으로 인해 컨텐츠ion 하에서도 가능성이 남아 있습니다.

이 논문 읽기

누빈트 뷰어에서 원문을 열고, 읽으면서 궁금한 곳을 바로 물어보세요.

누빈트에서 이 논문 읽기

이 리뷰는 AI가 논문 원문을 바탕으로 만들었습니다. 인용하기 전에 원문을 확인해 주세요.