cs.CLMar 13, 2026

98×\times Faster LLM Routing Without a Dedicated GPU: Flash Attention, Prompt Compression, and Near-Streaming for the vLLM Semantic Router

Authors: Xunzhuo Liu, Bowei He, Xue Liu, Andy Luo, Haichen Zhang, Huamin Chen

Organizations: vLLM Semantic Router Project · MBZUAI · McGill University · AMD · 

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(n2)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. Stage~1: a custom CK Flash Attention operator for ONNX Runtime on ROCm reduces attention memory from O(n2)O(n^2) to O(n)O(n) and end-to-end (E2E) latency from 4{,}918,ms to 127,ms (\textbf{38.7×\times}), enabling 8K--32K tokens where SDPA OOMs. 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→\to62,ms, \textbf{2.0×\times}). Stage~3: near-streaming body processing with adaptive chunking and zero-copy JSON eliminates serialization overhead (E2E 62→\to50,ms, \textbf{1.2×\times}). Cumulatively: \textbf{98×\times} 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. Stage1 targets AMD ROCm (NVIDIA GPUs already have FlashAttention via cuDNN); Stages2 and~3 are hardware-agnostic.

Figures & tables

Explore similar work

CardsList
  1. Token-Budget-Aware Pool Routing for Cost-Efficient LLM Inference

    Mar 13, 2026Huamin Chen, Xunzhuo Liu, Junchen Jiang +2LLM Inference EfficiencyLLM Routing

  2. LLMRouter: Unified Infrastructure for Developing, Evaluating, and Deploying LLM Routers

    Aug 7, 2026Tao Feng, Fangxu Yu, Haozhen Zhang +9LLM EvaluationLLM Routing

  3. Dynamic LLM Routers are Often Misguided

    Oct 2, 2026Sam Wang, Julia White, Sahibzada Allahyar +3LLM RoutingCost-Aware Inference