As modern applications transition from monolithic to microservice-based architectures, GPUs have become indispensable for handling compute-intensive tasks like natural language processing and computer vision. However, existing GPU management systems often fail to account for the unique bottlenecks of spatial multitasking, leading to significant inefficiencies. This paper introduces Camelot, a novel runtime system designed to optimize GPU-based microservices. Camelot implements a zero-copy global memory communication mechanism and a contention-aware resource allocator to address communication overhead and resource interference.
The Efficiency Killers in GPU Microservices
The authors identify three primary "efficiency killers" that degrade performance in current GPU microservice deployments:
- Communication Overhead: Standard inter-process communication (IPC) typically requires data to be copied from the GPU to the CPU (host memory) and then back to the GPU for the next service in the chain. This "host-side bounce" is incredibly costly, often consuming nearly 50% of total query latency.
- Resource Contention: When multiple microservices share a single GPU via spatial multitasking, they compete for more than just Streaming Multiprocessors (SMs). They also contend for global memory bandwidth and the PCIe bus, which can lead to unpredictable performance interference.
- Pipeline Imbalance: A microservice chain is only as fast as its slowest stage. Without careful balancing, "backpressure" builds up, causing QoS violations across the entire pipeline.
The Camelot Runtime System
To overcome these hurdles, Camelot treats the GPU as a first-class citizen in the microservice ecosystem. Its architecture is built around several key innovations designed to minimize overhead and maximize resource utilization.
Global Memory-Based Communication
Instead of relying on traditional host-memory-based IPC, Camelot utilizes CUDA IPC to share memory handles between microservices residing on the same physical GPU. This enables a "zero-copy" transfer where a downstream service reads data directly from the previous stage’s memory space. This optimization effectively eliminates the host-memory bounce, which the authors found accounted for 32.4% to 46.9% of end-to-end latency in their tests.
Performance Prediction and Resource Allocation
Camelot employs a Decision Tree (DT) model to predict execution duration, memory bandwidth usage, and throughput based on batch size and SM allocation. This model allows the system to make smart, sub-millisecond allocation decisions. The system employs two primary policies:
- Policy 1 (Maximize Peak Load): Uses Simulated Annealing to find the optimal number of instances and SM quotas for each stage to maximize the throughput of the bottleneck stage.
- Policy 2 (Minimize Resource Usage): At low loads, it consolidates services to the minimum number of GPUs and SMs required to meet the QoS target, freeing up hardware for other tasks.
Experimental Evaluation
The authors evaluated Camelot using the Camelot Suite, a benchmark of real-world workloads including image recognition, captioning, and translation. Testing on both consumer-grade (Nvidia 2080Ti) and enterprise-grade (V100/DGX-2) hardware revealed substantial gains:
- Throughput Boost: Compared to state-of-the-art schedulers like Laius, Camelot increased the supported peak load by up to 64.5%.
- Resource Efficiency: At low loads, Camelot reduced GPU resource usage by 35% compared to Laius and by 46.5% compared to equal-allocation strategies.
- QoS Reliability: In scenarios where other systems suffered from "cascading QoS violations" due to unmanaged memory contention, Camelot maintained strict 99th-percentile latency targets.
Conclusion
Camelot demonstrates that efficient GPU microservice management requires moving beyond simple SM partitioning. By addressing "invisible" contention at the memory controller level and eliminating unnecessary data copies through direct GPU memory sharing, Camelot provides a robust framework for high-performance, resource-efficient AI services in the datacenter. Future work will explore extending these zero-copy benefits to cross-GPU communication and improving real-time migration strategies.
Summary updated