Clairvoyant:预测式SJF调度缓解串行LLM后端队头阻塞

Clairvoyant: Predictive SJF Scheduling to Mitigate Head-of-Line Blocking in Serial LLM Backends

精选理由

本地部署LLM的开发者终于有办法解决队头阻塞了——Clairvoyant用极低开销预测请求长度,短查询不再被长任务堵死,Ollama/llama.cpp用户可以直接集成试试。

AI 摘要

串行LLM推理后端(如Ollama)在混合工作负载下因FCFS调度导致队头阻塞(HOLB),短查询可能被长生成任务延迟数分钟。Clairvoyant是一个即插即用的侧车代理,通过19个轻量级词汇特征用ONNX导出的XGBoost分类器预测响应长度,单请求延迟仅0.029毫秒。它优化排序保真度,在自然对话数据集上达到62-96%分布内和52-66%跨分布准确率。在RTX 4090上,短请求的P50延迟在最大队列压力下降低70-76%,稳态泊松到达下降低17%。Clairvoyant开源且无需修改推理后端。

原文 · arXiv: OpenAI

Clairvoyant: Predictive SJF Scheduling to Mitigate Head-of-Line Blocking in Serial LLM Backends

Serial LLM inference backends -- such as Ollama -- process requests one at a time under FCFS admission, causing Head-of-Line Blocking (HOLB) under mixed workloads at high utilisation: short factual queries can be delayed by minutes behind long generation jobs. While cloud-scale deployments mitigate HOLB via continuous batching (vLLM, Orca), these solutions require tens of GB of VRAM for concurrent KV-caches -- infeasible for memory-constrained edge and local deployments that rely on serial request dispatch. We present \clairvoyant, a drop-in sidecar proxy for any serial OpenAI-compatible backend (e.g., Ollama, llama.cpp). \clairvoyant predicts response length from 19 lightweight lexical features via an ONNX-exported XGBoost classifier, achieving 0.029\,ms per-request latency (four orders of magnitude below typical generation time). Because admission scheduling depends on relative ordering rather than exact prediction, the system optimises ranking fidelity, achieving 62--96\% in-distribution and 52--66\% cross-distribution accuracy across natural conversation datasets. We find that curated instruction datasets are degenerate training sources for length prediction: GPT-imposed brevity constraints reduce Long-class representation to under 0.02\% of examples, making natural conversation logs the only viable training source. End-to-end GPU benchmarks on an RTX~4090 show 70--76\% P50 latency reduction for short requests under maximum queue pressure (100 concurrent requests) and 17\% under steady-state Poisson arrivals ($ρ=0.74$). \clairvoyant is open-source and requires no modifications to the inference backend.