SlideShare a Scribd company logo
1 of 35
Download to read offline
Common Design for Distributed Machine
Learning, Deep Learning
Common Modeling
머신러닝으로문제를해결했다면, Scaling 문제가 발생
모델결과를얼마나신뢰할수있을지"Generalization error"
Data / Model Parallelism
Spark Scale‑out Learning
Data Parallelism
DecisionTree, RandomForest, GradientBoostingTree
Recap ‑ Random Forest
node queue를이용해서training 수행(queue가 비어있으면종료)
Distributed Random Forest
def predict(features: Vector): Double = {
(algo, combiningStrategy) match {
case (Regression, Sum) =>
predictBySumming(features)
case (Regression, Average) =>
predictBySumming(features) / sumWeights
case (Classification, Sum) => // binary
val prediction = predictBySumming(features)
if (prediction > 0.0) 1.0 else 0.0
case (Classification, Vote) =>
predictByVoting(features)
각 트리는독립적으로구성가능하기 때문에분산처리에용이
Aggregation Strategy (Categorical / Continuous)
Recap ‑ Gradient Boosting Tree
예측오류를다음모델이보완해나가는방식(Sequential)
다시샘플링할때오답에높은가중치를부여
Distributed Gradient Boosting
Boosting : c = c + k
Gradient Boosting : c = c + μ
Distributed DecisionTree 이후에Gradient Update 하는방식으로구현
https://github.com/apache/spark/blob/master/mllib/src/main/scal
a/org/apache/spark/ml/tree/impl/GradientBoostedTrees.scala#L2
47
n n−1 n
n n−1 ∂cn−1
∂J
Distributed Decision Tree Building
1. Parallelize Node Building at Each Level ‑ imbalance problem
2. Parallelize Split Finding on Each Node
3. Parallelize Split Finding at Each Level by Features
Distributed Decision Tree Building
#flatMap
input: Instance
output: list(split, label)
#reduceByKey
input: split, list(label)
output: split, labelHistograms
Feature k, Splits m, Instance n 인경우, O(k ∗ m ∗ n) 소요
Communication Overhead 문제발생
Avoid Map Function (Shuffle, Object creation overhead)
Distributed Decision Tree Building
[SPARK‑3161] Cache example‑node map for
DecisionTree training
https://issues.apache.org/jira/browse/SPARK‑3161
findBestSplits 단계 이후트리의다음레벨로넘어갈 때전체트리노드를
넘기지말고 lowest split nodes만넘기자
얕은트리모델에서는더느려질수있음(iter마다update)
하지만깊은트리모델일경우필수적인옵션
Spark DecisionTree DAG
Model Parallelism
GridSearch, TrainValidationSplit, CrossValidator
Hyperparameter: GridSearch vs RandomSearch
GridSearch는Embarrassingly parallel한알고리즘
TrainValidationSplit, CrossValidator
지정한비율에따라훈련/검증셋을나누어학습에반영
training set을K 개의fold로나누어서교차검증(overfitting 방지)
TrainValidationSplit, CrossValidator
// TrainValidationSplit
val tvs = new TrainValidationSplit()
.setEstimatorParamMaps(factorGrid)
.setEvaluator(new RegressionEvaluator)
.setTrainRatio(r)
// CrossValidator
val cv = new CrossValidator()
.setEstimatorParamMaps(factorGrid)
.setEvaluator(new BinaryClassificationEvaluator)
.setNumFolds(k)
// Best Model
val model = tvs.fit(data)
model.bestModel.extractParamMap
ParamMap을전달, CrossValidator가 더많은시간을소요
Spark 2.2 버전까지는Data Parallelism으로수행
Spark 2.3: Model Parallelism
val cv = new CrossValidator()
.setEstimator(pipeline)
.setEvaluator(new BinaryClassificationEvaluator)
.setEstimatorParamMaps(paramGrid)
.setParallelism(10)
CrossValidator에서Data Parallelism의한계
클러스터구성에따라리소스를심각하게 활용하지못하게 될수있음
Hyperparameter가 많아질수록시간이엄청나게 증가
Spark 2.3부터 setParallelism 옵션추가 (SPARK‑19357)
옵션으로둔이유는클러스터자원에대한의존성이커서
과부하가 걸리지않도록실험적으로적절한값을선택해야함
Spark 2.3: Model Parallelism
Pipeline, CrossValidator까지고려한경우일반적으로2‑3배속도향상
Task in Distributed ML
일부알고리즘들은아직완전한분산처리구현체가 없음(DBSCAN)
일부알고리즘에서는같은Solver, Optimizer가 조금 다르게 동작가능
데이터의특징관련문제(Missing value, skew, outlier)
일부Network, System Latency로인한전체성능저하
Distributed Deep Learning
Distributed Deep Learning on GPU Cluster
GPU Cluster, Memory, Communication 등의이슈(Direct RDMA)
Communication Cost 보다Computing Cost 를늘리는것이핵심
http://hoondongkim.blogspot.kr/search/label/GPU
Large Scale Distributed Deep Networks ‑ Google
Paper: Large Scale Distributed Deep Networks ‑ Google
Google DistBelief : Downpour SGD, L‑BFGS
수십억파라메터의네트워크를1만CPU 코어에서학습가능
Stochastic Gradient Descent
mini batch size = m : Batch Gradient Descent
mini batch size = 1 : Stochastic Gradient Descent
Sync / Async Stochastic Gradient Descent
W = W − λ ΔW
Parameter Averaging : Momentum, Adagrad 문제
Update‑based Approaches : update 값을전달
Synchronous vs Asynchronous methods
Parameter Server : dmlc/ps‑lite
i+1 i
j=1
∑
N
i,j
Deep Learning ‑ Model Parallelism
모델이머신의메모리보다크다면? VGG, GoogLeNet...
Deep Learning ‑ Model Parallelism
Parallelizing Convolutional Neural Networks
Paper: One weird trick for parallelizing CNN ‑ Google
Common Design for Distributed Machine Learning,
Deep Learning
Common Modeling
Data / Model Parallelism
Distributed DecisionTree, RandomForest, GBT
Distributed GridSearch, TrainValidationSplit, CrossValidator
Large Scale Distributed Deep Learning
Reference
Paper: Large Scale Distributed Deep Networks ‑ Google
Paper: One weird trick for parallelizing CNN ‑ Google
Youtube: Scalable Distributed Decision Trees in Spark MLlib
Blog: Parallel Gradient Boosting Decision Trees
Blog: Model Parallelism with Spark ML Tuning
Docs: Parallel Learning in LightGBM
Docs: MXNet Architecture

More Related Content

Similar to Common Design for Distributed Machine Learning

Hadoop Integration in Cassandra
Hadoop Integration in CassandraHadoop Integration in Cassandra
Hadoop Integration in CassandraJairam Chandar
 
Amazon SageMaker를 통한 대용량 모델 훈련 방법 살펴보기 - 김대근 AWS AI/ML 스페셜리스트 솔루션즈 아키텍트 / 최영준...
Amazon SageMaker를 통한 대용량 모델 훈련 방법 살펴보기 - 김대근 AWS AI/ML 스페셜리스트 솔루션즈 아키텍트 / 최영준...Amazon SageMaker를 통한 대용량 모델 훈련 방법 살펴보기 - 김대근 AWS AI/ML 스페셜리스트 솔루션즈 아키텍트 / 최영준...
Amazon SageMaker를 통한 대용량 모델 훈련 방법 살펴보기 - 김대근 AWS AI/ML 스페셜리스트 솔루션즈 아키텍트 / 최영준...Amazon Web Services Korea
 
Apache Cassandra 2.0
Apache Cassandra 2.0Apache Cassandra 2.0
Apache Cassandra 2.0Joe Stein
 
Data SLA in the public cloud
Data SLA in the public cloudData SLA in the public cloud
Data SLA in the public cloudLiran Zelkha
 
Cassandra hands on
Cassandra hands onCassandra hands on
Cassandra hands onniallmilton
 
Performance analysis of machine learning algorithms on self localization system1
Performance analysis of machine learning algorithms on self localization system1Performance analysis of machine learning algorithms on self localization system1
Performance analysis of machine learning algorithms on self localization system1Venkat Projects
 
Distributed Radar Tracking Simulation Project
Distributed Radar Tracking Simulation ProjectDistributed Radar Tracking Simulation Project
Distributed Radar Tracking Simulation ProjectAssignmentpedia
 
Distributed Radar Tracking Simulation Project
Distributed Radar Tracking Simulation ProjectDistributed Radar Tracking Simulation Project
Distributed Radar Tracking Simulation ProjectAssignmentpedia
 
2014.06.24.what is ubix
2014.06.24.what is ubix2014.06.24.what is ubix
2014.06.24.what is ubixJim Cooley
 
RDataMining-reference-card
RDataMining-reference-cardRDataMining-reference-card
RDataMining-reference-cardYanchang Zhao
 
Device status anomaly detection
Device status anomaly detectionDevice status anomaly detection
Device status anomaly detectionDavid Tung
 
Quick Guide to Refresh Spark skills
Quick Guide to Refresh Spark skillsQuick Guide to Refresh Spark skills
Quick Guide to Refresh Spark skillsRavindra kumar
 
And Then There Are Algorithms - Danilo Poccia - Codemotion Rome 2018
And Then There Are Algorithms - Danilo Poccia - Codemotion Rome 2018And Then There Are Algorithms - Danilo Poccia - Codemotion Rome 2018
And Then There Are Algorithms - Danilo Poccia - Codemotion Rome 2018Codemotion
 
Training course lect2
Training course lect2Training course lect2
Training course lect2Noor Dhiya
 

Similar to Common Design for Distributed Machine Learning (20)

Amazon elastic map reduce
Amazon elastic map reduceAmazon elastic map reduce
Amazon elastic map reduce
 
Hadoop Integration in Cassandra
Hadoop Integration in CassandraHadoop Integration in Cassandra
Hadoop Integration in Cassandra
 
Amazon SageMaker를 통한 대용량 모델 훈련 방법 살펴보기 - 김대근 AWS AI/ML 스페셜리스트 솔루션즈 아키텍트 / 최영준...
Amazon SageMaker를 통한 대용량 모델 훈련 방법 살펴보기 - 김대근 AWS AI/ML 스페셜리스트 솔루션즈 아키텍트 / 최영준...Amazon SageMaker를 통한 대용량 모델 훈련 방법 살펴보기 - 김대근 AWS AI/ML 스페셜리스트 솔루션즈 아키텍트 / 최영준...
Amazon SageMaker를 통한 대용량 모델 훈련 방법 살펴보기 - 김대근 AWS AI/ML 스페셜리스트 솔루션즈 아키텍트 / 최영준...
 
Apache Cassandra 2.0
Apache Cassandra 2.0Apache Cassandra 2.0
Apache Cassandra 2.0
 
R refcard-data-mining
R refcard-data-miningR refcard-data-mining
R refcard-data-mining
 
Data SLA in the public cloud
Data SLA in the public cloudData SLA in the public cloud
Data SLA in the public cloud
 
journal for research
journal for researchjournal for research
journal for research
 
Cassandra hands on
Cassandra hands onCassandra hands on
Cassandra hands on
 
MyBatis
MyBatisMyBatis
MyBatis
 
Performance analysis of machine learning algorithms on self localization system1
Performance analysis of machine learning algorithms on self localization system1Performance analysis of machine learning algorithms on self localization system1
Performance analysis of machine learning algorithms on self localization system1
 
Stock Market Prediction Using ANN
Stock Market Prediction Using ANNStock Market Prediction Using ANN
Stock Market Prediction Using ANN
 
Distributed Radar Tracking Simulation Project
Distributed Radar Tracking Simulation ProjectDistributed Radar Tracking Simulation Project
Distributed Radar Tracking Simulation Project
 
Distributed Radar Tracking Simulation Project
Distributed Radar Tracking Simulation ProjectDistributed Radar Tracking Simulation Project
Distributed Radar Tracking Simulation Project
 
2014.06.24.what is ubix
2014.06.24.what is ubix2014.06.24.what is ubix
2014.06.24.what is ubix
 
RDataMining-reference-card
RDataMining-reference-cardRDataMining-reference-card
RDataMining-reference-card
 
Device status anomaly detection
Device status anomaly detectionDevice status anomaly detection
Device status anomaly detection
 
Quick Guide to Refresh Spark skills
Quick Guide to Refresh Spark skillsQuick Guide to Refresh Spark skills
Quick Guide to Refresh Spark skills
 
PythonML.pptx
PythonML.pptxPythonML.pptx
PythonML.pptx
 
And Then There Are Algorithms - Danilo Poccia - Codemotion Rome 2018
And Then There Are Algorithms - Danilo Poccia - Codemotion Rome 2018And Then There Are Algorithms - Danilo Poccia - Codemotion Rome 2018
And Then There Are Algorithms - Danilo Poccia - Codemotion Rome 2018
 
Training course lect2
Training course lect2Training course lect2
Training course lect2
 

More from Junyoung Park

Quantitive Algorithm Trading
Quantitive Algorithm TradingQuantitive Algorithm Trading
Quantitive Algorithm TradingJunyoung Park
 
Kaggle KKBox Churn Prediction
Kaggle KKBox Churn PredictionKaggle KKBox Churn Prediction
Kaggle KKBox Churn PredictionJunyoung Park
 
Cloudera & Zookeeper
Cloudera & ZookeeperCloudera & Zookeeper
Cloudera & ZookeeperJunyoung Park
 
한국어 자연어처리 101
한국어 자연어처리 101한국어 자연어처리 101
한국어 자연어처리 101Junyoung Park
 
Continuous Integration with Gitlab
Continuous Integration with GitlabContinuous Integration with Gitlab
Continuous Integration with GitlabJunyoung Park
 
Python Testing for Flask
Python Testing for FlaskPython Testing for Flask
Python Testing for FlaskJunyoung Park
 
News clustering and Recommendation system using Word Embedding
News clustering and Recommendation system using Word EmbeddingNews clustering and Recommendation system using Word Embedding
News clustering and Recommendation system using Word EmbeddingJunyoung Park
 
Clustering, k means algorithm
Clustering, k means algorithmClustering, k means algorithm
Clustering, k means algorithmJunyoung Park
 
About Neural Network
About Neural NetworkAbout Neural Network
About Neural NetworkJunyoung Park
 

More from Junyoung Park (14)

Quantitive Algorithm Trading
Quantitive Algorithm TradingQuantitive Algorithm Trading
Quantitive Algorithm Trading
 
K-Means Clustering
K-Means ClusteringK-Means Clustering
K-Means Clustering
 
AWS EMR + Spark ML
AWS EMR + Spark MLAWS EMR + Spark ML
AWS EMR + Spark ML
 
Kaggle KKBox Churn Prediction
Kaggle KKBox Churn PredictionKaggle KKBox Churn Prediction
Kaggle KKBox Churn Prediction
 
Spark config
Spark configSpark config
Spark config
 
Cloudera & Zookeeper
Cloudera & ZookeeperCloudera & Zookeeper
Cloudera & Zookeeper
 
한국어 자연어처리 101
한국어 자연어처리 101한국어 자연어처리 101
한국어 자연어처리 101
 
Continuous Integration with Gitlab
Continuous Integration with GitlabContinuous Integration with Gitlab
Continuous Integration with Gitlab
 
Docker Intro
Docker IntroDocker Intro
Docker Intro
 
Python Testing for Flask
Python Testing for FlaskPython Testing for Flask
Python Testing for Flask
 
News clustering and Recommendation system using Word Embedding
News clustering and Recommendation system using Word EmbeddingNews clustering and Recommendation system using Word Embedding
News clustering and Recommendation system using Word Embedding
 
Clustering, k means algorithm
Clustering, k means algorithmClustering, k means algorithm
Clustering, k means algorithm
 
About Neural Network
About Neural NetworkAbout Neural Network
About Neural Network
 
About SVM
About SVMAbout SVM
About SVM
 

Recently uploaded

Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxAsutosh Ranjan
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )Tsuyoshi Horigome
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINESIVASHANKAR N
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Christo Ananth
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Call Girls in Nagpur High Profile
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxthe ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxhumanexperienceaaa
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...ranjana rawat
 
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...RajaP95
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxupamatechverse
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130Suhani Kapoor
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSRajkumarAkumalla
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
 

Recently uploaded (20)

Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxthe ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
 
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
 
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 

Common Design for Distributed Machine Learning

  • 1. Common Design for Distributed Machine Learning, Deep Learning
  • 2. Common Modeling 머신러닝으로문제를해결했다면, Scaling 문제가 발생 모델결과를얼마나신뢰할수있을지"Generalization error"
  • 3.
  • 4. Data / Model Parallelism
  • 7. Recap ‑ Random Forest node queue를이용해서training 수행(queue가 비어있으면종료)
  • 8. Distributed Random Forest def predict(features: Vector): Double = { (algo, combiningStrategy) match { case (Regression, Sum) => predictBySumming(features) case (Regression, Average) => predictBySumming(features) / sumWeights case (Classification, Sum) => // binary val prediction = predictBySumming(features) if (prediction > 0.0) 1.0 else 0.0 case (Classification, Vote) => predictByVoting(features) 각 트리는독립적으로구성가능하기 때문에분산처리에용이 Aggregation Strategy (Categorical / Continuous)
  • 9. Recap ‑ Gradient Boosting Tree 예측오류를다음모델이보완해나가는방식(Sequential) 다시샘플링할때오답에높은가중치를부여
  • 10. Distributed Gradient Boosting Boosting : c = c + k Gradient Boosting : c = c + μ Distributed DecisionTree 이후에Gradient Update 하는방식으로구현 https://github.com/apache/spark/blob/master/mllib/src/main/scal a/org/apache/spark/ml/tree/impl/GradientBoostedTrees.scala#L2 47 n n−1 n n n−1 ∂cn−1 ∂J
  • 11. Distributed Decision Tree Building 1. Parallelize Node Building at Each Level ‑ imbalance problem 2. Parallelize Split Finding on Each Node 3. Parallelize Split Finding at Each Level by Features
  • 12. Distributed Decision Tree Building #flatMap input: Instance output: list(split, label) #reduceByKey input: split, list(label) output: split, labelHistograms Feature k, Splits m, Instance n 인경우, O(k ∗ m ∗ n) 소요 Communication Overhead 문제발생 Avoid Map Function (Shuffle, Object creation overhead)
  • 14. [SPARK‑3161] Cache example‑node map for DecisionTree training https://issues.apache.org/jira/browse/SPARK‑3161 findBestSplits 단계 이후트리의다음레벨로넘어갈 때전체트리노드를 넘기지말고 lowest split nodes만넘기자 얕은트리모델에서는더느려질수있음(iter마다update) 하지만깊은트리모델일경우필수적인옵션
  • 17. Hyperparameter: GridSearch vs RandomSearch GridSearch는Embarrassingly parallel한알고리즘
  • 18.
  • 20. TrainValidationSplit, CrossValidator // TrainValidationSplit val tvs = new TrainValidationSplit() .setEstimatorParamMaps(factorGrid) .setEvaluator(new RegressionEvaluator) .setTrainRatio(r) // CrossValidator val cv = new CrossValidator() .setEstimatorParamMaps(factorGrid) .setEvaluator(new BinaryClassificationEvaluator) .setNumFolds(k) // Best Model val model = tvs.fit(data) model.bestModel.extractParamMap ParamMap을전달, CrossValidator가 더많은시간을소요 Spark 2.2 버전까지는Data Parallelism으로수행
  • 21. Spark 2.3: Model Parallelism val cv = new CrossValidator() .setEstimator(pipeline) .setEvaluator(new BinaryClassificationEvaluator) .setEstimatorParamMaps(paramGrid) .setParallelism(10) CrossValidator에서Data Parallelism의한계 클러스터구성에따라리소스를심각하게 활용하지못하게 될수있음 Hyperparameter가 많아질수록시간이엄청나게 증가 Spark 2.3부터 setParallelism 옵션추가 (SPARK‑19357) 옵션으로둔이유는클러스터자원에대한의존성이커서 과부하가 걸리지않도록실험적으로적절한값을선택해야함
  • 22. Spark 2.3: Model Parallelism Pipeline, CrossValidator까지고려한경우일반적으로2‑3배속도향상
  • 23. Task in Distributed ML 일부알고리즘들은아직완전한분산처리구현체가 없음(DBSCAN) 일부알고리즘에서는같은Solver, Optimizer가 조금 다르게 동작가능 데이터의특징관련문제(Missing value, skew, outlier) 일부Network, System Latency로인한전체성능저하
  • 25. Distributed Deep Learning on GPU Cluster GPU Cluster, Memory, Communication 등의이슈(Direct RDMA) Communication Cost 보다Computing Cost 를늘리는것이핵심 http://hoondongkim.blogspot.kr/search/label/GPU
  • 26. Large Scale Distributed Deep Networks ‑ Google Paper: Large Scale Distributed Deep Networks ‑ Google Google DistBelief : Downpour SGD, L‑BFGS 수십억파라메터의네트워크를1만CPU 코어에서학습가능
  • 27. Stochastic Gradient Descent mini batch size = m : Batch Gradient Descent mini batch size = 1 : Stochastic Gradient Descent
  • 28. Sync / Async Stochastic Gradient Descent W = W − λ ΔW Parameter Averaging : Momentum, Adagrad 문제 Update‑based Approaches : update 값을전달 Synchronous vs Asynchronous methods Parameter Server : dmlc/ps‑lite i+1 i j=1 ∑ N i,j
  • 29.
  • 30. Deep Learning ‑ Model Parallelism 모델이머신의메모리보다크다면? VGG, GoogLeNet...
  • 31.
  • 32. Deep Learning ‑ Model Parallelism
  • 33. Parallelizing Convolutional Neural Networks Paper: One weird trick for parallelizing CNN ‑ Google
  • 34. Common Design for Distributed Machine Learning, Deep Learning Common Modeling Data / Model Parallelism Distributed DecisionTree, RandomForest, GBT Distributed GridSearch, TrainValidationSplit, CrossValidator Large Scale Distributed Deep Learning
  • 35. Reference Paper: Large Scale Distributed Deep Networks ‑ Google Paper: One weird trick for parallelizing CNN ‑ Google Youtube: Scalable Distributed Decision Trees in Spark MLlib Blog: Parallel Gradient Boosting Decision Trees Blog: Model Parallelism with Spark ML Tuning Docs: Parallel Learning in LightGBM Docs: MXNet Architecture