Clairvoyant: 预测性SJF调度以缓解串行LLM后端中的队头阻塞
Clairvoyant: Predictive Shortest-Job-First Admission for Serial LLM Inference
AI总结:
提出Clairvoyant,一种轻量级侧车代理,通过预测请求长度实现SJF调度,缓解串行LLM后端中的队头阻塞,显著降低短请求延迟。
摘要:
串行LLM推理后端(如Ollama)在FCFS准入策略下逐个处理请求,导致高利用率混合工作负载下的队头阻塞(HOLB):短事实查询可能被长生成任务延迟数分钟。虽然云规模部署通过连续批处理(vLLM, Orca)缓解HOLB,但这些方案需要数十GB的VRAM来维护并发KV缓存——对于依赖串行请求分发的内存受限边缘和本地部署不可行。我们提出\clairvoyant,一个即插即用的侧车代理,适用于任何串行OpenAI兼容后端(如Ollama, this http URL)。\clairvoyant通过ONNX导出的XGBoost分类器,从19个轻量级词汇特征预测响应长度,每个请求延迟0.029毫秒(比典型生成时间低四个数量级)。由于准入调度依赖于相对顺序而非精确预测,系统优化排序保真度,在自然对话数据集上达到62-96%的分布内准确率和52-66%的跨分布准确率。我们发现,精心设计的指令数据集是长度预测的退化训练源:GPT施加的简洁约束将长类表示减少到示例的0.02%以下,使得自然对话日志成为唯一可行的训练源。在RTX 4090上的端到端GPU基准测试显示,在最大队列压力(100个并发请求)下短请求的P50延迟降低70-76%,在稳态泊松到达(ρ=0.74)下降低17%。\clairvoyant是开源的,无需修改推理后端。
英文摘要:
Serial LLM inference backends process requests sequentially under First-Come-First-Served (FCFS) admission, causing Head-of-Line Blocking (HOLB) under mixed workloads: short factual queries can be delayed by minutes behind long generation jobs. While cloud-scale deployments mitigate HOLB via continuous batching (e.g., vLLM, Orca), these solutions require tens of gigabytes of VRAM for concurrent KV-caches, rendering them infeasible for memory-constrained edge and local deployments that rely on serial request dispatch. We present Clairvoyant, a drop-in sidecar proxy for serial OpenAI-compatible backends (e.g., Ollama, llama.cpp) that implements predictive Shortest-Job-First (SJF) admission. Clairvoyant predicts response length using 19 lightweight lexical features via an ONNX-exported XGBoost classifier, achieving 0.029 ms per-request latency. Because admission scheduling relies on relative ranking rather than exact token prediction, Clairvoyant captures over 95% of the ranking fidelity of fine-tuned transformers at a fraction of the computational cost. We also uncover a critical dataset bias: curated instruction datasets are degenerate training sources for length prediction, as GPT-imposed brevity constraints reduce Long-class representation to under 0.02% of examples, establishing natural conversation logs as the only viable training signal. End-to-end evaluations demonstrate substantial latency reductions across diverse hardware regimes: a 70-76% short-request P50 latency reduction on an RTX 4090, a 69.7% reduction on Apple M1 edge hardware, and an 83.6% reduction in Time-To-First-Token (TTFT) on a GCP NVIDIA L4 real-world trace replay (rho = 0.80). Clairvoyant is open-source, requires zero modifications to the inference backend, and provides a low-overhead mechanism to eliminate HOLB in edge LLM environments.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。