Dual-Path Scheduling and Compute Optimization for LLM Inference
Online LLM inference often underuses expensive accelerators because prefill and decode mismatch bandwidth, memory, and compute. This article explains why single-path scheduling wastes capacity, how dual-path I/O and compute decoupling plus attention compression raise effective utilization, and how to plan capacity and validate the design.
Accelerators in online LLM inference are often purchased but left underused. Poor utilization is not only a dashboard problem. Prefill of long prompts and token-by-token decode mismatch bandwidth, GPU memory, and compute. Without joint work on scheduling and representation compression, adding GPUs mainly buys more expensive wait time.
Resource mismatch: not too little compute, but mismatched stages
A typical online path splits into two stages. Prefill reads a long prompt and runs the first forward pass; it is highly sensitive to external storage and NIC bandwidth. Decode generates token by token; compute intensity is high and demand on high-speed storage and NICs falls. Probes often show long-context nodes with NICs saturated and cores idle over half the time, while decode nodes are compute-busy with storage paths nearly idle. The system never stacks “read fast” and “compute full” on the same resource profile, so the cluster is half I/O-bound and half idle compute. Capex, network, cooling, and depreciation are sized for peak accelerators; higher idle share means higher cost per useful token. Agents amplify the issue: multi-step tool use and long planning inflate context and KV lifetime, turning mismatch from occasional to constant.
Why single-path scheduling wastes capacity
Traditional designs put weight/context load and compute on one path: the same process, queue, and driver stack do fetch, copy, and kernel launch. Prefill I/O bursts block later decode batches; decode filling compute starves the next prompt enqueue. If the native stack tightly binds copy and compute, the scheduler cannot give idle SMs to another job class at microsecond scale. You think you are buying compute; you are buying queues and sync barriers. Around 2026, apps move from short single-turn chat to long-horizon agents. KV dwell time grows and batch shapes become irregular, so single-path tail latency and utilization degrade together.
Dual-path load and schedule: decouple I/O from compute
Dual-path (separate load and compute paths that can advance in parallel) is not “buy another network.” It lets two job classes interleave different subsystems on the same node. The load path shards prompts, weight pages, and KV pages from remote or local fast disk into compute-ready buffers, preferably via storage NICs and DMA. The compute path runs attention and FFN and aims to fill tensor cores. The scheduler keeps two queues and watermarks: when the compute queue thins, prefetch the next context; when the load queue backs up, shrink decode batches or migrate to idle compute instances. Principles include:
- Path isolation: copy engines and compute streams use independent streams/queues so implicit sync does not serialize the GPU.
- Watermark-driven control: feed back free GPU pages, NIC utilization, and SM occupancy, not QPS alone.
- Affinity and anti-affinity: long prefill near storage-bandwidth-rich nodes; pure decode in compute-dense pools so one GPU is not both disk and calculator.
- Preemption grain: preempt at layer or token-block level so a request does not lock a GPU for seconds.
With attention compression, the load path moves compressed latent KV instead of full multi-head KV. Bandwidth drops, prefetch windows can grow without blowing memory. Compute runs attention in latent space, so both FLOPs and memory traffic fall and decode batches fill the pipeline more easily. Throughput comes from less transfer, less wait, and less idle time—not from more cards alone.
How attention compression eases path pressure
Multi-head KV grows linearly with sequence length; at long context, GPU memory and HBM bandwidth exhaust before compute. Latent-attention-style methods project heads into a low-dimensional space and cache that, trading acceptable precision for much smaller resident state. For dual-path, each prefetch page is smaller, so the same NIC bandwidth covers more sessions; softmax and matmul shapes are tighter, so SMs stay occupied. Compression and decompression are compute: put them on the compute path and overlap with prefetch. Quantization or low-rank factors should track scheduler watermarks so decompress spikes do not re-sync isolated streams. Use object storage for cold context and local fast cache for hot KV pages. Alert separately on “NIC full, SM low” versus “SM full, NIC idle,” and scale load replicas or compute replicas accordingly.
Capacity planning and cost
In a 10k-GPU-class cluster, servers, network, and power are sized for peak accelerators. If more than half of compute waits on I/O or batches, daily waste is not only power but also revenue from unserved requests. Order of work: measure stage profiles (prefill/decode mix, KV lifetime, batch shape), then dual-path and compression, then scale GPUs. In the cloud, object storage can archive long prompts, message queues can shape requests, container platforms can autoscale load versus compute pools, and monitoring can split utilization across NIC, copy engine, and compute cores. On platforms such as Baidu AI Cloud these are general building blocks; the point is whether scheduling admits that the two jobs should not fight over one path.
Landing checklist
Confirm probes separately show storage NIC, host-to-device copy, and kernel timelines. Split load and compute onto independent streams and verify prefill bursts no longer raise decode tail latency. Add attention compression and compare concurrent sessions at the same memory. Rate-limit with watermarks rather than a fixed concurrency so long agent chains do not fill the pool. Do not report only peak tokens/s; also report effective SM occupancy, tokens per joule, and P99 copy-wait time. If the driver cannot expose copy–compute overlap, complete it in user space with multiple streams and event notifications rather than assuming the native path is already optimal.
Online inference waste comes from stage mismatch, not simply missing GPUs. Dual-path splits I/O and compute in the scheduler; attention compression shrinks transfer and resident volume. Together they turn accelerators from expensive waiting into billable useful compute. The longer the agent and the context, the more this architecture is a prerequisite for containing the cost curve, not an optional extra.
