SlideShare a Scribd company logo
Predicting Optimal
Parallelism for Data
Analytics
Rathijit Sen, Vishal Rohra
Agenda
▪ Overview
▪ AutoDOP
▪ AutoToken
▪ TASQ (AutoToken_vNext)
▪ AutoExecutor
▪ Summary
Resource Provisioning in the Cloud
• Focus: Automatically predict Optimal Parallelism for jobs
• Allow flexibility in selecting optimal point for cost-efficient performance
• Enable optimal resource provisioning
Users
dynamic,
fine-grained
provisioning
for jobs
Providers
Provision
cluster
capacities
How much resources does a job actually need?
General Approach
• Prediction of job run time or peak parallelism :
Peak Parallelism = f (query characteristics) [lowest run time]
Run time = f (query characteristics, #parallelism)
• Query characteristics: compile/optimization time-
properties and estimates
• Learn f using Machine Learning models on past executions
Case Studies
Performance Characteristic Curve (PCC)
Run
Time
Parallelism
Study Platform Num Nodes Prediction
AutoDOP SQL Server Single Run Time
AutoToken Cosmos Multiple Peak Parallelism
AutoToken_vNext /
TASQ
Cosmos Multiple
Run Time, PCC
(Strictly Monotonic)
AutoExecutor Spark Multiple PCC (Monotonic)
AutoDOP
Zhiwei Fan, RathijitSen, Paris Koutris, Aws Albarghouthi,“Automated Tuning of Query Degree of Parallelism via
MachineLearning”, aiDM@SIGMOD, 2020
Zhiwei Fan, RathijitSen, Paris Koutris, Aws Albarghouthi,“A ComparativeExplorationof ML Techniques for Tuning
Query Degree of Parallelism”, arXiv, 2020
Context
• Platform: SQL Server, single node
• Degree Of Parallelism (DOP)
• Maximum number of threads that can be active at any time for query execution
• Per-query selection
• Impact of DOP for running a query:
• Query Performance and Cost
• Resource Utilization of Multicore Servers
• Resource Provisioning in Cloud-Computing Platforms
Dependence on query characteristics
TPC-DS1000 Example Queries
Well-Parallelizable Queries
Other Queries
Dependence on data size (scale factor)
• The average and median shift towards larger DOP values
as the scale factor/dataset size increases
• More variation in TPC-DS
compared to TPC-H due to
the larger variety of query
templates in TPC-DS
• No workload has a single
per-query optimal DOP value
Approach
• Goal: predict optimal DOP
• ML model type: Regression, not Classification
• More flexibility in choosing optimal point for cost vs performance tradeoffs
ML Model
Random Forest
…
• Query plan operators
• Number of tuples
(cardinality), other
compile/optimization-
time estimates
Run time
DOP +
Example results
• AutoDOP is closer to optimal (oracle selection) than static DOP selection policies
• ML: each query at predicted-optimal DOP
given by ML model
• Query-Optimal: each query at Optimal DOP
(oracle selection)
• Workload-Optimal: all queries at optimal
DOP for overall workload (oracle selection)
• 40: each query at DOP 40
• 80: each query at DOP 40
• Speedup over DOP 64 (default DOP)
TPC-DS1000 Queries (subset)
0
0.2
0.4
0.6
0.8
1
1.2
1.4
Test 1 Test 2
Speedup
ML Query-Optimal Workload-Optimal 40 80
Case Studies
Performance Characteristic Curve (PCC)
Run
Time
Parallelism
Study Platform Num Nodes Prediction
AutoDOP SQL Server Single Run Time
AutoToken Cosmos Multiple Peak Parallelism
AutoToken_vNext /
TASQ
Cosmos Multiple
Run Time, PCC
(Strictly Monotonic)
AutoExecutor Spark Multiple PCC (Monotonic)
AutoToken
RathijitSen, Alekh Jindal,Hiren Patel, Shi Qiao, “AutoToken:Predicting Peak Parallelismfor Big Data Analyticsat
Microsoft”, VLDB, 2020
Context
• Platform: Exabyte-scale Big Data analytics platform for SCOPE
queries
• Token: unit of resource allocation
• Per-job allocation
• Guaranteed and spare tokens
• Impact of number of tokens for running a job:
• Query performance and cost
• Resource utilization and provisioning
Peak Parallelism / Peak Resource Provisioning
• How many guaranteed tokens to request for the job?
• Depends on peak parallelism
• More tokens: unnecessary wait time, unused guaranteed tokens
• Less tokens: loss of performance or predictable performance
• Possible options:
• Default value
• User guesstimate
• Default VC percentage
Approach
• Automatically eliminate over-allocations for recurring jobs
• Ideally, no performance impact
• Use ML models to learn peak tokens from past behavior
• Simple models per job group (signature)
Default Allocation
Over-
allocation
Resources
Ideal
Allocation
AutoToken
Results
• Overall prediction accuracy:
• Median error: 0
• 90th percentile error  50%
• Coverage: 10.7%—28.1%
• #Jobs:
• Total: approx. 8.8M
• 0.8—2.4M training
• 162—528K testing
RequestedTokens/ActualPeak
Cumulative
Percentage
Resource Allocation Policies
Peak Allocation
Resources
Resources
TightAllocation
AutoToken
(only recurring jobs)
TASQ
TASQ
Anish Pimpley, Shuo Li, AnubhaSrivastava, Vishal Rohra, Yi Zhu, Soundarajan Srinivasan,Alekh Jindal,Hiren Patel, Shi
Qiao, Rathijit Sen, “OptimalResource Allocationfor Serverless Queries”, [Under Submission]
Why Tight Allocation
• Cost Savings
• Negligible change in performance
• 50% of the jobs can request fewer tokens
• 20% require less than 50% of requested tokens
• 5% performance loss
• 92% of the jobs can request fewer tokens
• 30% require less than 50% of requested tokens
• Reduces job wait times
• Wider resource availability
TASQ’s Approach
Given compile time features of a job
=> Predict Tight Allocation
Observation
• Optimal allocation means different thing for different users, f(cost, time)
• Predicting the relationship between tokens and runtime >> Predicting Tight allocation
• Relationship between tokens and runtime is an exponentially decaying curve,
referred to as performance characteristic curve (PCC)
Parameters (a, b)
for PCC
Challenge: Limited Trend Data
• Historical workloads executed with single token count
• In order to predict PCC, we need data for multiple token counts
Solution: Data Augmentation
• Area Preserving Allocation
Simulator (AREPAS)
• Based on past skylines, generate skylines
for multiple token counts using the simulator.
• Assumptions
• Total computations stay constant
• Total tokens-seconds used stay constant
• Area under skyline stays constant
Modeling the Runtime vs Token relationship
• Need for monotonically non-increasing curve
• User expectation: more resources → faster runtime
• ‘Elbow’ region of the curve usually emerges before parallelism overhead
• How do you enforce that in modeling
• Expect a power-law curve
Runtime t(n) = f (n: TokenAllocation) = b * n -a where a, b > 0
Predict: Scalar parameters ‘a’ and ‘b’
Results
• XGBoost are not designed to enforce monotonicity
• NN and GNN perform better in trend prediction
• NN has comparable performance with lower training time
Model
Pattern
(Non-Increase)
MAE
(Curve Params)
Median AE
(Run-Time)
XGBoost SS 32% NA 53%
XGBoost PL 93% 0.202 52%
NN 100% 0.163 39%
GNN 100% 0.168 33%
User Interface
• Workflow
• Submit the job script
• Graph generated at compile time
• Two options
• Visualize the Runtime vs Token Predictions
• Get an optimal token count
• Advantages
• Informed decision
• For all jobs
• Before job execution
Integration
• Bullet 1
• Sub-bullet
• Sub-bullet
• Bullet 2
• Sub-bullet
• Sub-bullet
Case Studies
Performance Characteristic Curve (PCC)
Run
Time
Parallelism
Study Platform Num Nodes Prediction
AutoDOP SQL Server Single Run Time
AutoToken Cosmos Multiple Peak Parallelism
AutoToken_vNext /
TASQ
Cosmos Multiple
Run Time, PCC
(Strictly Monotonic)
AutoExecutor Spark Multiple PCC (Monotonic)
AutoExecutor
RathijitSen, Abhishek Roy, Alekh Jindal,Rui Fang, Jeff Zheng, XiaoleiLiu, Ruiping Li, “AutoExecutor: Predictive
Parallelism for Spark SQL Queries”, [Under Submission]
Context
• Platform: Spark, Azure Synapse
• Executors: processes on worker nodes
• Each executor can use a certain number or cores and amount of memory
• Impact of number of executors for running a query:
• Query performance and cost
• Resource utilization and provisioning
Modeling Approach
• Reuse and extend TASQ PCC model
• Power-law curve with lower bound
• Run time t(n) with executor count n:
t(n) = max(b*na , m)
• a, b, m: parameters
ML Model
• Count of operators
• Input Cardinality
• Avg. Row length
• …
PCC model parameters
Random Forest
…
t(n) = b*na
t(n) = m
Example predictions
• Sparklens: predict after one execution of the query
• AutoExecutor: predict before execution of the query
Error distributions (different templates, SF=100)
• Most prediction errors at small number of executors
S: Sparklens
AE: AutoExecutor
F1..F10:
• ten-fold cross
validation
• 80% queries in
training set
• 20% in test set
System Architecture
Feature Extraction
Model Training
Extensions
Workload
Table
Anonymized
Plans, Metrics
Executor Events
Telemetry Pipeline
AutoExecutor
Workload Analysis
Peregrine Events
PCC
Summary
Automatic selection of optimal parallelism
• Capability and Approach:
• Enable selection of optimal operating point with respect to optimization objective
• ML models to predict run time/peak parallelism using query characteristics
• Challenges:
• Modeling PCC characteristics
• AutoDOP: Point-wise
• TASQ: Point-wise, Power-law function
• AutoExecutor: Power-law + constant function
• Collecting training data
• TASQ: AREPAS
• AutoExecutor: Sparklens
Could we have other
models for PCC?
How would you simulate
for other parameter
changes?
Feedback
Your feedback is important to us.
Don’t forget to rate and review the sessions.

More Related Content

What's hot

Intuitive & Scalable Hyperparameter Tuning with Apache Spark + Fugue
Intuitive & Scalable Hyperparameter Tuning with Apache Spark + FugueIntuitive & Scalable Hyperparameter Tuning with Apache Spark + Fugue
Intuitive & Scalable Hyperparameter Tuning with Apache Spark + Fugue
Databricks
 
Building Deep Reinforcement Learning Applications on Apache Spark with Analyt...
Building Deep Reinforcement Learning Applications on Apache Spark with Analyt...Building Deep Reinforcement Learning Applications on Apache Spark with Analyt...
Building Deep Reinforcement Learning Applications on Apache Spark with Analyt...
Databricks
 
Improving the Life of Data Scientists: Automating ML Lifecycle through MLflow
Improving the Life of Data Scientists: Automating ML Lifecycle through MLflowImproving the Life of Data Scientists: Automating ML Lifecycle through MLflow
Improving the Life of Data Scientists: Automating ML Lifecycle through MLflow
Databricks
 
Raven: End-to-end Optimization of ML Prediction Queries
Raven: End-to-end Optimization of ML Prediction QueriesRaven: End-to-end Optimization of ML Prediction Queries
Raven: End-to-end Optimization of ML Prediction Queries
Databricks
 
SnappyData, the Spark Database. A unified cluster for streaming, transactions...
SnappyData, the Spark Database. A unified cluster for streaming, transactions...SnappyData, the Spark Database. A unified cluster for streaming, transactions...
SnappyData, the Spark Database. A unified cluster for streaming, transactions...
SnappyData
 

What's hot (20)

Managing Millions of Tests Using Databricks
Managing Millions of Tests Using DatabricksManaging Millions of Tests Using Databricks
Managing Millions of Tests Using Databricks
 
Intuitive & Scalable Hyperparameter Tuning with Apache Spark + Fugue
Intuitive & Scalable Hyperparameter Tuning with Apache Spark + FugueIntuitive & Scalable Hyperparameter Tuning with Apache Spark + Fugue
Intuitive & Scalable Hyperparameter Tuning with Apache Spark + Fugue
 
Building Deep Reinforcement Learning Applications on Apache Spark with Analyt...
Building Deep Reinforcement Learning Applications on Apache Spark with Analyt...Building Deep Reinforcement Learning Applications on Apache Spark with Analyt...
Building Deep Reinforcement Learning Applications on Apache Spark with Analyt...
 
ModelDB: A System to Manage Machine Learning Models: Spark Summit East talk b...
ModelDB: A System to Manage Machine Learning Models: Spark Summit East talk b...ModelDB: A System to Manage Machine Learning Models: Spark Summit East talk b...
ModelDB: A System to Manage Machine Learning Models: Spark Summit East talk b...
 
How to use Apache TVM to optimize your ML models
How to use Apache TVM to optimize your ML modelsHow to use Apache TVM to optimize your ML models
How to use Apache TVM to optimize your ML models
 
Semantic Image Logging Using Approximate Statistics & MLflow
Semantic Image Logging Using Approximate Statistics & MLflowSemantic Image Logging Using Approximate Statistics & MLflow
Semantic Image Logging Using Approximate Statistics & MLflow
 
Improving the Life of Data Scientists: Automating ML Lifecycle through MLflow
Improving the Life of Data Scientists: Automating ML Lifecycle through MLflowImproving the Life of Data Scientists: Automating ML Lifecycle through MLflow
Improving the Life of Data Scientists: Automating ML Lifecycle through MLflow
 
Unified MLOps: Feature Stores & Model Deployment
Unified MLOps: Feature Stores & Model DeploymentUnified MLOps: Feature Stores & Model Deployment
Unified MLOps: Feature Stores & Model Deployment
 
Raven: End-to-end Optimization of ML Prediction Queries
Raven: End-to-end Optimization of ML Prediction QueriesRaven: End-to-end Optimization of ML Prediction Queries
Raven: End-to-end Optimization of ML Prediction Queries
 
Using Crowdsourced Images to Create Image Recognition Models with Analytics Z...
Using Crowdsourced Images to Create Image Recognition Models with Analytics Z...Using Crowdsourced Images to Create Image Recognition Models with Analytics Z...
Using Crowdsourced Images to Create Image Recognition Models with Analytics Z...
 
Object Detection with Transformers
Object Detection with TransformersObject Detection with Transformers
Object Detection with Transformers
 
Degrading Performance? You Might be Suffering From the Small Files Syndrome
Degrading Performance? You Might be Suffering From the Small Files SyndromeDegrading Performance? You Might be Suffering From the Small Files Syndrome
Degrading Performance? You Might be Suffering From the Small Files Syndrome
 
Best Practices for Building Robust Data Platform with Apache Spark and Delta
Best Practices for Building Robust Data Platform with Apache Spark and DeltaBest Practices for Building Robust Data Platform with Apache Spark and Delta
Best Practices for Building Robust Data Platform with Apache Spark and Delta
 
SnappyData, the Spark Database. A unified cluster for streaming, transactions...
SnappyData, the Spark Database. A unified cluster for streaming, transactions...SnappyData, the Spark Database. A unified cluster for streaming, transactions...
SnappyData, the Spark Database. A unified cluster for streaming, transactions...
 
Deploying Machine Learning Models to Production
Deploying Machine Learning Models to ProductionDeploying Machine Learning Models to Production
Deploying Machine Learning Models to Production
 
Creating an end-to-end Recommender System with Apache Spark and Elasticsearch...
Creating an end-to-end Recommender System with Apache Spark and Elasticsearch...Creating an end-to-end Recommender System with Apache Spark and Elasticsearch...
Creating an end-to-end Recommender System with Apache Spark and Elasticsearch...
 
SnappyData overview NikeTechTalk 11/19/15
SnappyData overview NikeTechTalk 11/19/15SnappyData overview NikeTechTalk 11/19/15
SnappyData overview NikeTechTalk 11/19/15
 
Willump: Optimizing Feature Computation in ML Inference
Willump: Optimizing Feature Computation in ML InferenceWillump: Optimizing Feature Computation in ML Inference
Willump: Optimizing Feature Computation in ML Inference
 
Scaling Machine Learning To Billions Of Parameters
Scaling Machine Learning To Billions Of ParametersScaling Machine Learning To Billions Of Parameters
Scaling Machine Learning To Billions Of Parameters
 
Machine Learning as a Service: Apache Spark MLlib Enrichment and Web-Based Co...
Machine Learning as a Service: Apache Spark MLlib Enrichment and Web-Based Co...Machine Learning as a Service: Apache Spark MLlib Enrichment and Web-Based Co...
Machine Learning as a Service: Apache Spark MLlib Enrichment and Web-Based Co...
 

Similar to Predicting Optimal Parallelism for Data Analytics

Low latency high throughput streaming using Apache Apex and Apache Kudu
Low latency high throughput streaming using Apache Apex and Apache KuduLow latency high throughput streaming using Apache Apex and Apache Kudu
Low latency high throughput streaming using Apache Apex and Apache Kudu
DataWorks Summit
 

Similar to Predicting Optimal Parallelism for Data Analytics (20)

Apache Spark-Based Stratification Library for Machine Learning Use Cases at N...
Apache Spark-Based Stratification Library for Machine Learning Use Cases at N...Apache Spark-Based Stratification Library for Machine Learning Use Cases at N...
Apache Spark-Based Stratification Library for Machine Learning Use Cases at N...
 
Apache Spark-Based Stratification Library for Machine Learning Use Cases at N...
Apache Spark-Based Stratification Library for Machine Learning Use Cases at N...Apache Spark-Based Stratification Library for Machine Learning Use Cases at N...
Apache Spark-Based Stratification Library for Machine Learning Use Cases at N...
 
Concurrency
ConcurrencyConcurrency
Concurrency
 
Towards True Elasticity of Spark-(Michael Le and Min Li, IBM)
Towards True Elasticity of Spark-(Michael Le and Min Li, IBM)Towards True Elasticity of Spark-(Michael Le and Min Li, IBM)
Towards True Elasticity of Spark-(Michael Le and Min Li, IBM)
 
Javantura v4 - Java and lambdas and streams - are they better than for loops ...
Javantura v4 - Java and lambdas and streams - are they better than for loops ...Javantura v4 - Java and lambdas and streams - are they better than for loops ...
Javantura v4 - Java and lambdas and streams - are they better than for loops ...
 
Mining big data streams with APACHE SAMOA by Albert Bifet
Mining big data streams with APACHE SAMOA by Albert BifetMining big data streams with APACHE SAMOA by Albert Bifet
Mining big data streams with APACHE SAMOA by Albert Bifet
 
Mining Big Data Streams with APACHE SAMOA
Mining Big Data Streams with APACHE SAMOAMining Big Data Streams with APACHE SAMOA
Mining Big Data Streams with APACHE SAMOA
 
SnappyData at Spark Summit 2017
SnappyData at Spark Summit 2017SnappyData at Spark Summit 2017
SnappyData at Spark Summit 2017
 
Spark Summit EU talk by Ram Sriharsha and Vlad Feinberg
Spark Summit EU talk by Ram Sriharsha and Vlad FeinbergSpark Summit EU talk by Ram Sriharsha and Vlad Feinberg
Spark Summit EU talk by Ram Sriharsha and Vlad Feinberg
 
The Power of Auto ML and How Does it Work
The Power of Auto ML and How Does it WorkThe Power of Auto ML and How Does it Work
The Power of Auto ML and How Does it Work
 
PAC 2019 virtual Alexander Podelko
PAC 2019 virtual Alexander Podelko PAC 2019 virtual Alexander Podelko
PAC 2019 virtual Alexander Podelko
 
Driving Moore's Law with Python-Powered Machine Learning: An Insider's Perspe...
Driving Moore's Law with Python-Powered Machine Learning: An Insider's Perspe...Driving Moore's Law with Python-Powered Machine Learning: An Insider's Perspe...
Driving Moore's Law with Python-Powered Machine Learning: An Insider's Perspe...
 
Low Latency Polyglot Model Scoring using Apache Apex
Low Latency Polyglot Model Scoring using Apache ApexLow Latency Polyglot Model Scoring using Apache Apex
Low Latency Polyglot Model Scoring using Apache Apex
 
Performance Testing Java Applications
Performance Testing Java ApplicationsPerformance Testing Java Applications
Performance Testing Java Applications
 
Spark Autotuning: Spark Summit East talk by Lawrence Spracklen
Spark Autotuning: Spark Summit East talk by Lawrence SpracklenSpark Autotuning: Spark Summit East talk by Lawrence Spracklen
Spark Autotuning: Spark Summit East talk by Lawrence Spracklen
 
Spark Autotuning - Spark Summit East 2017
Spark Autotuning - Spark Summit East 2017 Spark Autotuning - Spark Summit East 2017
Spark Autotuning - Spark Summit East 2017
 
Deep Learning Automated Helpdesk
Deep Learning Automated HelpdeskDeep Learning Automated Helpdesk
Deep Learning Automated Helpdesk
 
Data Stream Management
Data Stream ManagementData Stream Management
Data Stream Management
 
Deep-Dive into Deep Learning Pipelines with Sue Ann Hong and Tim Hunter
Deep-Dive into Deep Learning Pipelines with Sue Ann Hong and Tim HunterDeep-Dive into Deep Learning Pipelines with Sue Ann Hong and Tim Hunter
Deep-Dive into Deep Learning Pipelines with Sue Ann Hong and Tim Hunter
 
Low latency high throughput streaming using Apache Apex and Apache Kudu
Low latency high throughput streaming using Apache Apex and Apache KuduLow latency high throughput streaming using Apache Apex and Apache Kudu
Low latency high throughput streaming using Apache Apex and Apache Kudu
 

More from Databricks

Democratizing Data Quality Through a Centralized Platform
Democratizing Data Quality Through a Centralized PlatformDemocratizing Data Quality Through a Centralized Platform
Democratizing Data Quality Through a Centralized Platform
Databricks
 
Stage Level Scheduling Improving Big Data and AI Integration
Stage Level Scheduling Improving Big Data and AI IntegrationStage Level Scheduling Improving Big Data and AI Integration
Stage Level Scheduling Improving Big Data and AI Integration
Databricks
 
Simplify Data Conversion from Spark to TensorFlow and PyTorch
Simplify Data Conversion from Spark to TensorFlow and PyTorchSimplify Data Conversion from Spark to TensorFlow and PyTorch
Simplify Data Conversion from Spark to TensorFlow and PyTorch
Databricks
 
Processing Large Datasets for ADAS Applications using Apache Spark
Processing Large Datasets for ADAS Applications using Apache SparkProcessing Large Datasets for ADAS Applications using Apache Spark
Processing Large Datasets for ADAS Applications using Apache Spark
Databricks
 

More from Databricks (20)

DW Migration Webinar-March 2022.pptx
DW Migration Webinar-March 2022.pptxDW Migration Webinar-March 2022.pptx
DW Migration Webinar-March 2022.pptx
 
Data Lakehouse Symposium | Day 1 | Part 1
Data Lakehouse Symposium | Day 1 | Part 1Data Lakehouse Symposium | Day 1 | Part 1
Data Lakehouse Symposium | Day 1 | Part 1
 
Data Lakehouse Symposium | Day 1 | Part 2
Data Lakehouse Symposium | Day 1 | Part 2Data Lakehouse Symposium | Day 1 | Part 2
Data Lakehouse Symposium | Day 1 | Part 2
 
Data Lakehouse Symposium | Day 2
Data Lakehouse Symposium | Day 2Data Lakehouse Symposium | Day 2
Data Lakehouse Symposium | Day 2
 
Data Lakehouse Symposium | Day 4
Data Lakehouse Symposium | Day 4Data Lakehouse Symposium | Day 4
Data Lakehouse Symposium | Day 4
 
5 Critical Steps to Clean Your Data Swamp When Migrating Off of Hadoop
5 Critical Steps to Clean Your Data Swamp When Migrating Off of Hadoop5 Critical Steps to Clean Your Data Swamp When Migrating Off of Hadoop
5 Critical Steps to Clean Your Data Swamp When Migrating Off of Hadoop
 
Democratizing Data Quality Through a Centralized Platform
Democratizing Data Quality Through a Centralized PlatformDemocratizing Data Quality Through a Centralized Platform
Democratizing Data Quality Through a Centralized Platform
 
Learn to Use Databricks for Data Science
Learn to Use Databricks for Data ScienceLearn to Use Databricks for Data Science
Learn to Use Databricks for Data Science
 
Why APM Is Not the Same As ML Monitoring
Why APM Is Not the Same As ML MonitoringWhy APM Is Not the Same As ML Monitoring
Why APM Is Not the Same As ML Monitoring
 
The Function, the Context, and the Data—Enabling ML Ops at Stitch Fix
The Function, the Context, and the Data—Enabling ML Ops at Stitch FixThe Function, the Context, and the Data—Enabling ML Ops at Stitch Fix
The Function, the Context, and the Data—Enabling ML Ops at Stitch Fix
 
Stage Level Scheduling Improving Big Data and AI Integration
Stage Level Scheduling Improving Big Data and AI IntegrationStage Level Scheduling Improving Big Data and AI Integration
Stage Level Scheduling Improving Big Data and AI Integration
 
Simplify Data Conversion from Spark to TensorFlow and PyTorch
Simplify Data Conversion from Spark to TensorFlow and PyTorchSimplify Data Conversion from Spark to TensorFlow and PyTorch
Simplify Data Conversion from Spark to TensorFlow and PyTorch
 
Scaling your Data Pipelines with Apache Spark on Kubernetes
Scaling your Data Pipelines with Apache Spark on KubernetesScaling your Data Pipelines with Apache Spark on Kubernetes
Scaling your Data Pipelines with Apache Spark on Kubernetes
 
Scaling and Unifying SciKit Learn and Apache Spark Pipelines
Scaling and Unifying SciKit Learn and Apache Spark PipelinesScaling and Unifying SciKit Learn and Apache Spark Pipelines
Scaling and Unifying SciKit Learn and Apache Spark Pipelines
 
Sawtooth Windows for Feature Aggregations
Sawtooth Windows for Feature AggregationsSawtooth Windows for Feature Aggregations
Sawtooth Windows for Feature Aggregations
 
Redis + Apache Spark = Swiss Army Knife Meets Kitchen Sink
Redis + Apache Spark = Swiss Army Knife Meets Kitchen SinkRedis + Apache Spark = Swiss Army Knife Meets Kitchen Sink
Redis + Apache Spark = Swiss Army Knife Meets Kitchen Sink
 
Re-imagine Data Monitoring with whylogs and Spark
Re-imagine Data Monitoring with whylogs and SparkRe-imagine Data Monitoring with whylogs and Spark
Re-imagine Data Monitoring with whylogs and Spark
 
Processing Large Datasets for ADAS Applications using Apache Spark
Processing Large Datasets for ADAS Applications using Apache SparkProcessing Large Datasets for ADAS Applications using Apache Spark
Processing Large Datasets for ADAS Applications using Apache Spark
 
Massive Data Processing in Adobe Using Delta Lake
Massive Data Processing in Adobe Using Delta LakeMassive Data Processing in Adobe Using Delta Lake
Massive Data Processing in Adobe Using Delta Lake
 
Machine Learning CI/CD for Email Attack Detection
Machine Learning CI/CD for Email Attack DetectionMachine Learning CI/CD for Email Attack Detection
Machine Learning CI/CD for Email Attack Detection
 

Recently uploaded

一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单
ewymefz
 
一比一原版(CBU毕业证)卡普顿大学毕业证成绩单
一比一原版(CBU毕业证)卡普顿大学毕业证成绩单一比一原版(CBU毕业证)卡普顿大学毕业证成绩单
一比一原版(CBU毕业证)卡普顿大学毕业证成绩单
nscud
 
一比一原版(QU毕业证)皇后大学毕业证成绩单
一比一原版(QU毕业证)皇后大学毕业证成绩单一比一原版(QU毕业证)皇后大学毕业证成绩单
一比一原版(QU毕业证)皇后大学毕业证成绩单
enxupq
 
一比一原版(UVic毕业证)维多利亚大学毕业证成绩单
一比一原版(UVic毕业证)维多利亚大学毕业证成绩单一比一原版(UVic毕业证)维多利亚大学毕业证成绩单
一比一原版(UVic毕业证)维多利亚大学毕业证成绩单
ukgaet
 
Opendatabay - Open Data Marketplace.pptx
Opendatabay - Open Data Marketplace.pptxOpendatabay - Open Data Marketplace.pptx
Opendatabay - Open Data Marketplace.pptx
Opendatabay
 
一比一原版(ArtEZ毕业证)ArtEZ艺术学院毕业证成绩单
一比一原版(ArtEZ毕业证)ArtEZ艺术学院毕业证成绩单一比一原版(ArtEZ毕业证)ArtEZ艺术学院毕业证成绩单
一比一原版(ArtEZ毕业证)ArtEZ艺术学院毕业证成绩单
vcaxypu
 
standardisation of garbhpala offhgfffghh
standardisation of garbhpala offhgfffghhstandardisation of garbhpala offhgfffghh
standardisation of garbhpala offhgfffghh
ArpitMalhotra16
 
Introduction-to-Cybersecurit57hhfcbbcxxx
Introduction-to-Cybersecurit57hhfcbbcxxxIntroduction-to-Cybersecurit57hhfcbbcxxx
Introduction-to-Cybersecurit57hhfcbbcxxx
zahraomer517
 
一比一原版(TWU毕业证)西三一大学毕业证成绩单
一比一原版(TWU毕业证)西三一大学毕业证成绩单一比一原版(TWU毕业证)西三一大学毕业证成绩单
一比一原版(TWU毕业证)西三一大学毕业证成绩单
ocavb
 
一比一原版(CBU毕业证)不列颠海角大学毕业证成绩单
一比一原版(CBU毕业证)不列颠海角大学毕业证成绩单一比一原版(CBU毕业证)不列颠海角大学毕业证成绩单
一比一原版(CBU毕业证)不列颠海角大学毕业证成绩单
nscud
 
Investigate & Recover / StarCompliance.io / Crypto_Crimes
Investigate & Recover / StarCompliance.io / Crypto_CrimesInvestigate & Recover / StarCompliance.io / Crypto_Crimes
Investigate & Recover / StarCompliance.io / Crypto_Crimes
StarCompliance.io
 

Recently uploaded (20)

tapal brand analysis PPT slide for comptetive data
tapal brand analysis PPT slide for comptetive datatapal brand analysis PPT slide for comptetive data
tapal brand analysis PPT slide for comptetive data
 
Criminal IP - Threat Hunting Webinar.pdf
Criminal IP - Threat Hunting Webinar.pdfCriminal IP - Threat Hunting Webinar.pdf
Criminal IP - Threat Hunting Webinar.pdf
 
Innovative Methods in Media and Communication Research by Sebastian Kubitschk...
Innovative Methods in Media and Communication Research by Sebastian Kubitschk...Innovative Methods in Media and Communication Research by Sebastian Kubitschk...
Innovative Methods in Media and Communication Research by Sebastian Kubitschk...
 
Q1’2024 Update: MYCI’s Leap Year Rebound
Q1’2024 Update: MYCI’s Leap Year ReboundQ1’2024 Update: MYCI’s Leap Year Rebound
Q1’2024 Update: MYCI’s Leap Year Rebound
 
Predicting Product Ad Campaign Performance: A Data Analysis Project Presentation
Predicting Product Ad Campaign Performance: A Data Analysis Project PresentationPredicting Product Ad Campaign Performance: A Data Analysis Project Presentation
Predicting Product Ad Campaign Performance: A Data Analysis Project Presentation
 
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单
 
How can I successfully sell my pi coins in Philippines?
How can I successfully sell my pi coins in Philippines?How can I successfully sell my pi coins in Philippines?
How can I successfully sell my pi coins in Philippines?
 
一比一原版(CBU毕业证)卡普顿大学毕业证成绩单
一比一原版(CBU毕业证)卡普顿大学毕业证成绩单一比一原版(CBU毕业证)卡普顿大学毕业证成绩单
一比一原版(CBU毕业证)卡普顿大学毕业证成绩单
 
一比一原版(QU毕业证)皇后大学毕业证成绩单
一比一原版(QU毕业证)皇后大学毕业证成绩单一比一原版(QU毕业证)皇后大学毕业证成绩单
一比一原版(QU毕业证)皇后大学毕业证成绩单
 
一比一原版(UVic毕业证)维多利亚大学毕业证成绩单
一比一原版(UVic毕业证)维多利亚大学毕业证成绩单一比一原版(UVic毕业证)维多利亚大学毕业证成绩单
一比一原版(UVic毕业证)维多利亚大学毕业证成绩单
 
2024-05-14 - Tableau User Group - TC24 Hot Topics - Tableau Pulse and Einstei...
2024-05-14 - Tableau User Group - TC24 Hot Topics - Tableau Pulse and Einstei...2024-05-14 - Tableau User Group - TC24 Hot Topics - Tableau Pulse and Einstei...
2024-05-14 - Tableau User Group - TC24 Hot Topics - Tableau Pulse and Einstei...
 
Business update Q1 2024 Lar España Real Estate SOCIMI
Business update Q1 2024 Lar España Real Estate SOCIMIBusiness update Q1 2024 Lar España Real Estate SOCIMI
Business update Q1 2024 Lar España Real Estate SOCIMI
 
Opendatabay - Open Data Marketplace.pptx
Opendatabay - Open Data Marketplace.pptxOpendatabay - Open Data Marketplace.pptx
Opendatabay - Open Data Marketplace.pptx
 
一比一原版(ArtEZ毕业证)ArtEZ艺术学院毕业证成绩单
一比一原版(ArtEZ毕业证)ArtEZ艺术学院毕业证成绩单一比一原版(ArtEZ毕业证)ArtEZ艺术学院毕业证成绩单
一比一原版(ArtEZ毕业证)ArtEZ艺术学院毕业证成绩单
 
standardisation of garbhpala offhgfffghh
standardisation of garbhpala offhgfffghhstandardisation of garbhpala offhgfffghh
standardisation of garbhpala offhgfffghh
 
Uber Ride Supply Demand Gap Analysis Report
Uber Ride Supply Demand Gap Analysis ReportUber Ride Supply Demand Gap Analysis Report
Uber Ride Supply Demand Gap Analysis Report
 
Introduction-to-Cybersecurit57hhfcbbcxxx
Introduction-to-Cybersecurit57hhfcbbcxxxIntroduction-to-Cybersecurit57hhfcbbcxxx
Introduction-to-Cybersecurit57hhfcbbcxxx
 
一比一原版(TWU毕业证)西三一大学毕业证成绩单
一比一原版(TWU毕业证)西三一大学毕业证成绩单一比一原版(TWU毕业证)西三一大学毕业证成绩单
一比一原版(TWU毕业证)西三一大学毕业证成绩单
 
一比一原版(CBU毕业证)不列颠海角大学毕业证成绩单
一比一原版(CBU毕业证)不列颠海角大学毕业证成绩单一比一原版(CBU毕业证)不列颠海角大学毕业证成绩单
一比一原版(CBU毕业证)不列颠海角大学毕业证成绩单
 
Investigate & Recover / StarCompliance.io / Crypto_Crimes
Investigate & Recover / StarCompliance.io / Crypto_CrimesInvestigate & Recover / StarCompliance.io / Crypto_Crimes
Investigate & Recover / StarCompliance.io / Crypto_Crimes
 

Predicting Optimal Parallelism for Data Analytics

  • 1. Predicting Optimal Parallelism for Data Analytics Rathijit Sen, Vishal Rohra
  • 2. Agenda ▪ Overview ▪ AutoDOP ▪ AutoToken ▪ TASQ (AutoToken_vNext) ▪ AutoExecutor ▪ Summary
  • 3. Resource Provisioning in the Cloud • Focus: Automatically predict Optimal Parallelism for jobs • Allow flexibility in selecting optimal point for cost-efficient performance • Enable optimal resource provisioning Users dynamic, fine-grained provisioning for jobs Providers Provision cluster capacities How much resources does a job actually need?
  • 4. General Approach • Prediction of job run time or peak parallelism : Peak Parallelism = f (query characteristics) [lowest run time] Run time = f (query characteristics, #parallelism) • Query characteristics: compile/optimization time- properties and estimates • Learn f using Machine Learning models on past executions
  • 5. Case Studies Performance Characteristic Curve (PCC) Run Time Parallelism Study Platform Num Nodes Prediction AutoDOP SQL Server Single Run Time AutoToken Cosmos Multiple Peak Parallelism AutoToken_vNext / TASQ Cosmos Multiple Run Time, PCC (Strictly Monotonic) AutoExecutor Spark Multiple PCC (Monotonic)
  • 6. AutoDOP Zhiwei Fan, RathijitSen, Paris Koutris, Aws Albarghouthi,“Automated Tuning of Query Degree of Parallelism via MachineLearning”, aiDM@SIGMOD, 2020 Zhiwei Fan, RathijitSen, Paris Koutris, Aws Albarghouthi,“A ComparativeExplorationof ML Techniques for Tuning Query Degree of Parallelism”, arXiv, 2020
  • 7. Context • Platform: SQL Server, single node • Degree Of Parallelism (DOP) • Maximum number of threads that can be active at any time for query execution • Per-query selection • Impact of DOP for running a query: • Query Performance and Cost • Resource Utilization of Multicore Servers • Resource Provisioning in Cloud-Computing Platforms
  • 8. Dependence on query characteristics TPC-DS1000 Example Queries Well-Parallelizable Queries Other Queries
  • 9. Dependence on data size (scale factor) • The average and median shift towards larger DOP values as the scale factor/dataset size increases • More variation in TPC-DS compared to TPC-H due to the larger variety of query templates in TPC-DS • No workload has a single per-query optimal DOP value
  • 10. Approach • Goal: predict optimal DOP • ML model type: Regression, not Classification • More flexibility in choosing optimal point for cost vs performance tradeoffs ML Model Random Forest … • Query plan operators • Number of tuples (cardinality), other compile/optimization- time estimates Run time DOP +
  • 11. Example results • AutoDOP is closer to optimal (oracle selection) than static DOP selection policies • ML: each query at predicted-optimal DOP given by ML model • Query-Optimal: each query at Optimal DOP (oracle selection) • Workload-Optimal: all queries at optimal DOP for overall workload (oracle selection) • 40: each query at DOP 40 • 80: each query at DOP 40 • Speedup over DOP 64 (default DOP) TPC-DS1000 Queries (subset) 0 0.2 0.4 0.6 0.8 1 1.2 1.4 Test 1 Test 2 Speedup ML Query-Optimal Workload-Optimal 40 80
  • 12. Case Studies Performance Characteristic Curve (PCC) Run Time Parallelism Study Platform Num Nodes Prediction AutoDOP SQL Server Single Run Time AutoToken Cosmos Multiple Peak Parallelism AutoToken_vNext / TASQ Cosmos Multiple Run Time, PCC (Strictly Monotonic) AutoExecutor Spark Multiple PCC (Monotonic)
  • 13. AutoToken RathijitSen, Alekh Jindal,Hiren Patel, Shi Qiao, “AutoToken:Predicting Peak Parallelismfor Big Data Analyticsat Microsoft”, VLDB, 2020
  • 14. Context • Platform: Exabyte-scale Big Data analytics platform for SCOPE queries • Token: unit of resource allocation • Per-job allocation • Guaranteed and spare tokens • Impact of number of tokens for running a job: • Query performance and cost • Resource utilization and provisioning
  • 15. Peak Parallelism / Peak Resource Provisioning • How many guaranteed tokens to request for the job? • Depends on peak parallelism • More tokens: unnecessary wait time, unused guaranteed tokens • Less tokens: loss of performance or predictable performance • Possible options: • Default value • User guesstimate • Default VC percentage
  • 16. Approach • Automatically eliminate over-allocations for recurring jobs • Ideally, no performance impact • Use ML models to learn peak tokens from past behavior • Simple models per job group (signature) Default Allocation Over- allocation Resources Ideal Allocation AutoToken
  • 17. Results • Overall prediction accuracy: • Median error: 0 • 90th percentile error  50% • Coverage: 10.7%—28.1% • #Jobs: • Total: approx. 8.8M • 0.8—2.4M training • 162—528K testing RequestedTokens/ActualPeak Cumulative Percentage
  • 18. Resource Allocation Policies Peak Allocation Resources Resources TightAllocation AutoToken (only recurring jobs) TASQ
  • 19. TASQ Anish Pimpley, Shuo Li, AnubhaSrivastava, Vishal Rohra, Yi Zhu, Soundarajan Srinivasan,Alekh Jindal,Hiren Patel, Shi Qiao, Rathijit Sen, “OptimalResource Allocationfor Serverless Queries”, [Under Submission]
  • 20. Why Tight Allocation • Cost Savings • Negligible change in performance • 50% of the jobs can request fewer tokens • 20% require less than 50% of requested tokens • 5% performance loss • 92% of the jobs can request fewer tokens • 30% require less than 50% of requested tokens • Reduces job wait times • Wider resource availability
  • 21. TASQ’s Approach Given compile time features of a job => Predict Tight Allocation Observation • Optimal allocation means different thing for different users, f(cost, time) • Predicting the relationship between tokens and runtime >> Predicting Tight allocation • Relationship between tokens and runtime is an exponentially decaying curve, referred to as performance characteristic curve (PCC) Parameters (a, b) for PCC
  • 22. Challenge: Limited Trend Data • Historical workloads executed with single token count • In order to predict PCC, we need data for multiple token counts
  • 23. Solution: Data Augmentation • Area Preserving Allocation Simulator (AREPAS) • Based on past skylines, generate skylines for multiple token counts using the simulator. • Assumptions • Total computations stay constant • Total tokens-seconds used stay constant • Area under skyline stays constant
  • 24. Modeling the Runtime vs Token relationship • Need for monotonically non-increasing curve • User expectation: more resources → faster runtime • ‘Elbow’ region of the curve usually emerges before parallelism overhead • How do you enforce that in modeling • Expect a power-law curve Runtime t(n) = f (n: TokenAllocation) = b * n -a where a, b > 0 Predict: Scalar parameters ‘a’ and ‘b’
  • 25. Results • XGBoost are not designed to enforce monotonicity • NN and GNN perform better in trend prediction • NN has comparable performance with lower training time Model Pattern (Non-Increase) MAE (Curve Params) Median AE (Run-Time) XGBoost SS 32% NA 53% XGBoost PL 93% 0.202 52% NN 100% 0.163 39% GNN 100% 0.168 33%
  • 26. User Interface • Workflow • Submit the job script • Graph generated at compile time • Two options • Visualize the Runtime vs Token Predictions • Get an optimal token count • Advantages • Informed decision • For all jobs • Before job execution
  • 27. Integration • Bullet 1 • Sub-bullet • Sub-bullet • Bullet 2 • Sub-bullet • Sub-bullet
  • 28. Case Studies Performance Characteristic Curve (PCC) Run Time Parallelism Study Platform Num Nodes Prediction AutoDOP SQL Server Single Run Time AutoToken Cosmos Multiple Peak Parallelism AutoToken_vNext / TASQ Cosmos Multiple Run Time, PCC (Strictly Monotonic) AutoExecutor Spark Multiple PCC (Monotonic)
  • 29. AutoExecutor RathijitSen, Abhishek Roy, Alekh Jindal,Rui Fang, Jeff Zheng, XiaoleiLiu, Ruiping Li, “AutoExecutor: Predictive Parallelism for Spark SQL Queries”, [Under Submission]
  • 30. Context • Platform: Spark, Azure Synapse • Executors: processes on worker nodes • Each executor can use a certain number or cores and amount of memory • Impact of number of executors for running a query: • Query performance and cost • Resource utilization and provisioning
  • 31. Modeling Approach • Reuse and extend TASQ PCC model • Power-law curve with lower bound • Run time t(n) with executor count n: t(n) = max(b*na , m) • a, b, m: parameters ML Model • Count of operators • Input Cardinality • Avg. Row length • … PCC model parameters Random Forest … t(n) = b*na t(n) = m
  • 32. Example predictions • Sparklens: predict after one execution of the query • AutoExecutor: predict before execution of the query
  • 33. Error distributions (different templates, SF=100) • Most prediction errors at small number of executors S: Sparklens AE: AutoExecutor F1..F10: • ten-fold cross validation • 80% queries in training set • 20% in test set
  • 34. System Architecture Feature Extraction Model Training Extensions Workload Table Anonymized Plans, Metrics Executor Events Telemetry Pipeline AutoExecutor Workload Analysis Peregrine Events PCC
  • 36. Automatic selection of optimal parallelism • Capability and Approach: • Enable selection of optimal operating point with respect to optimization objective • ML models to predict run time/peak parallelism using query characteristics • Challenges: • Modeling PCC characteristics • AutoDOP: Point-wise • TASQ: Point-wise, Power-law function • AutoExecutor: Power-law + constant function • Collecting training data • TASQ: AREPAS • AutoExecutor: Sparklens Could we have other models for PCC? How would you simulate for other parameter changes?
  • 37. Feedback Your feedback is important to us. Don’t forget to rate and review the sessions.