[Paper Review] Optimal Resource Allocation for Serverless Queries
This paper proposes TASQ, a machine learning system that predicts performance characteristic curves (PCCs) for serverless analytical queries using a novel simulator (AREPAS) to synthesize resource-performance data from a single query run. By modeling PCCs as monotonic, exponentially decaying curves and leveraging graph neural networks (GNNs) with constrained loss functions, TASQ enables accurate point and trend predictions of query runtimes across resource allocations, achieving under 22% median error in predictions for both observed and new queries.
Optimizing resource allocation for analytical workloads is vital for reducing costs of cloud-data services. At the same time, it is incredibly hard for users to allocate resources per query in serverless processing systems, and they frequently misallocate by orders of magnitude. Unfortunately, prior work focused on predicting peak allocation while ignoring aggressive trade-offs between resource allocation and run-time. Additionally, these methods fail to predict allocation for queries that have not been observed in the past. In this paper, we tackle both these problems. We introduce a system for optimal resource allocation that can predict performance with aggressive trade-offs, for both new and past observed queries. We introduce the notion of a performance characteristic curve (PCC) as a parameterized representation that can compactly capture the relationship between resources and performance. To tackle training data sparsity, we introduce a novel data augmentation technique to efficiently synthesize the entire PCC using a single run of the query. Lastly, we demonstrate the advantages of a constrained loss function coupled with GNNs, over traditional ML methods, for capturing the domain specific behavior through an extensive experimental evaluation over SCOPE big data workloads at Microsoft.
Motivation & Objective
- To address the challenge of inefficient resource allocation in serverless query systems, where users often misallocate resources by orders of magnitude.
- To enable accurate prediction of query performance across a range of resource allocations, including for new or ad-hoc queries with no historical execution data.
- To model the diminishing returns of resource allocation on query performance using a compact, parameterized performance characteristic curve (PCC).
- To overcome data sparsity in training by synthesizing realistic resource-performance skylines using a single query execution via the AREPAS simulator.
- To improve prediction accuracy over traditional ML methods by incorporating domain-specific constraints such as monotonicity and using graph neural networks (GNNs) with constrained loss functions.
Proposed method
- Introduces the performance characteristic curve (PCC) as a parameterized, monotonically decreasing function to model the trade-off between resource allocation and query runtime.
- Develops AREPAS, a novel data augmentation simulator that generates full PCCs from a single query run by emulating resource allocation at different token counts.
- Models the PCC using a power-law decay function with two parameters, ensuring monotonicity and interpretability for users.
- Employs graph neural networks (GNNs) with a constrained loss function to capture complex, domain-specific relationships between query features and performance, outperforming standard ML models.
- Trains models using both real historical data and synthetically augmented data from AREPAS to improve generalization for unseen queries.
- Uses a constrained loss function that enforces monotonicity in predictions, improving model reliability and alignment with real-world performance trends.
Experimental results
Research questions
- RQ1Can a machine learning model accurately predict query runtimes across a wide range of resource allocations, even for queries not previously observed?
- RQ2How effective is a single-query-based simulation (AREPAS) in synthesizing realistic performance skylines for training resource allocation models?
- RQ3To what extent do constrained loss functions and GNNs improve prediction accuracy compared to traditional ML models in modeling diminishing returns of resource allocation?
- RQ4How does the model’s performance vary between point prediction (specific resource allocation) and trend prediction (entire range of allocations)?
- RQ5What is the trade-off between model accuracy, inference speed, and computational cost when using GNNs versus simpler neural networks?
Key findings
- TASQ achieves a median absolute error (MAE) of 33% for run-time prediction on ground truth data, significantly outperforming XGBoost (53% MAE) and matching the performance of models trained on full historical data.
- The GNN model with constrained loss function achieves a 22% median error in trend prediction across all queries, demonstrating strong generalization to unseen workloads.
- AREPAS enables effective data augmentation: models trained on augmented data achieve performance comparable to those trained on full historical data, even with only a single real run per query.
- The GNN model with constrained loss outperforms both XGBoost and a standard neural network in both point and trend prediction, with 1.5× lower MAE for run-time and 2× lower MAE for curve parameters compared to XGBoost.
- The constrained loss function improves model reliability by enforcing monotonicity, which aligns with real-world performance trends and enhances user interpretability.
- The system enables users to make informed trade-offs between performance and resource usage, with 92% of jobs potentially reducing token usage by up to 50% with only 5% performance loss.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.