SlideShare uma empresa Scribd logo
1 de 21
Baixar para ler offline
Image Caption Generation: Intro to Distributed
Tensorflow and Distributed Scoring with Apache Spark
Luca Grazioli, Data Scientist @ ICTEAM
Data Science Milan, 15th May 2017
2 ICTeam S.p.A. – Presentazione della Divisione Progettazione
Agenda
 Who am I
 ICTeam Big Data Lab
 What’s Deep Learning?
 Deep Learning Challenges
 Tensorflow
 Distributed Tensorflow
 Image caption generation
 Distributed scoring with APACHE SPARK
3 ICTeam S.p.A. – Presentazione della Divisione Progettazione
Who am I
MSc computer science
• University of Milan-Bicocca
• Definition of a Knowledge Engineer ML model
Academic research
• Modeling and understanding time-evolving scenario
(http://www.iiisci.org/journal/CV$/sci/pdfs/SA268SN15.pdf)
Data Scientist @ ICTeam
• Big Data Science
• Data Engineering (a bit!)
• Deep Learning
More at: http://luca-grazioli.it or on Linkedin
4 ICTeam S.p.A. – Presentazione della Divisione Progettazione
GPU NODE 2
ICTeam Big Data Lab
BIG DATA CLUSTER
CLUSTER
NODE 1
CLUSTER
NODE 2
CLUSTER
NODE 3
CLUSTER
NODE 4
EDGE NODE
WEB CLIENT TOOLS
GPU NODE 2
GPU NODE 1
5 ICTeam S.p.A. – Presentazione della Divisione Progettazione
Deep Learning
Credit by Lukas Masuch
6 ICTeam S.p.A. – Presentazione della Divisione Progettazione
Deep Learning
Computer vision
Natural Language
processing
Speech recognition
7 ICTeam S.p.A. – Presentazione della Divisione Progettazione
Deep Learning Challenges
Data Volume
CPU usage
Graph complexity
Parameter Space
8 ICTeam S.p.A. – Presentazione della Divisione Progettazione
Tensorflow
x W
Matmul
b
Add
RELU
C import tensorflow as tf
b = tf.Variable(tf.zeros(100)
x = tf.placeholder(name=‘x’)
W = tf.variable(. . .)
regr = tf.matmul(W, x) + b
relu = tf.nn.relu(regr)
C = [. . .]
# Session
s = tf.Session()
for step in xrange(0, 10):
input = . . .
result = s.run(C, feed_dict={x:
input})
…
[...] Tensorflow takes
computation described
[...] and maps it onto a
wide variety of
different HW
platform, ranging from
[…] mobile device
platforms such as
Android and iOS to […]
large scale
computing systems
[...]
9 ICTeam S.p.A. – Presentazione della Divisione Progettazione
Distributed TF: concepts
Multi-device
execution
Data
Parallel
Training
In-graph
processing
Between-
graph
processing
Model
parallel
training
Model
computation
pipelining
10 ICTeam S.p.A. – Presentazione della Divisione Progettazione
Distributed TF: concepts
Multi-device
execution
Credits: http://download.tensorflow.org/paper/whitepaper2015.pdf
Multi-device
execution
Data Parallel
Training
In-graph
processing
Between-
graph
processing
Model
parallel
training
Model
computation
pipelining
11 ICTeam S.p.A. – Presentazione della Divisione Progettazione
Distributed TF: concepts
Model
parallel
training
Credits: http://download.tensorflow.org/paper/whitepaper2015.pdf
Multi-device
execution
Data Parallel
Training
In-graph
processing
Between-
graph
processing
Model
parallel
training
Model
computation
pipelining
12 ICTeam S.p.A. – Presentazione della Divisione Progettazione
Distributed TF: concepts
Model
computation
pipelining
Credits: http://download.tensorflow.org/paper/whitepaper2015.pdf
Multi-device
execution
Data Parallel
Training
In-graph
processing
Between-
graph
processing
Model
parallel
training
Model
computation
pipelining
13 ICTeam S.p.A. – Presentazione della Divisione Progettazione
Distributed TF: concepts
In-graph Processing
Client
Worker 1
CPU:0 GPU:0
Worker 2
CPU:0
PARAMETER SERVERS
PS1 PS2 PS3
Between-graph Processing
Client 1
Worker 1.1
CPU:0 GPU:0
Worker 1.2
CPU:0
PARAMETER SERVERS
PS1 PS2 PS3
Client 2
Worker 2.1
CPU:0 GPU:0
CPU:0
Worker 2.2
14 ICTeam S.p.A. – Presentazione della Divisione Progettazione
Layer 1
Layer 2
Data
shard 2
Layer 1
Layer 2
Layer 1’
Layer 2’
Data
shard 1
Data
shard 4
Layer 1’
Layer 2’
Between-graph Processing
Data
shard 3
Client 1
Worker 1.1 Worker 1.2
PARAMETER SERVERS
PS1 PS2 PS3
Client 2
Worker 2.1
Worker 2.2
Layer 1
Layer 2
Layer 1
Layer 2
Data
shard 3
Data
shard 1
In-graph Processing
Client
Worker 1 Worker 2
PARAMETER SERVERS
PS1 PS2 PS3
Data
shard 2
Data
shard 4
Distributed TF: concepts
15 ICTeam S.p.A. – Presentazione della Divisione Progettazione
Image caption generation
Credits: https://github.com/tensorflow/models/tree/master/im2txt http://press.liacs.nl/mirflickr/
• A couple of dogs standing next to each
other.
• A couple of dogs are standing in a field.
• A couple of dogs standing next to each
other on a field.
• A scenic view of a lake with mountains in the
background.
• A scenic view of a lake with mountains in the
distance.
• A scenic view of a lake with a mountain in the
background.
• A city street at night with traffic lights.
• A city street at night with a red light.
• A city street at night with a red light.
Try it
yourself!
http://bit.ly
/2r8jU1q
16 ICTeam S.p.A. – Presentazione della Divisione Progettazione
Image caption generation
17 ICTeam S.p.A. – Presentazione della Divisione Progettazione
Distributed scoring with APACHE SPARK
Phase1 - Ingestion
File
Syste
m
Phase 2 – Distributed Scoring
Data
Node
. . .
CLUSTER EDGE
NODE
SPARK
DRIVER
Data
Node
18 ICTeam S.p.A. – Presentazione della Divisione Progettazione
Distributed scoring with APACHE SPARK
Read images
• images_df = spark.read.parquet('/user/lgrazioli/flickrTestImageBin/')
Define
Scoring function
• Restore last training checkpoint
• Define iterator function to yield scored record from a partition
Let’s score!
• scored_sample_rdd = images_df.rdd.mapPartitions(score_partition).flatMap(lambda
x: x)
• scored_df = spark.createDataFrame(scored_sample_rdd, schema)
19 ICTeam S.p.A. – Presentazione della Divisione Progettazione
Conclusion
Today’s goals:
• Understand Deep Learning technological challanges
• How to distribute a deep learning training algorithm
• How to score in distributed fashion
• How a big data ecosystem can help
Future works:
• Tensorframes https://github.com/databricks/tensorframes
• New technologies (e.g. TPU )
• Tensorflow improvements
• High-level API
20 ICTeam S.p.A. – Presentazione della Divisione Progettazione
Bibliography
1. Deep Learning - The Past, Present and Future of Artificial
Intelligence (Lukas Masuch)
2. TensorFlow: Large-Scale Machine Learning on Heterogeneous
Distributed Systems (Martin Abadi, Ashish Agarwal, et al.)
3. https://github.com/tensorflow/models/tree/master/im2txt
4. http://press.liacs.nl/mirflickr/
Thanks!

Mais conteúdo relacionado

Mais procurados

Distributed ML/DL with Ignite ML Module Using Apache Spark as Database
Distributed ML/DL with Ignite ML Module Using Apache Spark as DatabaseDistributed ML/DL with Ignite ML Module Using Apache Spark as Database
Distributed ML/DL with Ignite ML Module Using Apache Spark as Database
Databricks
 
Alerting mechanism and algorithms introduction
Alerting mechanism and algorithms introductionAlerting mechanism and algorithms introduction
Alerting mechanism and algorithms introduction
FEG
 
Punit_Shah_resume
Punit_Shah_resumePunit_Shah_resume
Punit_Shah_resume
Punit Shah
 
Low Energy Task Scheduling based on Work Stealing
Low Energy Task Scheduling based on Work StealingLow Energy Task Scheduling based on Work Stealing
Low Energy Task Scheduling based on Work Stealing
LEGATO project
 

Mais procurados (15)

Delivering near real time mobility insights at swisscom
Delivering near real time mobility insights at swisscomDelivering near real time mobility insights at swisscom
Delivering near real time mobility insights at swisscom
 
ScilabTEC 2015 - Silkan
ScilabTEC 2015 - SilkanScilabTEC 2015 - Silkan
ScilabTEC 2015 - Silkan
 
SC13: OpenMP and NVIDIA
SC13: OpenMP and NVIDIASC13: OpenMP and NVIDIA
SC13: OpenMP and NVIDIA
 
Distributed ML/DL with Ignite ML Module Using Apache Spark as Database
Distributed ML/DL with Ignite ML Module Using Apache Spark as DatabaseDistributed ML/DL with Ignite ML Module Using Apache Spark as Database
Distributed ML/DL with Ignite ML Module Using Apache Spark as Database
 
Bridging the Gap Between Datasets and DataFrames
Bridging the Gap Between Datasets and DataFramesBridging the Gap Between Datasets and DataFrames
Bridging the Gap Between Datasets and DataFrames
 
Asynchronous Hyperparameter Optimization with Apache Spark
Asynchronous Hyperparameter Optimization with Apache SparkAsynchronous Hyperparameter Optimization with Apache Spark
Asynchronous Hyperparameter Optimization with Apache Spark
 
Introducing MLflow for R
Introducing MLflow for RIntroducing MLflow for R
Introducing MLflow for R
 
Application and Challenges of Streaming Analytics and Machine Learning on Mu...
 Application and Challenges of Streaming Analytics and Machine Learning on Mu... Application and Challenges of Streaming Analytics and Machine Learning on Mu...
Application and Challenges of Streaming Analytics and Machine Learning on Mu...
 
Scilab Modelica conference 20150921
Scilab Modelica conference 20150921Scilab Modelica conference 20150921
Scilab Modelica conference 20150921
 
ScilabTEC 2015 - KIT
ScilabTEC 2015 - KITScilabTEC 2015 - KIT
ScilabTEC 2015 - KIT
 
Static Energy Prediction in Software: A Worst-Case Scenario Approach
Static Energy Prediction in Software: A Worst-Case Scenario ApproachStatic Energy Prediction in Software: A Worst-Case Scenario Approach
Static Energy Prediction in Software: A Worst-Case Scenario Approach
 
Alerting mechanism and algorithms introduction
Alerting mechanism and algorithms introductionAlerting mechanism and algorithms introduction
Alerting mechanism and algorithms introduction
 
Punit_Shah_resume
Punit_Shah_resumePunit_Shah_resume
Punit_Shah_resume
 
Graph Analytics for big data
Graph Analytics for big dataGraph Analytics for big data
Graph Analytics for big data
 
Low Energy Task Scheduling based on Work Stealing
Low Energy Task Scheduling based on Work StealingLow Energy Task Scheduling based on Work Stealing
Low Energy Task Scheduling based on Work Stealing
 

Semelhante a Image Caption Generation: Intro to Distributed Tensorflow and Distributed Scoring with APACHE Spark

Resume-Rohit_Vijay_Bapat_December_2016
Resume-Rohit_Vijay_Bapat_December_2016Resume-Rohit_Vijay_Bapat_December_2016
Resume-Rohit_Vijay_Bapat_December_2016
Rohit Bapat
 
A Journey to Building an Autonomous Streaming Data Platform—Scaling to Trilli...
A Journey to Building an Autonomous Streaming Data Platform—Scaling to Trilli...A Journey to Building an Autonomous Streaming Data Platform—Scaling to Trilli...
A Journey to Building an Autonomous Streaming Data Platform—Scaling to Trilli...
Databricks
 

Semelhante a Image Caption Generation: Intro to Distributed Tensorflow and Distributed Scoring with APACHE Spark (20)

The Fine Art of Time Travelling - Implementing Event Sourcing - Andrea Saltar...
The Fine Art of Time Travelling - Implementing Event Sourcing - Andrea Saltar...The Fine Art of Time Travelling - Implementing Event Sourcing - Andrea Saltar...
The Fine Art of Time Travelling - Implementing Event Sourcing - Andrea Saltar...
 
Automatic generation of hardware memory architectures for HPC
Automatic generation of hardware memory architectures for HPCAutomatic generation of hardware memory architectures for HPC
Automatic generation of hardware memory architectures for HPC
 
Creating a Machine Learning Model on the Cloud
Creating a Machine Learning Model on the CloudCreating a Machine Learning Model on the Cloud
Creating a Machine Learning Model on the Cloud
 
CV Jens Grunert
CV Jens GrunertCV Jens Grunert
CV Jens Grunert
 
Azure tales: a real world CQRS and ES Deep Dive - Andrea Saltarello
Azure tales: a real world CQRS and ES Deep Dive - Andrea SaltarelloAzure tales: a real world CQRS and ES Deep Dive - Andrea Saltarello
Azure tales: a real world CQRS and ES Deep Dive - Andrea Saltarello
 
Resume-Rohit_Vijay_Bapat_December_2016
Resume-Rohit_Vijay_Bapat_December_2016Resume-Rohit_Vijay_Bapat_December_2016
Resume-Rohit_Vijay_Bapat_December_2016
 
HPC in higher education
HPC in higher educationHPC in higher education
HPC in higher education
 
The CAOS framework: democratize the acceleration of compute intensive applica...
The CAOS framework: democratize the acceleration of compute intensive applica...The CAOS framework: democratize the acceleration of compute intensive applica...
The CAOS framework: democratize the acceleration of compute intensive applica...
 
Speeding up Programs with OpenACC in GCC
Speeding up Programs with OpenACC in GCCSpeeding up Programs with OpenACC in GCC
Speeding up Programs with OpenACC in GCC
 
Third Gen Production ML Architectures: Lessons from History, Experiences with...
Third Gen Production ML Architectures: Lessons from History, Experiences with...Third Gen Production ML Architectures: Lessons from History, Experiences with...
Third Gen Production ML Architectures: Lessons from History, Experiences with...
 
Sailing the V: Engineering digitalization through task automation and reuse i...
Sailing the V: Engineering digitalization through task automation and reuse i...Sailing the V: Engineering digitalization through task automation and reuse i...
Sailing the V: Engineering digitalization through task automation and reuse i...
 
A Journey to Building an Autonomous Streaming Data Platform—Scaling to Trilli...
A Journey to Building an Autonomous Streaming Data Platform—Scaling to Trilli...A Journey to Building an Autonomous Streaming Data Platform—Scaling to Trilli...
A Journey to Building an Autonomous Streaming Data Platform—Scaling to Trilli...
 
Creating a custom Machine Learning Model for your applications - Java Dev Day...
Creating a custom Machine Learning Model for your applications - Java Dev Day...Creating a custom Machine Learning Model for your applications - Java Dev Day...
Creating a custom Machine Learning Model for your applications - Java Dev Day...
 
License Plate Recognition System using Python and OpenCV
License Plate Recognition System using Python and OpenCVLicense Plate Recognition System using Python and OpenCV
License Plate Recognition System using Python and OpenCV
 
Eclipse Con Europe 2014 How to use DAWN Science Project
Eclipse Con Europe 2014 How to use DAWN Science ProjectEclipse Con Europe 2014 How to use DAWN Science Project
Eclipse Con Europe 2014 How to use DAWN Science Project
 
Computer graphics by bahadar sher
Computer graphics by bahadar sherComputer graphics by bahadar sher
Computer graphics by bahadar sher
 
Network Analyzer and Report Generation Tool for NS-2 using TCL Script
Network Analyzer and Report Generation Tool for NS-2 using TCL ScriptNetwork Analyzer and Report Generation Tool for NS-2 using TCL Script
Network Analyzer and Report Generation Tool for NS-2 using TCL Script
 
Dsp lab manual 15 11-2016
Dsp lab manual 15 11-2016Dsp lab manual 15 11-2016
Dsp lab manual 15 11-2016
 
Productionizing Machine Learning - Bigdata meetup 5-06-2019
Productionizing Machine Learning - Bigdata meetup 5-06-2019Productionizing Machine Learning - Bigdata meetup 5-06-2019
Productionizing Machine Learning - Bigdata meetup 5-06-2019
 
Sparklyr: Big Data enabler for R users
Sparklyr: Big Data enabler for R usersSparklyr: Big Data enabler for R users
Sparklyr: Big Data enabler for R users
 

Último

The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
ZurliaSoop
 

Último (20)

FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the Classroom
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 

Image Caption Generation: Intro to Distributed Tensorflow and Distributed Scoring with APACHE Spark

  • 1. Image Caption Generation: Intro to Distributed Tensorflow and Distributed Scoring with Apache Spark Luca Grazioli, Data Scientist @ ICTEAM Data Science Milan, 15th May 2017
  • 2. 2 ICTeam S.p.A. – Presentazione della Divisione Progettazione Agenda  Who am I  ICTeam Big Data Lab  What’s Deep Learning?  Deep Learning Challenges  Tensorflow  Distributed Tensorflow  Image caption generation  Distributed scoring with APACHE SPARK
  • 3. 3 ICTeam S.p.A. – Presentazione della Divisione Progettazione Who am I MSc computer science • University of Milan-Bicocca • Definition of a Knowledge Engineer ML model Academic research • Modeling and understanding time-evolving scenario (http://www.iiisci.org/journal/CV$/sci/pdfs/SA268SN15.pdf) Data Scientist @ ICTeam • Big Data Science • Data Engineering (a bit!) • Deep Learning More at: http://luca-grazioli.it or on Linkedin
  • 4. 4 ICTeam S.p.A. – Presentazione della Divisione Progettazione GPU NODE 2 ICTeam Big Data Lab BIG DATA CLUSTER CLUSTER NODE 1 CLUSTER NODE 2 CLUSTER NODE 3 CLUSTER NODE 4 EDGE NODE WEB CLIENT TOOLS GPU NODE 2 GPU NODE 1
  • 5. 5 ICTeam S.p.A. – Presentazione della Divisione Progettazione Deep Learning Credit by Lukas Masuch
  • 6. 6 ICTeam S.p.A. – Presentazione della Divisione Progettazione Deep Learning Computer vision Natural Language processing Speech recognition
  • 7. 7 ICTeam S.p.A. – Presentazione della Divisione Progettazione Deep Learning Challenges Data Volume CPU usage Graph complexity Parameter Space
  • 8. 8 ICTeam S.p.A. – Presentazione della Divisione Progettazione Tensorflow x W Matmul b Add RELU C import tensorflow as tf b = tf.Variable(tf.zeros(100) x = tf.placeholder(name=‘x’) W = tf.variable(. . .) regr = tf.matmul(W, x) + b relu = tf.nn.relu(regr) C = [. . .] # Session s = tf.Session() for step in xrange(0, 10): input = . . . result = s.run(C, feed_dict={x: input}) … [...] Tensorflow takes computation described [...] and maps it onto a wide variety of different HW platform, ranging from […] mobile device platforms such as Android and iOS to […] large scale computing systems [...]
  • 9. 9 ICTeam S.p.A. – Presentazione della Divisione Progettazione Distributed TF: concepts Multi-device execution Data Parallel Training In-graph processing Between- graph processing Model parallel training Model computation pipelining
  • 10. 10 ICTeam S.p.A. – Presentazione della Divisione Progettazione Distributed TF: concepts Multi-device execution Credits: http://download.tensorflow.org/paper/whitepaper2015.pdf Multi-device execution Data Parallel Training In-graph processing Between- graph processing Model parallel training Model computation pipelining
  • 11. 11 ICTeam S.p.A. – Presentazione della Divisione Progettazione Distributed TF: concepts Model parallel training Credits: http://download.tensorflow.org/paper/whitepaper2015.pdf Multi-device execution Data Parallel Training In-graph processing Between- graph processing Model parallel training Model computation pipelining
  • 12. 12 ICTeam S.p.A. – Presentazione della Divisione Progettazione Distributed TF: concepts Model computation pipelining Credits: http://download.tensorflow.org/paper/whitepaper2015.pdf Multi-device execution Data Parallel Training In-graph processing Between- graph processing Model parallel training Model computation pipelining
  • 13. 13 ICTeam S.p.A. – Presentazione della Divisione Progettazione Distributed TF: concepts In-graph Processing Client Worker 1 CPU:0 GPU:0 Worker 2 CPU:0 PARAMETER SERVERS PS1 PS2 PS3 Between-graph Processing Client 1 Worker 1.1 CPU:0 GPU:0 Worker 1.2 CPU:0 PARAMETER SERVERS PS1 PS2 PS3 Client 2 Worker 2.1 CPU:0 GPU:0 CPU:0 Worker 2.2
  • 14. 14 ICTeam S.p.A. – Presentazione della Divisione Progettazione Layer 1 Layer 2 Data shard 2 Layer 1 Layer 2 Layer 1’ Layer 2’ Data shard 1 Data shard 4 Layer 1’ Layer 2’ Between-graph Processing Data shard 3 Client 1 Worker 1.1 Worker 1.2 PARAMETER SERVERS PS1 PS2 PS3 Client 2 Worker 2.1 Worker 2.2 Layer 1 Layer 2 Layer 1 Layer 2 Data shard 3 Data shard 1 In-graph Processing Client Worker 1 Worker 2 PARAMETER SERVERS PS1 PS2 PS3 Data shard 2 Data shard 4 Distributed TF: concepts
  • 15. 15 ICTeam S.p.A. – Presentazione della Divisione Progettazione Image caption generation Credits: https://github.com/tensorflow/models/tree/master/im2txt http://press.liacs.nl/mirflickr/ • A couple of dogs standing next to each other. • A couple of dogs are standing in a field. • A couple of dogs standing next to each other on a field. • A scenic view of a lake with mountains in the background. • A scenic view of a lake with mountains in the distance. • A scenic view of a lake with a mountain in the background. • A city street at night with traffic lights. • A city street at night with a red light. • A city street at night with a red light. Try it yourself! http://bit.ly /2r8jU1q
  • 16. 16 ICTeam S.p.A. – Presentazione della Divisione Progettazione Image caption generation
  • 17. 17 ICTeam S.p.A. – Presentazione della Divisione Progettazione Distributed scoring with APACHE SPARK Phase1 - Ingestion File Syste m Phase 2 – Distributed Scoring Data Node . . . CLUSTER EDGE NODE SPARK DRIVER Data Node
  • 18. 18 ICTeam S.p.A. – Presentazione della Divisione Progettazione Distributed scoring with APACHE SPARK Read images • images_df = spark.read.parquet('/user/lgrazioli/flickrTestImageBin/') Define Scoring function • Restore last training checkpoint • Define iterator function to yield scored record from a partition Let’s score! • scored_sample_rdd = images_df.rdd.mapPartitions(score_partition).flatMap(lambda x: x) • scored_df = spark.createDataFrame(scored_sample_rdd, schema)
  • 19. 19 ICTeam S.p.A. – Presentazione della Divisione Progettazione Conclusion Today’s goals: • Understand Deep Learning technological challanges • How to distribute a deep learning training algorithm • How to score in distributed fashion • How a big data ecosystem can help Future works: • Tensorframes https://github.com/databricks/tensorframes • New technologies (e.g. TPU ) • Tensorflow improvements • High-level API
  • 20. 20 ICTeam S.p.A. – Presentazione della Divisione Progettazione Bibliography 1. Deep Learning - The Past, Present and Future of Artificial Intelligence (Lukas Masuch) 2. TensorFlow: Large-Scale Machine Learning on Heterogeneous Distributed Systems (Martin Abadi, Ashish Agarwal, et al.) 3. https://github.com/tensorflow/models/tree/master/im2txt 4. http://press.liacs.nl/mirflickr/