TL;DR
This paper introduces MOPAR, a novel framework for partitioning deep learning models to run efficiently on serverless platforms. By intelligently splitting models and optimizing communication, MOPAR significantly improves resource utilization and reduces costs while maintaining low latency, making serverless DL inference more practical and cost-effective.
What Problem Does This Paper Address?
Deploying deep learning inference services (DLISs) on serverless platforms is attractive due to their elasticity and pay-as-you-go pricing. However, a major challenge arises because DL models have layers with vastly different computational demands. When a DLIS is deployed as a single function, the entire function must be provisioned with resources sufficient for the most demanding layer. This leads to significant underutilization of resources and increased costs for less demanding layers. Furthermore, managing these resource-intensive functions can become complex as models grow larger. The paper aims to solve this by intelligently partitioning DL models to better match resource allocation to actual demand, thereby improving efficiency and reducing costs without sacrificing performance.
Methods
MOPAR employs a hybrid model partitioning strategy. It first identifies two key resource usage patterns in DLISs: "global differences" (varying demands across different layers) and "local similarity" (similar demands in adjacent layers), attributed to "resource dominant" (RD) operators.
- Vertical Partitioning: The DL model is initially divided vertically into multiple "slices," where each slice contains layers with similar resource requirements. This improves overall resource efficiency.
- Horizontal Partitioning (for RD layers): Slices containing RD operators are further partitioned into multiple "sub-slices." This enables parallel optimization within these demanding parts of the model to reduce inference latency.
- Communication Optimization: To mitigate the overhead introduced by communication between slices, MOPAR uses two techniques:
- Data Compression: An auto-encoder (AE) is used to compress intermediate tensor data passed between slices, reducing the amount of data transferred.
- Share-Memory: A share-memory mechanism (using
tmpfsdirectories and message channels) is employed to speed up data exchange between slices, minimizing the need for costly data copying.
The framework includes a Service Profiler to estimate resource needs and a Model Partitioning Engine to determine the optimal partitioning strategy.
Datasets
The paper does not explicitly mention specific training datasets for the DL models. However, it evaluates MOPAR on a diverse set of 12 DL models across four categories:
- Four Convolutional Neural Networks (CNNs): VGG, ResNet50, Inception, ConvNeXt.
- Two Recurrent Neural Networks (RNNs): LSTM+CNN, GRU+CNN.
- Two Graph Neural Networks (GCNs).
- Four Transformer-based models: BERT-1.3B, BERT-3.0B, DisBERT, Transformer-2.6B.
The workload for DLIS requests was generated based on diurnal service submissions from the PAI platform, mimicking real-world traffic patterns with varying arrival rates and data sizes.
Key Insights and Ideas
- Resource Dominant Operators are Key: The paper highlights that a small subset of "resource dominant" (RD) operators significantly dictates the resource demands of a DLIS, leading to the observed global differences in layer resource usage.
- Local Similarity Enables Efficient Grouping: Adjacent layers often exhibit similar resource needs, allowing them to be grouped into slices without substantial performance penalties, thereby improving resource utilization.
- Partitioning is a Trade-off: While partitioning DLISs can reduce computational costs, it introduces communication overhead. MOPAR's hybrid approach and communication optimization are crucial for balancing these trade-offs.
- Data Compression is Effective: Techniques like auto-encoders can significantly reduce communication costs with minimal impact on accuracy, making partitioned DLISs more efficient.
- Serverless Platforms Benefit Greatly: MOPAR's design is specifically tailored for serverless environments, leveraging their elasticity while mitigating their inherent communication challenges.
Key Results
MOPAR demonstrated significant improvements across various metrics:
- Resource Efficiency: MOPAR improved resource efficiency by 27.62% on average for non-transformer DLISs compared to baselines.
- Latency Reduction: Latency was reduced by approximately 5.52% on average. For Transformer-based DLISs, latency was reduced by an average of 16.63%.
- Cost Reduction: On AWS Lambda, MOPAR achieved a cost reduction of approximately 2.58x compared to the unsplit method. In OpenFaaS, it reduced costs by about 5.6x.
- Transformer Models: MOPAR effectively reduced latency for Transformer models by an average of 16.63%, despite their complex self-attention layers.
- GPU Inference: For LLMs on GPUs, MOPAR showed notable inference speed improvements (e.g., 6.32% with 2 GPUs, 6.64% with 4 GPUs on average compared to "Default") and significantly outperformed NonSplit.
Limitations and Future Work
- Limitations:
- The paper notes that while MOPAR reduces latency, the communication overhead between slices is still a factor, especially in environments like AWS Lambda where share-memory mechanisms might be less optimized.
- The effectiveness of the AE for compression is dependent on the data and model characteristics, and there's a trade-off between compression ratio and accuracy.
- Serverless platforms currently have limited support for spatial parallelization of GPUs, which could be a bottleneck for large-scale GPU-based DLISs.
- Future Work:
- The authors plan to focus on optimizing DLISs on GPU-based serverless platforms.
- They also intend to explore profiling new models based on existing ones to further enhance the framework's adaptability.
- Further investigation into optimizing DLISs for large models on GPUs is a key future direction.
Summary updated