How Long Prompts Block Other Requests - Optimizing LLM Performance
Under vLLM's default chunked-prefill scheduling, a single long prompt blocks the prefill queue, and any prefill running alongside decodes slows token generation for requests already in progress. The queue-blocking problem is largely solved by vLLM's newer parallel partial prefills, which batch several requests' prefills while capping how many long prompts run concurrently, cutting time-to-first-token for short requests. The decode slowdown is more fundamental. TNG compares three mitigations from running 24 H100s: deprioritizing long prompts, routing them to a separate server, and disaggregated prefill. Disaggregated prefill isolates decodes best but needs a second full deployment, leaves GPUs unevenly utilized, and is still experimental in vLLM.
Related posts
- Prefill and Decode for Concurrent Requests - Optimizing LLM Performance
Hugging Face mediumAdeptLLM token generation splits into a compute-bound prefill phase, which processes all prompt tokens in parallel to produce the first token, and a memory-bandwidth-bound decode phase, which produces later tokens one at a time. These map to time to first token and time per output token. Static batching leaves the GPU underutilized and delays new requests. Prefill-first continuous batching (vLLM, TGI) minimizes time to first token but pauses running decodes. Chunked prefill interleaves prefill chunks with decode steps, trading a small time-to-first-token increase for smoother decoding. At TNG it raised total throughput by about 50%, and the default chunk size is recommended when load patterns are unpredictable.
- Cache-aware prefill–decode disaggregation (CPD) for up to 40% faster long-context LLM serving
Together AI hardMasterCache-aware prefill–decode disaggregation (CPD) extends standard PD serving with a dedicated pre-prefill tier for low-reuse (cold) long prompts, a router that estimates prefix-cache reuse per request, and a three-level KV cache hierarchy (GPU memory, host DRAM, RDMA-connected distributed cache). Cold prefills compute new context and write KV state to the distributed cache, so warm requests on normal prefill nodes fetch KV blocks instead of queueing behind multi-second prefills. On B200 GPUs with a synthetic coding-agent workload, CPD raised sustainable throughput from about 0.75–0.8 to 1.1–1.15 QPS per GPU (~40%) and kept median TTFT far lower near saturation, without worsening p90 tail latency. The gains come from scheduling and cache reuse on the prefill path, not faster model execution.
- Efficient Request Queueing – Optimizing LLM Performance
Hugging Face mediumAdeptPutting a gateway ("LLM-Server") in front of vLLM or TGI with per-user, per-model queues and round-robin scheduling keeps power users from starving others, which the engine's FIFO queue cannot do once requests reach it. Because vLLM doesn't cap its queue length, the gateway polls vLLM's Prometheus /metrics and only dispatches while the backend queue is below a small target (e.g. 3) and time-per-output-token stays under ~150ms. That target trades latency for new users against batch utilization. vLLM's newer priority scheduling can replace some of this logic, but a gateway is still needed to assign priorities and control the dispatch rate.
- Continuous batching from first principles
Hugging Face mediumAdeptContinuous batching falls out naturally once you optimize LLM serving for throughput, and the post derives it step by step from attention, causal masking, KV caching and chunked prefill. The KV cache cuts the cost of generating each new token from O(n²) to O(n) at O(n) memory, about 16 KB per token per layer for Llama-2-7B in float16. Chunked prefill splits long prompts across forward passes. Padded batched generation wastes compute when prompts finish at different times, and dynamic batching needs heavy padding because newly inserted prompts must prefill while others decode, which motivates continuous batching's mixing of prefill and decode tokens in one forward pass.
- Achieve state-of-the-art inference latencies with speculative decoding
Modal hardMaster
Speculative decoding is the dominant lever for low-latency LLM serving because decode steps dominate latency and speculation yields multiplicative speedups roughly linear in acceptance length. Working with Decagon's voice agents, Modal combined regional serving, SGLang host-overhead fixes, and open-source kernels with DFlash draft models that reuse target-model KV projections and draft tokens in parallel. Fine-tuning ("mid-training") the speculator on synthetic data generated by the target model from public prompts in the task's output grammar avoids exposing user data. The custom speculator cut about 100ms from a ~290ms p50 baseline, roughly 40% of server-side decode latency, and beat proprietary providers by over 60ms. Out-of-distribution evaluation was used to guard against overfitting.