Abstract
Large Language Model (LLM) inference on heterogeneous clusters—environments with varying hardware accelerators—presents significant scheduling challenges. Traditional round-robin methods often lead to bottlenecks on slower hardware while faster nodes remain underutilized. This paper proposes a two-stage system combining a lightweight deployment optimization strategy with a novel, memory-aware request scheduler. By modeling inference phases and incorporating KV cache usage into scheduling logic, the system achieves throughput improvements of up to 122.5% compared to standard methods.
Introduction
As LLMs become ubiquitous, the cost of inference has emerged as a major operational bottleneck. Many organizations utilize heterogeneous clusters composed of different GPU generations (e.g., NVIDIA V100s and A800s) or diverse accelerators like NPUs. Standard inference engines typically employ Round-Robin scheduling, which distributes requests equally. In mixed-hardware environments, this approach is inefficient: the slowest machine dictates the system's overall pace, leaving high-performance hardware idle. Furthermore, determining the optimal deployment configuration (e.g., Tensor Parallelism degrees) usually requires exhaustive, time-consuming benchmarking for every hardware combination.
Methods
The proposed system addresses these inefficiencies through a two-stage optimization process.
Deployment Configuration Optimization
Instead of relying on heavy benchmarks, the system utilizes lightweight profiling. It models the inference time of both prefill and decoding phases as linear functions of batch size and sequence length. By fitting eight constants per hardware type, the system can mathematically estimate the throughput of various configurations (e.g., one instance on eight GPUs versus four instances on two GPUs each) and select the optimal setup.
Memory-Aware Request Scheduling
The core of the system is a "Workload Calculator" that intelligently routes incoming requests. The scheduler uses a specific workload formula to balance computational capacity and memory pressure:
$$w_r^s = T_r^s \cdot e^{\theta \cdot kvusage(s)}$$
where $T_r^s$ represents the computational capacity (speed) of the instance and $kvusage(s)$ represents the current memory pressure (KV cache occupancy). This exponential term creates a "soft" pressure system: as a machine's memory fills, its perceived workload spikes, naturally diverting new requests to other nodes before an Out-of-Memory (OOM) error occurs.
Evaluation and Results
The system was evaluated using the ShareGPT_Vicuna_unfiltered dataset, a standard benchmark for real-world conversation prompts with varying input and output lengths.
Key results include:
- Single-Machine Heterogeneity: In tests with two instances on the same machine with different resource allocations, the proposed scheduler improved throughput by 122.5% over Round-Robin.
- Multi-Machine Heterogeneity: In a cluster combining 8x V100 GPUs and 1x A800 GPU, the system achieved a 33.6% throughput increase.
- Load Balancing: Completion times across different hardware types were significantly more uniform compared to traditional methods, demonstrating effective workload balancing.
Discussion
A critical insight from this work is that while lightweight mathematical models may not predict exact throughput values due to complexities like continuous batching, they are highly effective at ranking configurations. This allows for rapid optimization without exhaustive testing.
However, some limitations remain. The current system assumes each inference instance is deployed on a single machine and does not yet explore pipeline parallelism across multiple physical nodes—a necessity for massive models like Llama-3 400B. Additionally, the scheduler's performance is tied to the accuracy of the "Output Length Predictor." Future work will focus on expanding hardware support to include a wider variety of accelerators like AMD GPUs and specialized NPUs.
Conclusion
By integrating lightweight profiling with a memory-aware scheduler, this system provides a robust solution for maximizing LLM inference throughput in heterogeneous environments. The approach effectively mitigates hardware bottlenecks and prevents memory-related failures, offering a scalable path for cost-effective LLM deployment.
Summary updated