TL;DR
This paper introduces Torpor, a novel serverless platform designed to efficiently leverage GPUs for low-latency, resource-efficient machine learning inference. By employing a "late binding" approach to GPU resource allocation and intelligent model swapping, Torpor significantly reduces costs and improves GPU utilization compared to existing serverless solutions, while meeting strict latency Service Level Objectives (SLOs).
What Problem Does This Paper Address?
The increasing demand for machine learning inference has led to the adoption of serverless computing, which offers cost-effectiveness and simplified resource management. However, current serverless platforms struggle to efficiently support GPUs, a critical component for high-performance inference. Existing solutions often resort to "early binding," where GPUs are allocated to inference functions for extended periods, leading to high costs due to idle resources and poor GPU utilization. This approach also fails to meet the stringent latency requirements of many inference tasks and poses challenges for cloud providers in terms of resource management and cost efficiency. The authors aim to bridge this gap by creating a serverless platform that is GPU-efficient, cost-effective, and capable of meeting low-latency SLOs.
Methods
Torpor introduces several key innovations:
- Late Binding with Model Swapping: Instead of permanently assigning GPUs to functions, Torpor keeps inference models in host memory and dynamically swaps them onto GPUs only when a request arrives. This "late binding" approach ensures GPUs are only utilized when actively serving requests, enabling pay-per-use billing and significantly reducing idle costs.
- Asynchronous API Redirection: To minimize the overhead of GPU remoting, Torpor uses asynchronous redirection of CUDA API calls. This allows inference functions to issue commands to the GPU without waiting for immediate responses, improving efficiency.
- GPU Runtime Sharing and Isolation: Torpor offers flexible GPU runtime management, allowing for either sharing a single runtime across multiple models for better resource efficiency or maintaining dedicated runtimes for stricter isolation.
- Interference-Aware Request Scheduling: A sophisticated scheduling algorithm prioritizes requests to minimize latency, considering factors like model "heaviness" (bandwidth requirements for swapping) and leveraging fast NVLink interconnects for GPU-to-GPU transfers.
- Efficient GPU Memory Management: Torpor implements a system to manage GPU memory addresses and allocations efficiently, reducing fragmentation and overhead associated with frequent model swapping.
- Model Eviction Policy: An intelligent eviction policy prioritizes removing less critical models from GPU memory to make space for incoming requests, further optimizing performance.
Datasets
The paper does not explicitly mention training datasets. For evaluation, they utilize real-world production traces from Alibaba Cloud, which include various inference workloads such as image processing, text generation, and image generation. They also evaluate with popular ML models like ResNet-152, Bert-qa, DenseNet-169, and others, as listed in Table 4.
Key Insights and Ideas
- Late Binding is Key to Serverless GPU Efficiency: The core insight is that by decoupling GPU allocation from function invocation (late binding) and using host memory as a staging area, significant cost savings and improved GPU utilization can be achieved in serverless environments.
- Model Swapping Overhead Can Be Managed: While model swapping introduces latency, Torpor demonstrates that with careful scheduling, asynchronous operations, and optimized memory management, this overhead can be minimized to be comparable to native execution.
- Interference-Aware Scheduling is Crucial: The performance of model swapping is heavily influenced by contention on interconnects like PCIe. Torpor's approach of categorizing models by "heaviness" and prioritizing NVLink for transfers is critical for mitigating this interference.
- Serverless Inference Needs SLO Compliance: Simply providing GPU access isn't enough; serverless platforms must actively ensure that inference requests meet user-defined latency Service Level Objectives (SLOs), which Torpor's policies are designed to achieve.
Key Results
- Cost Savings: Torpor achieved an average cost saving of 70% for users and 65% for the platform in a pilot deployment on Alibaba Cloud.
- Performance: Torpor's inference latency is comparable to native execution, even with model swapping. For low-frequency functions, Torpor achieved over 10x higher throughput than native execution.
- GPU Utilization: Torpor can serve hundreds of inference functions on a single worker node with 4 GPUs, demonstrating high GPU utilization.
- SLO Compliance: Torpor consistently meets per-function latency SLOs, even with a large number of functions (e.g., over 1000 in cluster evaluations).
- Startup Latency: Torpor reduces model startup latencies by over an order of magnitude compared to cold starts in traditional serverless platforms.
Limitations and Future Work
The authors identify several areas for future investigation:
- Extremely Infrequent Functions: Functions invoked only a few times per hour still incur host memory costs. Future work could explore multi-tier storage architectures and cheaper storage solutions for such functions.
- Very Large Models: Torpor currently doesn't support model-parallel execution across multiple GPUs for extremely large models. Extending Torpor to leverage interconnects for model parallelism and pipeline execution is a key future direction.
- Highly Bursty Workloads: While optimized for low-frequency functions, highly bursty workloads might benefit from proactive caching of model replicas across nodes. Exploring high-speed inter-node networks for efficient model loading is suggested.
Summary updated