Overview
xLLM is a high-performance inference framework developed by JD.com to address the massive, "tidal" workloads characteristic of enterprise-grade AI services. By decoupling service management from the execution engine and introducing novel scheduling policies like Encode-Prefill-Decode (EPD) disaggregation, xLLM achieves up to 2.2× the throughput of existing frameworks like vLLM-Ascend while maintaining strict latency requirements.
The Challenge of Enterprise Scale
Deploying Large Language Models (LLMs) for massive consumer platforms, such as JD.com’s shopping assistants, presents two primary challenges:
- Workload Volatility: Online requests are highly unpredictable. Static hardware allocation for "Prefill" (prompt processing) or "Decode" (token generation) phases often leads to underutilized resources or severe bottlenecks during traffic spikes.
- Hardware Underutilization: Traditional engines often suffer from "computational bubbles"—idle periods where the accelerator waits for CPU scheduling. Furthermore, multimodal inputs and complex architectures like Mixture-of-Experts (MoE) introduce communication overheads that standard engines fail to hide effectively.
System Architecture
xLLM adopts a decoupled Service-Engine architecture to maximize flexibility and performance.
xLLM-Service (The Brain)
- Dynamic PD Disaggregation: Instances are treated as stateless. The scheduler can transition an instance between Prefill and Decode roles instantly based on real-time traffic, ensuring zero-wait-time scheduling.
- EPD Disaggregation: For multimodal models, xLLM introduces a three-phase "Encode-Prefill-Decode" strategy. Image encoding is treated as a distinct, independently scheduled stage to maximize parallel processing.
- Global KV Cache Management: Inspired by the Mooncake Store, xLLM uses a distributed architecture to manage memory across the cluster, allowing instances to offload and fetch cached data globally.
xLLM-Engine (The Brawn)
- Multi-layer Pipeline Execution: This overlaps CPU scheduling with accelerator operations. While the NPU computes the current batch, the CPU prepares metadata for the next, eliminating computational bubbles.
- Adaptive Graph Mode: Small kernels are fused into a single computation graph to reduce launch overhead. "Dimension parameterization" allows the system to handle variable sequence lengths without constant recompilation.
- xTensor Memory Management: This approach provides the performance of contiguous memory while utilizing a paged physical system to prevent fragmentation.
Advanced Scheduling and Resource Management
The framework's efficiency is driven by its sophisticated scheduling layer, which manages requests across specialized resource pools.
By treating the "Prefill" or "Decode" status as an attribute of the request rather than the instance, xLLM avoids the heavy overhead of reloading weights when shifting resources. Additionally, the engine utilizes "Dual-stream Parallelism" to split batches into micro-batches, using asynchronous streams to overlap heavy computation with data communication—a critical optimization for MoE models.
Performance Evaluation
xLLM was evaluated using public benchmarks (ShareGPT, Azure Code) and JD.com production datasets, including the JingYan AI shopping assistant. Key results include:
- Throughput Gains: On Qwen-series models, xLLM achieved up to 1.7× the throughput of MindIE and 2.2× that of vLLM-Ascend under identical latency constraints.
- DeepSeek Optimization: For DeepSeek models, the framework maintained a consistent 1.7× throughput advantage over MindIE.
- Real-world Impact: In generative recommendation scenarios, end-to-end latency was reduced by 23% compared to baseline implementations.
- Scalability: The system demonstrates near-linear scaling as more accelerators are added, avoiding the "scaling walls" typical of communication-heavy competitors.
Conclusion and Future Work
xLLM represents a significant step toward an "AI-Native OS." While currently optimized for transformer architectures, future development will focus on a Unified Hardware Abstraction Layer to ensure hardware-agnostic performance across diverse AI chips. Other goals include "Zero-Day Integration" for new model architectures and expanded support for text-to-video and other generative media modalities.
Summary updated