SlideShare ist ein Scribd-Unternehmen logo
1 von 39
Downloaden Sie, um offline zu lesen
Deep Learning avec Spark:
TensorFrames
Deep Learning Pipelines
Timothée Hunter
09 Novembre 2017
Bio
• Timothée (Tim) Hunter
• Ingénieur (Machine Learning) à Databricks
• X04, M.S. Stanford
• Ph.D. de UC Berkeley en Machine Learning
• Ancien utilisateur (No 2) de Spark
• Contributions à MLlib
• Co-créateur des packages TensorFrames, GraphFrames, Deep
Learning Pipelines
#EUds6 2
L’équipe
Le produit
À propos de Databricks
La mission
Regroupe les créateurs de Spark (maintenant Apache Spark), lancé à
UC Berkeley en 2009
33
Une platforme unifiée pour l’analyse des
données
Unified Analytics Platform
Simplifier le Big Data
Making Big Data Simple
Essayez gratuitement:
databricks.com
Cette présentation
• Spark et Deep Learning: l’état des lieux
• TensorFrames: intégration haute performance avec TensorFlow
• Deep Learning Pipelines (DLP): le Deep Learning, avec simplicité
Deep Learning? Apprentissage en
profondeur?
• Un ensemble de techniques qui représente des transformations
par couches successives
• Applicable en classification, regression, etc.
• Populaire dans les années 80 (réseaux de neurones)
• De nouveau utilisés (nouveaux algorithmes d’apprentissage,
large collections de données, meilleures machines)
t
Spark et le Deep Learning
• Spark n’inclut pas de bibliothèque de Deep Learning
• Les bibliothèques existantes souvent difficiles à utiliser ou lentes
• TensorFrames: intégration bas niveau, haute performance
• Deep Learning Pipelines: faciliter le Deep Learning, avec Spark
Tendances: matériel
7
Pannes régulières
GPGPU
Plus	de	machines
Machines	plus	puissantes
Tendances: interfaces
8
NLTK
TensorFrames
Deep	Learning	PipelinesTorch
• Graphics Processing Units for General Purpose computations
GPGPUs
9
4.6
Theoretical	peak
throughput
(Tflops,	single	precision)
GPU CPU
Theoretical	peak
bandwidth
(GB/s)
GPU CPU
• Bibliothèque dédiée au “machine intelligence”
• Très populaire pour le Deep Learning
• Mais aussi excellente pour les calculs numériques
• Interface: C++ et Python (et d’autres langages)
Google TensorFlow
10
Dataflow numérique avec Tensorflow
11
x = tf.placeholder(tf.int32, name=“x”)
y = tf.placeholder(tf.int32, name=“y”)
output = tf.add(x, 3 * y, name=“z”)
session = tf.Session()
output_value = session.run(output,
{x: 3, y: 5})
x:
int32
y:
int32
mul 3
z
Dataflow numérique avec Tensorflow
df = sqlContext.createDataFrame(…)
x = tf.placeholder(tf.int32, name=“x”)
y = tf.placeholder(tf.int32, name=“y”)
output = tf.add(x, 3 * y, name=“z”)
output_df = tfs.map_rows(output, df)
output_df.collect()
df:	DataFrame[x:	int,	y:	int]
output_df:	
DataFrame[x:	int,	y:	int,	z:	int]
x:
int32
y:
int32
mul 3
z
C’est un problème de communication
13
Spark	worker	process Worker	python	process
C++
buffer
Python	
pickle
Tungsten	
binary	
format
Python	
pickle
Java
object
TensorFrames: native embedding of
TensorFlow
14
Spark	worker	process
C++
buffer
Tungsten	
binary	
format
Java
object
Exemple: kernel density scoring
15
• Estimateur non-parametrique
• Courramment utilisé pour
lisser des surfaces
• En pratique: calculer
avec:
• Pour simplifier: une belle fonction numérique
Exemple: kernel density scoring
16
Speedup
20
0
50
100
Scala UDF Scala UDF
(optimized)
TensorFrames TensorFrames
+ GPU
Normalized	cost
def score(x:	Double):	Double =	{
val dis	=	points.map {		z_k =>	- (x	- z_k)	*	(x	- z_k)	/	(	2	*	b	*	b)	}
val minDis =	dis.min
val exps =	dis.map(d	=>	math.exp(d	- minDis))
minDis - math.log(b	*	N)	+	math.log(exps.sum)
}
val scoreUDF =	sqlContext.udf.register("scoreUDF",	score	_)
sql("select	sum(scoreUDF(sample))	from	samples").collect()
Speedup
21
0
50
100
Scala UDF Scala UDF
(optimized)
TensorFrames TensorFrames
+ GPU
Normalized	cost
def score(x:	Double):	Double =	{
val dis	=	new Array[Double](N)
var idx =	0
while(idx <	N)	{
val z_k =	points(idx)
dis(idx)	=	- (x	- z_k)	*	(x	- z_k)	/	(	2	*	b	*	b)
idx +=	1
}
val minDis =	dis.min
var expSum =	0.0
idx =	0	
while(idx <	N)	{
expSum +=	math.exp(dis(idx)	- minDis)
idx +=	1
}
minDis - math.log(b	*	N)	+	math.log(expSum)
}
val scoreUDF =	sqlContext.udf.register("scoreUDF",	score	_)
sql("select	sum(scoreUDF(sample))	from	samples").collect()
Speedup
22
0
50
100
Scala UDF Scala UDF
(optimized)
TensorFrames TensorFrames
+ GPU
Normalized	cost
def cost_fun(block,	bandwidth):
distances	=	- square(constant(X)	- sample)	/	(2	*	b	*	b)
m	=	reduce_max(distances,	0)
x	=	log(reduce_sum(exp(distances	- m),	0))
return identity(x	+	m	- log(b	*	N),	name="score”)
sample	=	tfs.block(df,	"sample")
score	=	cost_fun(sample,	bandwidth=0.5)
df.agg(sum(tfs.map_blocks(score,	df))).collect()
Speedup
23
0
50
100
Scala UDF Scala UDF
(optimized)
TensorFrames TensorFrames
+ GPU
Normalized	cost
def cost_fun(block,	bandwidth):
distances	=	- square(constant(X)	- sample)	/	(2	*	b	*	b)
m	=	reduce_max(distances,	0)
x	=	log(reduce_sum(exp(distances	- m),	0))
return identity(x	+	m	- log(b	*	N),	name="score”)
with device("/gpu"):
sample	=	tfs.block(df,	"sample")
score	=	cost_fun(sample,	bandwidth=0.5)
df.agg(sum(tfs.map_blocks(score,	df))).collect()
Récapitulons
• Spark: excellent pour distribuer des calculs sur des centaines de
machines
• TensorFlow: excellent pour les calculs numériques
• Le meilleur des deux mondes avec TensorFrames
Deep Learning Pipelines: le Deep Learning
avec simplicité
Deep Learning Pipelines: le Deep Learning
avec simplicité
Deep Learning Pipelines
• Libre (Apache 2.0), développée par Databricks
• Met l’accent sur la facilité and l’intégration
• sans oublier la performance
• Langage par défaut: Python
• Apache Spark utilisé pour distribuer les tâches
• S’intègre dans MLlib (Pipelines) pour faciliter les workflows ML
s
Achetons des chaussures en
ligne…
Resources machines Beaucoup de
manipulations
Labeled
Data
Challenges
Deep Learning Pipelines
Distribution automatique
avec Apache Spark
MLlib Pipelines API Transfer Learning
Réutilisation de
modèles
Notebook!
“Panda”
Apprentissage supervisé
LeNet
AlexNet
VGG
GoogLeNet
Inception
ResNet50
InceptionV3
ResNet101
InceptionV4
…
“Panda”
Apprentissage supervisé
Embedding
Embedding
Embedding
Embedding
Notebook!
Scalability : Apache Spark
SINGLE NODE
10minutes
6hours
DeepImageFeaturizer.transform(image_data)
Deep Learning Pipelines
10minutes
7lines de code
Distribution élastique
avec Apache Spark
MLlib Pipelines API Transfer Learning
0labels
Merci
Questions?

Weitere ähnliche Inhalte

Was ist angesagt?

Spark SQL principes et fonctions
Spark SQL principes et fonctionsSpark SQL principes et fonctions
Spark SQL principes et fonctionsMICHRAFY MUSTAFA
 
Spark - Alexis Seigneurin (Français)
Spark - Alexis Seigneurin (Français)Spark - Alexis Seigneurin (Français)
Spark - Alexis Seigneurin (Français)Alexis Seigneurin
 
Spark (v1.3) - Présentation (Français)
Spark (v1.3) - Présentation (Français)Spark (v1.3) - Présentation (Français)
Spark (v1.3) - Présentation (Français)Alexis Seigneurin
 
FLTauR - Construction de modèles de prévision sous r avec le package caret
FLTauR - Construction de modèles de prévision sous r avec le package caretFLTauR - Construction de modèles de prévision sous r avec le package caret
FLTauR - Construction de modèles de prévision sous r avec le package caretjfeudeline
 
Spark Streaming
Spark StreamingSpark Streaming
Spark StreamingPALO IT
 
Architecture Big Data open source S.M.A.C.K
Architecture Big Data open source S.M.A.C.KArchitecture Big Data open source S.M.A.C.K
Architecture Big Data open source S.M.A.C.KJulien Anguenot
 
Zenika matinale spark-zeppelin_ml
Zenika matinale spark-zeppelin_mlZenika matinale spark-zeppelin_ml
Zenika matinale spark-zeppelin_mlZenika
 
Paris stormusergroup intrudocution
Paris stormusergroup intrudocutionParis stormusergroup intrudocution
Paris stormusergroup intrudocutionParis_Storm_UG
 
Cartographie du big data
Cartographie du big dataCartographie du big data
Cartographie du big dataacogoluegnes
 
Base de données graphe, Noe4j concepts et mise en oeuvre
Base de données graphe, Noe4j concepts et mise en oeuvreBase de données graphe, Noe4j concepts et mise en oeuvre
Base de données graphe, Noe4j concepts et mise en oeuvreMICHRAFY MUSTAFA
 
Algorithme distribués pour big data saison 2 @DevoxxFR 2016
Algorithme distribués pour big data saison 2 @DevoxxFR 2016Algorithme distribués pour big data saison 2 @DevoxxFR 2016
Algorithme distribués pour big data saison 2 @DevoxxFR 2016Duyhai Doan
 
BigData_TP5 : Neo4J
BigData_TP5 : Neo4JBigData_TP5 : Neo4J
BigData_TP5 : Neo4JLilia Sfaxi
 
Realtime Web avec Akka, Kafka, Spark et Mesos - Devoxx Paris 2014
Realtime Web avec Akka, Kafka, Spark et Mesos - Devoxx Paris 2014Realtime Web avec Akka, Kafka, Spark et Mesos - Devoxx Paris 2014
Realtime Web avec Akka, Kafka, Spark et Mesos - Devoxx Paris 2014Ippon
 
Spark RDD : Transformations & Actions
Spark RDD : Transformations & ActionsSpark RDD : Transformations & Actions
Spark RDD : Transformations & ActionsMICHRAFY MUSTAFA
 
Indexation d'une base documentaire pour Liberation
Indexation d'une base documentaire pour LiberationIndexation d'une base documentaire pour Liberation
Indexation d'une base documentaire pour LiberationParis, France
 
Analytics et Big Data, une histoire de cubes...
Analytics et Big Data, une histoire de cubes...Analytics et Big Data, une histoire de cubes...
Analytics et Big Data, une histoire de cubes...Mathias Kluba
 

Was ist angesagt? (20)

Spark SQL principes et fonctions
Spark SQL principes et fonctionsSpark SQL principes et fonctions
Spark SQL principes et fonctions
 
Spark - Alexis Seigneurin (Français)
Spark - Alexis Seigneurin (Français)Spark - Alexis Seigneurin (Français)
Spark - Alexis Seigneurin (Français)
 
spark_intro_1208
spark_intro_1208spark_intro_1208
spark_intro_1208
 
Introduction spark
Introduction sparkIntroduction spark
Introduction spark
 
Spark (v1.3) - Présentation (Français)
Spark (v1.3) - Présentation (Français)Spark (v1.3) - Présentation (Français)
Spark (v1.3) - Présentation (Français)
 
FLTauR - Construction de modèles de prévision sous r avec le package caret
FLTauR - Construction de modèles de prévision sous r avec le package caretFLTauR - Construction de modèles de prévision sous r avec le package caret
FLTauR - Construction de modèles de prévision sous r avec le package caret
 
Spark Streaming
Spark StreamingSpark Streaming
Spark Streaming
 
Chapitre 3 spark
Chapitre 3 sparkChapitre 3 spark
Chapitre 3 spark
 
Architecture Big Data open source S.M.A.C.K
Architecture Big Data open source S.M.A.C.KArchitecture Big Data open source S.M.A.C.K
Architecture Big Data open source S.M.A.C.K
 
Zenika matinale spark-zeppelin_ml
Zenika matinale spark-zeppelin_mlZenika matinale spark-zeppelin_ml
Zenika matinale spark-zeppelin_ml
 
Paris stormusergroup intrudocution
Paris stormusergroup intrudocutionParis stormusergroup intrudocution
Paris stormusergroup intrudocution
 
Cartographie du big data
Cartographie du big dataCartographie du big data
Cartographie du big data
 
Base de données graphe, Noe4j concepts et mise en oeuvre
Base de données graphe, Noe4j concepts et mise en oeuvreBase de données graphe, Noe4j concepts et mise en oeuvre
Base de données graphe, Noe4j concepts et mise en oeuvre
 
Algorithme distribués pour big data saison 2 @DevoxxFR 2016
Algorithme distribués pour big data saison 2 @DevoxxFR 2016Algorithme distribués pour big data saison 2 @DevoxxFR 2016
Algorithme distribués pour big data saison 2 @DevoxxFR 2016
 
BigData_TP5 : Neo4J
BigData_TP5 : Neo4JBigData_TP5 : Neo4J
BigData_TP5 : Neo4J
 
Realtime Web avec Akka, Kafka, Spark et Mesos - Devoxx Paris 2014
Realtime Web avec Akka, Kafka, Spark et Mesos - Devoxx Paris 2014Realtime Web avec Akka, Kafka, Spark et Mesos - Devoxx Paris 2014
Realtime Web avec Akka, Kafka, Spark et Mesos - Devoxx Paris 2014
 
HADOOP + R
HADOOP + RHADOOP + R
HADOOP + R
 
Spark RDD : Transformations & Actions
Spark RDD : Transformations & ActionsSpark RDD : Transformations & Actions
Spark RDD : Transformations & Actions
 
Indexation d'une base documentaire pour Liberation
Indexation d'une base documentaire pour LiberationIndexation d'une base documentaire pour Liberation
Indexation d'une base documentaire pour Liberation
 
Analytics et Big Data, une histoire de cubes...
Analytics et Big Data, une histoire de cubes...Analytics et Big Data, une histoire de cubes...
Analytics et Big Data, une histoire de cubes...
 

Andere mochten auch

How to Productionize Your Machine Learning Models Using Apache Spark MLlib 2....
How to Productionize Your Machine Learning Models Using Apache Spark MLlib 2....How to Productionize Your Machine Learning Models Using Apache Spark MLlib 2....
How to Productionize Your Machine Learning Models Using Apache Spark MLlib 2....Databricks
 
Dependency Injection in Apache Spark Applications
Dependency Injection in Apache Spark ApplicationsDependency Injection in Apache Spark Applications
Dependency Injection in Apache Spark ApplicationsDatabricks
 
A Deep Dive into Spark SQL's Catalyst Optimizer with Yin Huai
A Deep Dive into Spark SQL's Catalyst Optimizer with Yin HuaiA Deep Dive into Spark SQL's Catalyst Optimizer with Yin Huai
A Deep Dive into Spark SQL's Catalyst Optimizer with Yin HuaiDatabricks
 
Building Continuous Application with Structured Streaming and Real-Time Data ...
Building Continuous Application with Structured Streaming and Real-Time Data ...Building Continuous Application with Structured Streaming and Real-Time Data ...
Building Continuous Application with Structured Streaming and Real-Time Data ...Databricks
 
Fuzzy Matching on Apache Spark with Jennifer Shin
Fuzzy Matching on Apache Spark with Jennifer ShinFuzzy Matching on Apache Spark with Jennifer Shin
Fuzzy Matching on Apache Spark with Jennifer ShinDatabricks
 
Structured Streaming for Columnar Data Warehouses with Jack Gudenkauf
Structured Streaming for Columnar Data Warehouses with Jack GudenkaufStructured Streaming for Columnar Data Warehouses with Jack Gudenkauf
Structured Streaming for Columnar Data Warehouses with Jack GudenkaufDatabricks
 
An Online Spark Pipeline: Semi-Supervised Learning and Automatic Retraining w...
An Online Spark Pipeline: Semi-Supervised Learning and Automatic Retraining w...An Online Spark Pipeline: Semi-Supervised Learning and Automatic Retraining w...
An Online Spark Pipeline: Semi-Supervised Learning and Automatic Retraining w...Databricks
 
Microsoft R - ScaleR Overview
Microsoft R - ScaleR OverviewMicrosoft R - ScaleR Overview
Microsoft R - ScaleR OverviewKhalid Salama
 
Building Robust ETL Pipelines with Apache Spark
Building Robust ETL Pipelines with Apache SparkBuilding Robust ETL Pipelines with Apache Spark
Building Robust ETL Pipelines with Apache SparkDatabricks
 
[Tutorial] building machine learning models for predictive maintenance applic...
[Tutorial] building machine learning models for predictive maintenance applic...[Tutorial] building machine learning models for predictive maintenance applic...
[Tutorial] building machine learning models for predictive maintenance applic...PAPIs.io
 
TensorFrames: Google Tensorflow on Apache Spark
TensorFrames: Google Tensorflow on Apache SparkTensorFrames: Google Tensorflow on Apache Spark
TensorFrames: Google Tensorflow on Apache SparkDatabricks
 
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 HunterDatabricks
 
Deep Learning and Streaming in Apache Spark 2.x with Matei Zaharia
Deep Learning and Streaming in Apache Spark 2.x with Matei ZahariaDeep Learning and Streaming in Apache Spark 2.x with Matei Zaharia
Deep Learning and Streaming in Apache Spark 2.x with Matei ZahariaDatabricks
 
半教師あり学習
半教師あり学習半教師あり学習
半教師あり学習syou6162
 

Andere mochten auch (14)

How to Productionize Your Machine Learning Models Using Apache Spark MLlib 2....
How to Productionize Your Machine Learning Models Using Apache Spark MLlib 2....How to Productionize Your Machine Learning Models Using Apache Spark MLlib 2....
How to Productionize Your Machine Learning Models Using Apache Spark MLlib 2....
 
Dependency Injection in Apache Spark Applications
Dependency Injection in Apache Spark ApplicationsDependency Injection in Apache Spark Applications
Dependency Injection in Apache Spark Applications
 
A Deep Dive into Spark SQL's Catalyst Optimizer with Yin Huai
A Deep Dive into Spark SQL's Catalyst Optimizer with Yin HuaiA Deep Dive into Spark SQL's Catalyst Optimizer with Yin Huai
A Deep Dive into Spark SQL's Catalyst Optimizer with Yin Huai
 
Building Continuous Application with Structured Streaming and Real-Time Data ...
Building Continuous Application with Structured Streaming and Real-Time Data ...Building Continuous Application with Structured Streaming and Real-Time Data ...
Building Continuous Application with Structured Streaming and Real-Time Data ...
 
Fuzzy Matching on Apache Spark with Jennifer Shin
Fuzzy Matching on Apache Spark with Jennifer ShinFuzzy Matching on Apache Spark with Jennifer Shin
Fuzzy Matching on Apache Spark with Jennifer Shin
 
Structured Streaming for Columnar Data Warehouses with Jack Gudenkauf
Structured Streaming for Columnar Data Warehouses with Jack GudenkaufStructured Streaming for Columnar Data Warehouses with Jack Gudenkauf
Structured Streaming for Columnar Data Warehouses with Jack Gudenkauf
 
An Online Spark Pipeline: Semi-Supervised Learning and Automatic Retraining w...
An Online Spark Pipeline: Semi-Supervised Learning and Automatic Retraining w...An Online Spark Pipeline: Semi-Supervised Learning and Automatic Retraining w...
An Online Spark Pipeline: Semi-Supervised Learning and Automatic Retraining w...
 
Microsoft R - ScaleR Overview
Microsoft R - ScaleR OverviewMicrosoft R - ScaleR Overview
Microsoft R - ScaleR Overview
 
Building Robust ETL Pipelines with Apache Spark
Building Robust ETL Pipelines with Apache SparkBuilding Robust ETL Pipelines with Apache Spark
Building Robust ETL Pipelines with Apache Spark
 
[Tutorial] building machine learning models for predictive maintenance applic...
[Tutorial] building machine learning models for predictive maintenance applic...[Tutorial] building machine learning models for predictive maintenance applic...
[Tutorial] building machine learning models for predictive maintenance applic...
 
TensorFrames: Google Tensorflow on Apache Spark
TensorFrames: Google Tensorflow on Apache SparkTensorFrames: Google Tensorflow on Apache Spark
TensorFrames: Google Tensorflow on Apache Spark
 
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
 
Deep Learning and Streaming in Apache Spark 2.x with Matei Zaharia
Deep Learning and Streaming in Apache Spark 2.x with Matei ZahariaDeep Learning and Streaming in Apache Spark 2.x with Matei Zaharia
Deep Learning and Streaming in Apache Spark 2.x with Matei Zaharia
 
半教師あり学習
半教師あり学習半教師あり学習
半教師あり学習
 

Ähnlich wie Deep Learning on Apache Spark: TensorFrames & Deep Learning Pipelines

Spark-adabra, Comment Construire un DATALAKE ! (Devoxx 2017)
Spark-adabra, Comment Construire un DATALAKE ! (Devoxx 2017) Spark-adabra, Comment Construire un DATALAKE ! (Devoxx 2017)
Spark-adabra, Comment Construire un DATALAKE ! (Devoxx 2017) univalence
 
C2 - Langage C - ISIMA 1 - Deuxieme partie
C2 - Langage C - ISIMA 1 - Deuxieme partieC2 - Langage C - ISIMA 1 - Deuxieme partie
C2 - Langage C - ISIMA 1 - Deuxieme partieLoic Yon
 
Digital_Signal_Processors_TG_FULL.pdf
Digital_Signal_Processors_TG_FULL.pdfDigital_Signal_Processors_TG_FULL.pdf
Digital_Signal_Processors_TG_FULL.pdfHouBou3
 
Introduction à l'objet - Deuxième année ISIMA
Introduction à l'objet - Deuxième année ISIMAIntroduction à l'objet - Deuxième année ISIMA
Introduction à l'objet - Deuxième année ISIMALoic Yon
 
Gardez vos projets R organisés avec le package "project"
Gardez vos projets R organisés avec le package "project"Gardez vos projets R organisés avec le package "project"
Gardez vos projets R organisés avec le package "project"parisraddicts
 
Chap1V2019: Cours en C++
Chap1V2019: Cours en C++Chap1V2019: Cours en C++
Chap1V2019: Cours en C++Aziz Darouichi
 
TP4 Atelier C++ /GL2 INSAT / Tunisie
TP4 Atelier C++ /GL2 INSAT / TunisieTP4 Atelier C++ /GL2 INSAT / Tunisie
TP4 Atelier C++ /GL2 INSAT / TunisieMariem ZAOUALI
 
Data Mining (Partie 2).pdf
Data Mining (Partie 2).pdfData Mining (Partie 2).pdf
Data Mining (Partie 2).pdfOuailChoukhairi
 
Créer une IA capable de reconnaître des fleurs (ou autres)
Créer une IA capable de reconnaître des fleurs (ou autres)Créer une IA capable de reconnaître des fleurs (ou autres)
Créer une IA capable de reconnaître des fleurs (ou autres)Olivier Eeckhoutte
 
Scala : programmation fonctionnelle
Scala : programmation fonctionnelleScala : programmation fonctionnelle
Scala : programmation fonctionnelleMICHRAFY MUSTAFA
 
Spark Summit Europe Wrap Up and TASM State of the Community
Spark Summit Europe Wrap Up and TASM State of the CommunitySpark Summit Europe Wrap Up and TASM State of the Community
Spark Summit Europe Wrap Up and TASM State of the CommunityJean-Georges Perrin
 
U M L Analyse Et Conception Objet
U M L Analyse Et Conception ObjetU M L Analyse Et Conception Objet
U M L Analyse Et Conception ObjetAmine Chkr
 
Pourquoi Terraform n'est pas le bon outil pour les déploiements automatisés d...
Pourquoi Terraform n'est pas le bon outil pour les déploiements automatisés d...Pourquoi Terraform n'est pas le bon outil pour les déploiements automatisés d...
Pourquoi Terraform n'est pas le bon outil pour les déploiements automatisés d...Duyhai Doan
 
Retour d'expérience BIG COMPUTE & HPC sur Windows Azure, par ANEO et SUPELEC
Retour d'expérience BIG COMPUTE & HPC sur Windows Azure, par ANEO et SUPELECRetour d'expérience BIG COMPUTE & HPC sur Windows Azure, par ANEO et SUPELEC
Retour d'expérience BIG COMPUTE & HPC sur Windows Azure, par ANEO et SUPELECMicrosoft Technet France
 
Spark - au dela du dataframe avec Tungsten et Catalyst
Spark - au dela du dataframe avec Tungsten et CatalystSpark - au dela du dataframe avec Tungsten et Catalyst
Spark - au dela du dataframe avec Tungsten et CatalystMathieu Goeminne
 
20160216 - From BigData to BigProcessing
20160216 - From BigData to BigProcessing20160216 - From BigData to BigProcessing
20160216 - From BigData to BigProcessingPierre-Marie Brunet
 
C++ 11 - Tech Days 2014 in Paris
C++ 11 - Tech Days 2014 in ParisC++ 11 - Tech Days 2014 in Paris
C++ 11 - Tech Days 2014 in Parischristophep21
 

Ähnlich wie Deep Learning on Apache Spark: TensorFrames & Deep Learning Pipelines (20)

Spark tools by Jonathan Winandy
Spark tools by Jonathan WinandySpark tools by Jonathan Winandy
Spark tools by Jonathan Winandy
 
Spark-adabra, Comment Construire un DATALAKE ! (Devoxx 2017)
Spark-adabra, Comment Construire un DATALAKE ! (Devoxx 2017) Spark-adabra, Comment Construire un DATALAKE ! (Devoxx 2017)
Spark-adabra, Comment Construire un DATALAKE ! (Devoxx 2017)
 
Cours de Génie Logiciel / ESIEA 2016-17
Cours de Génie Logiciel / ESIEA 2016-17Cours de Génie Logiciel / ESIEA 2016-17
Cours de Génie Logiciel / ESIEA 2016-17
 
C2 - Langage C - ISIMA 1 - Deuxieme partie
C2 - Langage C - ISIMA 1 - Deuxieme partieC2 - Langage C - ISIMA 1 - Deuxieme partie
C2 - Langage C - ISIMA 1 - Deuxieme partie
 
Digital_Signal_Processors_TG_FULL.pdf
Digital_Signal_Processors_TG_FULL.pdfDigital_Signal_Processors_TG_FULL.pdf
Digital_Signal_Processors_TG_FULL.pdf
 
Introduction à l'objet - Deuxième année ISIMA
Introduction à l'objet - Deuxième année ISIMAIntroduction à l'objet - Deuxième année ISIMA
Introduction à l'objet - Deuxième année ISIMA
 
Gardez vos projets R organisés avec le package "project"
Gardez vos projets R organisés avec le package "project"Gardez vos projets R organisés avec le package "project"
Gardez vos projets R organisés avec le package "project"
 
Chap1V2019: Cours en C++
Chap1V2019: Cours en C++Chap1V2019: Cours en C++
Chap1V2019: Cours en C++
 
TP4 Atelier C++ /GL2 INSAT / Tunisie
TP4 Atelier C++ /GL2 INSAT / TunisieTP4 Atelier C++ /GL2 INSAT / Tunisie
TP4 Atelier C++ /GL2 INSAT / Tunisie
 
Data Mining (Partie 2).pdf
Data Mining (Partie 2).pdfData Mining (Partie 2).pdf
Data Mining (Partie 2).pdf
 
Créer une IA capable de reconnaître des fleurs (ou autres)
Créer une IA capable de reconnaître des fleurs (ou autres)Créer une IA capable de reconnaître des fleurs (ou autres)
Créer une IA capable de reconnaître des fleurs (ou autres)
 
Scala : programmation fonctionnelle
Scala : programmation fonctionnelleScala : programmation fonctionnelle
Scala : programmation fonctionnelle
 
Spark Summit Europe Wrap Up and TASM State of the Community
Spark Summit Europe Wrap Up and TASM State of the CommunitySpark Summit Europe Wrap Up and TASM State of the Community
Spark Summit Europe Wrap Up and TASM State of the Community
 
U M L Analyse Et Conception Objet
U M L Analyse Et Conception ObjetU M L Analyse Et Conception Objet
U M L Analyse Et Conception Objet
 
Uml
UmlUml
Uml
 
Pourquoi Terraform n'est pas le bon outil pour les déploiements automatisés d...
Pourquoi Terraform n'est pas le bon outil pour les déploiements automatisés d...Pourquoi Terraform n'est pas le bon outil pour les déploiements automatisés d...
Pourquoi Terraform n'est pas le bon outil pour les déploiements automatisés d...
 
Retour d'expérience BIG COMPUTE & HPC sur Windows Azure, par ANEO et SUPELEC
Retour d'expérience BIG COMPUTE & HPC sur Windows Azure, par ANEO et SUPELECRetour d'expérience BIG COMPUTE & HPC sur Windows Azure, par ANEO et SUPELEC
Retour d'expérience BIG COMPUTE & HPC sur Windows Azure, par ANEO et SUPELEC
 
Spark - au dela du dataframe avec Tungsten et Catalyst
Spark - au dela du dataframe avec Tungsten et CatalystSpark - au dela du dataframe avec Tungsten et Catalyst
Spark - au dela du dataframe avec Tungsten et Catalyst
 
20160216 - From BigData to BigProcessing
20160216 - From BigData to BigProcessing20160216 - From BigData to BigProcessing
20160216 - From BigData to BigProcessing
 
C++ 11 - Tech Days 2014 in Paris
C++ 11 - Tech Days 2014 in ParisC++ 11 - Tech Days 2014 in Paris
C++ 11 - Tech Days 2014 in Paris
 

Mehr von Databricks

DW Migration Webinar-March 2022.pptx
DW Migration Webinar-March 2022.pptxDW Migration Webinar-March 2022.pptx
DW Migration Webinar-March 2022.pptxDatabricks
 
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 1Databricks
 
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 2Databricks
 
Data Lakehouse Symposium | Day 2
Data Lakehouse Symposium | Day 2Data Lakehouse Symposium | Day 2
Data Lakehouse Symposium | Day 2Databricks
 
Data Lakehouse Symposium | Day 4
Data Lakehouse Symposium | Day 4Data Lakehouse Symposium | Day 4
Data Lakehouse Symposium | Day 4Databricks
 
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 HadoopDatabricks
 
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 PlatformDatabricks
 
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 ScienceDatabricks
 
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 MonitoringDatabricks
 
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 FixDatabricks
 
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 IntegrationDatabricks
 
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 PyTorchDatabricks
 
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 KubernetesDatabricks
 
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 PipelinesDatabricks
 
Sawtooth Windows for Feature Aggregations
Sawtooth Windows for Feature AggregationsSawtooth Windows for Feature Aggregations
Sawtooth Windows for Feature AggregationsDatabricks
 
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 SinkDatabricks
 
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 SparkDatabricks
 
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 QueriesDatabricks
 
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 SparkDatabricks
 
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 LakeDatabricks
 

Mehr von 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
 
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
 
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
 

Deep Learning on Apache Spark: TensorFrames & Deep Learning Pipelines

  • 1. Deep Learning avec Spark: TensorFrames Deep Learning Pipelines Timothée Hunter 09 Novembre 2017
  • 2. Bio • Timothée (Tim) Hunter • Ingénieur (Machine Learning) à Databricks • X04, M.S. Stanford • Ph.D. de UC Berkeley en Machine Learning • Ancien utilisateur (No 2) de Spark • Contributions à MLlib • Co-créateur des packages TensorFrames, GraphFrames, Deep Learning Pipelines #EUds6 2
  • 3. L’équipe Le produit À propos de Databricks La mission Regroupe les créateurs de Spark (maintenant Apache Spark), lancé à UC Berkeley en 2009 33 Une platforme unifiée pour l’analyse des données Unified Analytics Platform Simplifier le Big Data Making Big Data Simple Essayez gratuitement: databricks.com
  • 4. Cette présentation • Spark et Deep Learning: l’état des lieux • TensorFrames: intégration haute performance avec TensorFlow • Deep Learning Pipelines (DLP): le Deep Learning, avec simplicité
  • 5. Deep Learning? Apprentissage en profondeur? • Un ensemble de techniques qui représente des transformations par couches successives • Applicable en classification, regression, etc. • Populaire dans les années 80 (réseaux de neurones) • De nouveau utilisés (nouveaux algorithmes d’apprentissage, large collections de données, meilleures machines) t
  • 6. Spark et le Deep Learning • Spark n’inclut pas de bibliothèque de Deep Learning • Les bibliothèques existantes souvent difficiles à utiliser ou lentes • TensorFrames: intégration bas niveau, haute performance • Deep Learning Pipelines: faciliter le Deep Learning, avec Spark
  • 9. • Graphics Processing Units for General Purpose computations GPGPUs 9 4.6 Theoretical peak throughput (Tflops, single precision) GPU CPU Theoretical peak bandwidth (GB/s) GPU CPU
  • 10. • Bibliothèque dédiée au “machine intelligence” • Très populaire pour le Deep Learning • Mais aussi excellente pour les calculs numériques • Interface: C++ et Python (et d’autres langages) Google TensorFlow 10
  • 11. Dataflow numérique avec Tensorflow 11 x = tf.placeholder(tf.int32, name=“x”) y = tf.placeholder(tf.int32, name=“y”) output = tf.add(x, 3 * y, name=“z”) session = tf.Session() output_value = session.run(output, {x: 3, y: 5}) x: int32 y: int32 mul 3 z
  • 12. Dataflow numérique avec Tensorflow df = sqlContext.createDataFrame(…) x = tf.placeholder(tf.int32, name=“x”) y = tf.placeholder(tf.int32, name=“y”) output = tf.add(x, 3 * y, name=“z”) output_df = tfs.map_rows(output, df) output_df.collect() df: DataFrame[x: int, y: int] output_df: DataFrame[x: int, y: int, z: int] x: int32 y: int32 mul 3 z
  • 13. C’est un problème de communication 13 Spark worker process Worker python process C++ buffer Python pickle Tungsten binary format Python pickle Java object
  • 14. TensorFrames: native embedding of TensorFlow 14 Spark worker process C++ buffer Tungsten binary format Java object
  • 15. Exemple: kernel density scoring 15 • Estimateur non-parametrique • Courramment utilisé pour lisser des surfaces
  • 16. • En pratique: calculer avec: • Pour simplifier: une belle fonction numérique Exemple: kernel density scoring 16
  • 17. Speedup 20 0 50 100 Scala UDF Scala UDF (optimized) TensorFrames TensorFrames + GPU Normalized cost def score(x: Double): Double = { val dis = points.map { z_k => - (x - z_k) * (x - z_k) / ( 2 * b * b) } val minDis = dis.min val exps = dis.map(d => math.exp(d - minDis)) minDis - math.log(b * N) + math.log(exps.sum) } val scoreUDF = sqlContext.udf.register("scoreUDF", score _) sql("select sum(scoreUDF(sample)) from samples").collect()
  • 18. Speedup 21 0 50 100 Scala UDF Scala UDF (optimized) TensorFrames TensorFrames + GPU Normalized cost def score(x: Double): Double = { val dis = new Array[Double](N) var idx = 0 while(idx < N) { val z_k = points(idx) dis(idx) = - (x - z_k) * (x - z_k) / ( 2 * b * b) idx += 1 } val minDis = dis.min var expSum = 0.0 idx = 0 while(idx < N) { expSum += math.exp(dis(idx) - minDis) idx += 1 } minDis - math.log(b * N) + math.log(expSum) } val scoreUDF = sqlContext.udf.register("scoreUDF", score _) sql("select sum(scoreUDF(sample)) from samples").collect()
  • 19. Speedup 22 0 50 100 Scala UDF Scala UDF (optimized) TensorFrames TensorFrames + GPU Normalized cost def cost_fun(block, bandwidth): distances = - square(constant(X) - sample) / (2 * b * b) m = reduce_max(distances, 0) x = log(reduce_sum(exp(distances - m), 0)) return identity(x + m - log(b * N), name="score”) sample = tfs.block(df, "sample") score = cost_fun(sample, bandwidth=0.5) df.agg(sum(tfs.map_blocks(score, df))).collect()
  • 20. Speedup 23 0 50 100 Scala UDF Scala UDF (optimized) TensorFrames TensorFrames + GPU Normalized cost def cost_fun(block, bandwidth): distances = - square(constant(X) - sample) / (2 * b * b) m = reduce_max(distances, 0) x = log(reduce_sum(exp(distances - m), 0)) return identity(x + m - log(b * N), name="score”) with device("/gpu"): sample = tfs.block(df, "sample") score = cost_fun(sample, bandwidth=0.5) df.agg(sum(tfs.map_blocks(score, df))).collect()
  • 21. Récapitulons • Spark: excellent pour distribuer des calculs sur des centaines de machines • TensorFlow: excellent pour les calculs numériques • Le meilleur des deux mondes avec TensorFrames
  • 22. Deep Learning Pipelines: le Deep Learning avec simplicité
  • 23. Deep Learning Pipelines: le Deep Learning avec simplicité Deep Learning Pipelines • Libre (Apache 2.0), développée par Databricks • Met l’accent sur la facilité and l’intégration • sans oublier la performance • Langage par défaut: Python • Apache Spark utilisé pour distribuer les tâches • S’intègre dans MLlib (Pipelines) pour faciliter les workflows ML s
  • 24. Achetons des chaussures en ligne…
  • 25.
  • 26.
  • 27. Resources machines Beaucoup de manipulations Labeled Data Challenges
  • 28. Deep Learning Pipelines Distribution automatique avec Apache Spark MLlib Pipelines API Transfer Learning Réutilisation de modèles
  • 37. Scalability : Apache Spark SINGLE NODE 10minutes 6hours DeepImageFeaturizer.transform(image_data)
  • 38. Deep Learning Pipelines 10minutes 7lines de code Distribution élastique avec Apache Spark MLlib Pipelines API Transfer Learning 0labels