SlideShare a Scribd company logo
1 of 35
TensorFlow and Clipper
(Lecture 24, cs262a)
Ali Ghodsi and Ion Stoica,
UC Berkeley
April 18, 2018
Today’s lecture
Abadi et al., “TensorFlow: A System for Large-Scale Machine
Learning”, OSDI 2016
(https://www.usenix.org/system/files/conference/osdi16/osdi16-abadi.pdf)
Crankshaw et al., “Clipper: A Low-Latency Online Prediction
Serving System”, NSDI 2017
(https://www.usenix.org/conference/nsdi17/technical-
sessions/presentation/crankshaw)
A short history of Neural Networks
1957: Perceptron (Frank Rosenblatt): one layer network neural
network
1959: first neural network to solve a real world problem, i.e.,
eliminates echoes on phone lines (Widrow & Hoff)
1988: Backpropagation (Rumelhart, Hinton, Williams): learning
a multi-layered network
A short history of NNs
1989: ALVINN: autonomous driving car
using NN (CMU)
1989: (LeCun) Successful application to recognize handwritten
ZIP codes on mail using a “deep” network
2010s: near-human capabilities for image recognition, speech
recognition, and language translation
Perceptron
Invented by Frank Rosenblatt (1957): simplified mathematical
model of how the neurons in our brains operate
From: http://www.andreykurenkov.com/writing/ai/a-brief-history-of-neural-nets-and-deep-learning/
Perceptron
Could implement AND, OR, but not XOR
From: http://www.andreykurenkov.com/writing/ai/a-brief-history-of-neural-nets-and-deep-learning/
Hidden layers
Hidden layers can find features within the data and allow
following layers to operate on those features
• Can implement XOR
From: http://www.andreykurenkov.com/writing/ai/a-brief-history-of-neural-nets-and-deep-learning/
Learning: Backpropagation
From: http://www.andreykurenkov.com/writing/ai/a-brief-history-of-neural-nets-and-deep-learning/
Context (circa 2015)
Deep learning already claiming big successes
From: http://www.wsdm-conference.org/2016/slides/WSDM2016-Jeff-Dean.pdfz
Imagenet
challenge
classification
task
Context (circa 2015)
Deep learning already claiming big successes
Number of developers/researchers exploding
A “zoo” of tools and libraries, some of questionable quality…
What is TensorFlow?
Open source library for numerical computation using data flow graphs
Developed by Google Brain Team to conduct machine learning research
• Based on DisBelief used internally at Google since 2011
“TensorFlow is an interface for expressing machine learning algorithms, and
an implementation for executing such algorithms”
What is TensorFlow
Key idea: express a numeric computation as a graph
Graph nodes are operations with any number of inputs and
outputs
Graph edges are tensors which flow between nodes
Programming model
Variables are stateful nodes which
output their current value. State is
retained across multiple executions
of a graph
(mostly parameters)
Programming model
Programming model
Placeholders are nodes
whose value is fed in at
execution time
(inputs, labels, …)
Programming model
Mathematical operations:
MatMul: Multiply two matrices
Add: Add elementwise
ReLU: Activate with elementwise
rectified linear function
ReLu(x) =
0, x <= 0
x, x > 0
Code
import tensorflow as tf
b = tf.Variable(tf.zeros((100,)))
W = tf.Variable(tf.random_uniform((784, 100), -1, 1))
x = tf.placeholder(tf.float32, (1, 784))
h = tf.nn.relu(tf.matmul(x, W) + b)
Running the graph
Deploy graph with a session:
a binding to a particular
execution context (e.g. CPU,
GPU)
CPU
GPU
End-to-end
So far:
• Built a graph using variables and placeholders
• Deploy the graph onto a session, i.e., execution environment
Next: train model
• Define loss function
• Compute gradients
Defining loss
Use placeholder for labels
Build loss node using labels and prediction
prediction = tf.nn.softmax(...) #Output of neural network
label = tf.placeholder(tf.float32, [100, 10])
cross_entropy = -tf.reduce_sum(label * tf.log(prediction), axis=1)
Gradient computation: Backpropagation
train_step = tf.train.GradientDescentOptimizer(0.5).minimize(cross_entropy)
tf.train.GradientDescentOptimizer is an Optimizer object
tf.train.GradientDescentOptimizer(lr).minimize(cross_entropy)
adds optimization operation to computation graph
TensorFlow graph nodes have attached gradient operations
Gradient with respect to parameters computed with
backpropagation … automatically
Design Principles
Dataflow graphs of primitive operators
Deferred execution (two phases)
1. Define program i.e., symbolic dataflow graph w/ placeholders
2. Executes optimized version of program on set of available devices
Common abstraction for heterogeneous accelerators
1. Issue a kernel for execution
2. Allocate memory for inputs and outputs
3. Transfer buffers to and from host memory
Dynamic Flow Control
Problem: support ML algos that contain conditional and
iterative control flow, e.g.
• Recurrent Neural Networks (RNNs)
• Long-Short Term Memory (LSTM)
Solution: Add conditional (if statement) and iterative (while
loop) programming constructs
TensorFlow high-level architecture
Core in C++
• Very low overhead
Different front ends for specifying/driving the computation
• Python and C++ today, easy to add more
From: http://www.wsdm-conference.org/2016/slides/WSDM2016-Jeff-Dean.pdf
TensorFlow architecture
Core in C++
• Very low overhead
Different front ends for specifying/driving the computation
• Python and C++ today, easy to add more
From: http://www.wsdm-conference.org/2016/slides/WSDM2016-Jeff-Dean.pdf
Detailed architecture
From: https://www.tensorflow.org/extend/architecture
Key components
Similar to MapReduce, Apache Hadoop, Apache Spark, …
From: https://www.tensorflow.org/extend/architecture
Client
From: https://www.tensorflow.org/extend/architecture
Master
From: https://www.tensorflow.org/extend/architecture
Computation graph partition
From: https://www.tensorflow.org/extend/architecture
Computation graph partition
From: https://www.tensorflow.org/extend/architecture
Execution
From: https://www.tensorflow.org/extend/architecture
Fault Tolerance
Assumptions:
• Fine grain operations: “It is unlikely that tasks will fail so often that
individual operations need fault tolerance” ;-)
• “Many learning algorithms do not require strong consistency”
Solution: user-level checkpointing (provides 2 ops)
• save(): writes one or more tensors to a checkpoint file
• restore(): reads one or more tensors from a checkpoint file
Discussion
Eager vs. deferred (lazy) execution
Transparent vs. user-level fault tolerance
Easy of use
Discussion
OpenMP/Cilk MPI MapReduce / Spark
Environment,
Assumptions
Single node, multiple
core, shared memory
Supercomputers
Sophisticate programmers
High performance
Hard to scale hardware
Commodity clusters
Java programmers
Programmer productivity
Easier, faster to scale up cluster
Computation
Model
Fine-grained task
parallelism
Message passing Data flow / BSP
Strengths Simplifies parallel
programming on multi-
cores
Can write very fast
asynchronous code
Fault tolerance
Weaknesses Still pretty complex,
need to be careful
about race conditions
Fault tolerance
Easy to end up with non-
deterministic code (if not
using barriers)
Not as high performance as MPI

More Related Content

Similar to 24-TensorFlow-Clipper.pptxnjjjjnjjjjjjmm

Lecture 4: Deep Learning Frameworks
Lecture 4: Deep Learning FrameworksLecture 4: Deep Learning Frameworks
Lecture 4: Deep Learning FrameworksMohamed Loey
 
D3, TypeScript, and Deep Learning
D3, TypeScript, and Deep LearningD3, TypeScript, and Deep Learning
D3, TypeScript, and Deep LearningOswald Campesato
 
Data-Centric Parallel Programming
Data-Centric Parallel ProgrammingData-Centric Parallel Programming
Data-Centric Parallel Programminginside-BigData.com
 
Neural networks and google tensor flow
Neural networks and google tensor flowNeural networks and google tensor flow
Neural networks and google tensor flowShannon McCormick
 
C*ollege Credit: CEP Distribtued Processing on Cassandra with Storm
C*ollege Credit: CEP Distribtued Processing on Cassandra with StormC*ollege Credit: CEP Distribtued Processing on Cassandra with Storm
C*ollege Credit: CEP Distribtued Processing on Cassandra with StormDataStax
 
Neural Networks with Google TensorFlow
Neural Networks with Google TensorFlowNeural Networks with Google TensorFlow
Neural Networks with Google TensorFlowDarshan Patel
 
Abstractions and Directives for Adapting Wavefront Algorithms to Future Archi...
Abstractions and Directives for Adapting Wavefront Algorithms to Future Archi...Abstractions and Directives for Adapting Wavefront Algorithms to Future Archi...
Abstractions and Directives for Adapting Wavefront Algorithms to Future Archi...inside-BigData.com
 
Advanced Spark and TensorFlow Meetup May 26, 2016
Advanced Spark and TensorFlow Meetup May 26, 2016Advanced Spark and TensorFlow Meetup May 26, 2016
Advanced Spark and TensorFlow Meetup May 26, 2016Chris Fregly
 
Learn about Tensorflow for Deep Learning now! Part 1
Learn about Tensorflow for Deep Learning now! Part 1Learn about Tensorflow for Deep Learning now! Part 1
Learn about Tensorflow for Deep Learning now! Part 1Tyrone Systems
 
[html5jロボット部 第7回勉強会] Microsoft Cognitive Toolkit (CNTK) Overview
[html5jロボット部 第7回勉強会] Microsoft Cognitive Toolkit (CNTK) Overview[html5jロボット部 第7回勉強会] Microsoft Cognitive Toolkit (CNTK) Overview
[html5jロボット部 第7回勉強会] Microsoft Cognitive Toolkit (CNTK) OverviewNaoki (Neo) SATO
 
Options and trade offs for parallelism and concurrency in Modern C++
Options and trade offs for parallelism and concurrency in Modern C++Options and trade offs for parallelism and concurrency in Modern C++
Options and trade offs for parallelism and concurrency in Modern C++Satalia
 
Big Data Everywhere Chicago: High Performance Computing - Contributions Towar...
Big Data Everywhere Chicago: High Performance Computing - Contributions Towar...Big Data Everywhere Chicago: High Performance Computing - Contributions Towar...
Big Data Everywhere Chicago: High Performance Computing - Contributions Towar...BigDataEverywhere
 
cis97003
cis97003cis97003
cis97003perfj
 
Tensorflow in practice by Engineer - donghwi cha
Tensorflow in practice by Engineer - donghwi chaTensorflow in practice by Engineer - donghwi cha
Tensorflow in practice by Engineer - donghwi chaDonghwi Cha
 
TypeScript and Deep Learning
TypeScript and Deep LearningTypeScript and Deep Learning
TypeScript and Deep LearningOswald Campesato
 
Digital Signal Processing Lab Manual
Digital Signal Processing Lab Manual Digital Signal Processing Lab Manual
Digital Signal Processing Lab Manual Amairullah Khan Lodhi
 

Similar to 24-TensorFlow-Clipper.pptxnjjjjnjjjjjjmm (20)

Lecture 4: Deep Learning Frameworks
Lecture 4: Deep Learning FrameworksLecture 4: Deep Learning Frameworks
Lecture 4: Deep Learning Frameworks
 
D3, TypeScript, and Deep Learning
D3, TypeScript, and Deep LearningD3, TypeScript, and Deep Learning
D3, TypeScript, and Deep Learning
 
Data-Centric Parallel Programming
Data-Centric Parallel ProgrammingData-Centric Parallel Programming
Data-Centric Parallel Programming
 
Neural networks and google tensor flow
Neural networks and google tensor flowNeural networks and google tensor flow
Neural networks and google tensor flow
 
C*ollege Credit: CEP Distribtued Processing on Cassandra with Storm
C*ollege Credit: CEP Distribtued Processing on Cassandra with StormC*ollege Credit: CEP Distribtued Processing on Cassandra with Storm
C*ollege Credit: CEP Distribtued Processing on Cassandra with Storm
 
Neural Networks with Google TensorFlow
Neural Networks with Google TensorFlowNeural Networks with Google TensorFlow
Neural Networks with Google TensorFlow
 
Abstractions and Directives for Adapting Wavefront Algorithms to Future Archi...
Abstractions and Directives for Adapting Wavefront Algorithms to Future Archi...Abstractions and Directives for Adapting Wavefront Algorithms to Future Archi...
Abstractions and Directives for Adapting Wavefront Algorithms to Future Archi...
 
Advanced Spark and TensorFlow Meetup May 26, 2016
Advanced Spark and TensorFlow Meetup May 26, 2016Advanced Spark and TensorFlow Meetup May 26, 2016
Advanced Spark and TensorFlow Meetup May 26, 2016
 
Learn about Tensorflow for Deep Learning now! Part 1
Learn about Tensorflow for Deep Learning now! Part 1Learn about Tensorflow for Deep Learning now! Part 1
Learn about Tensorflow for Deep Learning now! Part 1
 
Software Security
Software SecuritySoftware Security
Software Security
 
[html5jロボット部 第7回勉強会] Microsoft Cognitive Toolkit (CNTK) Overview
[html5jロボット部 第7回勉強会] Microsoft Cognitive Toolkit (CNTK) Overview[html5jロボット部 第7回勉強会] Microsoft Cognitive Toolkit (CNTK) Overview
[html5jロボット部 第7回勉強会] Microsoft Cognitive Toolkit (CNTK) Overview
 
Options and trade offs for parallelism and concurrency in Modern C++
Options and trade offs for parallelism and concurrency in Modern C++Options and trade offs for parallelism and concurrency in Modern C++
Options and trade offs for parallelism and concurrency in Modern C++
 
Lecture_2_v2_qc.pptx
Lecture_2_v2_qc.pptxLecture_2_v2_qc.pptx
Lecture_2_v2_qc.pptx
 
Big Data Everywhere Chicago: High Performance Computing - Contributions Towar...
Big Data Everywhere Chicago: High Performance Computing - Contributions Towar...Big Data Everywhere Chicago: High Performance Computing - Contributions Towar...
Big Data Everywhere Chicago: High Performance Computing - Contributions Towar...
 
cis97003
cis97003cis97003
cis97003
 
Tensorflow in practice by Engineer - donghwi cha
Tensorflow in practice by Engineer - donghwi chaTensorflow in practice by Engineer - donghwi cha
Tensorflow in practice by Engineer - donghwi cha
 
Angular and Deep Learning
Angular and Deep LearningAngular and Deep Learning
Angular and Deep Learning
 
TypeScript and Deep Learning
TypeScript and Deep LearningTypeScript and Deep Learning
TypeScript and Deep Learning
 
Linux capacity planning
Linux capacity planningLinux capacity planning
Linux capacity planning
 
Digital Signal Processing Lab Manual
Digital Signal Processing Lab Manual Digital Signal Processing Lab Manual
Digital Signal Processing Lab Manual
 

Recently uploaded

VIP Russian Call Girls in Bhilai Deepika 8250192130 Independent Escort Servic...
VIP Russian Call Girls in Bhilai Deepika 8250192130 Independent Escort Servic...VIP Russian Call Girls in Bhilai Deepika 8250192130 Independent Escort Servic...
VIP Russian Call Girls in Bhilai Deepika 8250192130 Independent Escort Servic...Suhani Kapoor
 
VIP Call Girls Service Jamshedpur Aishwarya 8250192130 Independent Escort Ser...
VIP Call Girls Service Jamshedpur Aishwarya 8250192130 Independent Escort Ser...VIP Call Girls Service Jamshedpur Aishwarya 8250192130 Independent Escort Ser...
VIP Call Girls Service Jamshedpur Aishwarya 8250192130 Independent Escort Ser...Suhani Kapoor
 
CALL ON ➥8923113531 🔝Call Girls Husainganj Lucknow best Female service 🧳
CALL ON ➥8923113531 🔝Call Girls Husainganj Lucknow best Female service  🧳CALL ON ➥8923113531 🔝Call Girls Husainganj Lucknow best Female service  🧳
CALL ON ➥8923113531 🔝Call Girls Husainganj Lucknow best Female service 🧳anilsa9823
 
Delhi Call Girls South Delhi 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls South Delhi 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls South Delhi 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls South Delhi 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Callshivangimorya083
 
定制(UOIT学位证)加拿大安大略理工大学毕业证成绩单原版一比一
 定制(UOIT学位证)加拿大安大略理工大学毕业证成绩单原版一比一 定制(UOIT学位证)加拿大安大略理工大学毕业证成绩单原版一比一
定制(UOIT学位证)加拿大安大略理工大学毕业证成绩单原版一比一Fs sss
 
Employee of the Month - Samsung Semiconductor India Research
Employee of the Month - Samsung Semiconductor India ResearchEmployee of the Month - Samsung Semiconductor India Research
Employee of the Month - Samsung Semiconductor India ResearchSoham Mondal
 
PM Job Search Council Info Session - PMI Silver Spring Chapter
PM Job Search Council Info Session - PMI Silver Spring ChapterPM Job Search Council Info Session - PMI Silver Spring Chapter
PM Job Search Council Info Session - PMI Silver Spring ChapterHector Del Castillo, CPM, CPMM
 
VIP Call Girls in Cuttack Aarohi 8250192130 Independent Escort Service Cuttack
VIP Call Girls in Cuttack Aarohi 8250192130 Independent Escort Service CuttackVIP Call Girls in Cuttack Aarohi 8250192130 Independent Escort Service Cuttack
VIP Call Girls in Cuttack Aarohi 8250192130 Independent Escort Service CuttackSuhani Kapoor
 
Sonam +91-9537192988-Mind-blowing skills and techniques of Ahmedabad Call Girls
Sonam +91-9537192988-Mind-blowing skills and techniques of Ahmedabad Call GirlsSonam +91-9537192988-Mind-blowing skills and techniques of Ahmedabad Call Girls
Sonam +91-9537192988-Mind-blowing skills and techniques of Ahmedabad Call GirlsNiya Khan
 
(Call Girls) in Lucknow Real photos of Female Escorts 👩🏼‍❤️‍💋‍👩🏻 8923113531 ➝...
(Call Girls) in Lucknow Real photos of Female Escorts 👩🏼‍❤️‍💋‍👩🏻 8923113531 ➝...(Call Girls) in Lucknow Real photos of Female Escorts 👩🏼‍❤️‍💋‍👩🏻 8923113531 ➝...
(Call Girls) in Lucknow Real photos of Female Escorts 👩🏼‍❤️‍💋‍👩🏻 8923113531 ➝...gurkirankumar98700
 
女王大学硕士毕业证成绩单(加急办理)认证海外毕业证
女王大学硕士毕业证成绩单(加急办理)认证海外毕业证女王大学硕士毕业证成绩单(加急办理)认证海外毕业证
女王大学硕士毕业证成绩单(加急办理)认证海外毕业证obuhobo
 
VIP Call Girls in Jamshedpur Aarohi 8250192130 Independent Escort Service Jam...
VIP Call Girls in Jamshedpur Aarohi 8250192130 Independent Escort Service Jam...VIP Call Girls in Jamshedpur Aarohi 8250192130 Independent Escort Service Jam...
VIP Call Girls in Jamshedpur Aarohi 8250192130 Independent Escort Service Jam...Suhani Kapoor
 
Call Girls Mukherjee Nagar Delhi reach out to us at ☎ 9711199012
Call Girls Mukherjee Nagar Delhi reach out to us at ☎ 9711199012Call Girls Mukherjee Nagar Delhi reach out to us at ☎ 9711199012
Call Girls Mukherjee Nagar Delhi reach out to us at ☎ 9711199012rehmti665
 
The Impact of Socioeconomic Status on Education.pdf
The Impact of Socioeconomic Status on Education.pdfThe Impact of Socioeconomic Status on Education.pdf
The Impact of Socioeconomic Status on Education.pdftheknowledgereview1
 
VIP High Profile Call Girls Jamshedpur Aarushi 8250192130 Independent Escort ...
VIP High Profile Call Girls Jamshedpur Aarushi 8250192130 Independent Escort ...VIP High Profile Call Girls Jamshedpur Aarushi 8250192130 Independent Escort ...
VIP High Profile Call Girls Jamshedpur Aarushi 8250192130 Independent Escort ...Suhani Kapoor
 
定制(NYIT毕业证书)美国纽约理工学院毕业证成绩单原版一比一
定制(NYIT毕业证书)美国纽约理工学院毕业证成绩单原版一比一定制(NYIT毕业证书)美国纽约理工学院毕业证成绩单原版一比一
定制(NYIT毕业证书)美国纽约理工学院毕业证成绩单原版一比一2s3dgmej
 
Delhi Call Girls In Atta Market 9711199012 Book Your One night Stand Call Girls
Delhi Call Girls In Atta Market 9711199012 Book Your One night Stand Call GirlsDelhi Call Girls In Atta Market 9711199012 Book Your One night Stand Call Girls
Delhi Call Girls In Atta Market 9711199012 Book Your One night Stand Call Girlsshivangimorya083
 
VIP Russian Call Girls in Amravati Deepika 8250192130 Independent Escort Serv...
VIP Russian Call Girls in Amravati Deepika 8250192130 Independent Escort Serv...VIP Russian Call Girls in Amravati Deepika 8250192130 Independent Escort Serv...
VIP Russian Call Girls in Amravati Deepika 8250192130 Independent Escort Serv...Suhani Kapoor
 
NPPE STUDY GUIDE - NOV2021_study_104040.pdf
NPPE STUDY GUIDE - NOV2021_study_104040.pdfNPPE STUDY GUIDE - NOV2021_study_104040.pdf
NPPE STUDY GUIDE - NOV2021_study_104040.pdfDivyeshPatel234692
 

Recently uploaded (20)

VIP Russian Call Girls in Bhilai Deepika 8250192130 Independent Escort Servic...
VIP Russian Call Girls in Bhilai Deepika 8250192130 Independent Escort Servic...VIP Russian Call Girls in Bhilai Deepika 8250192130 Independent Escort Servic...
VIP Russian Call Girls in Bhilai Deepika 8250192130 Independent Escort Servic...
 
VIP Call Girls Service Jamshedpur Aishwarya 8250192130 Independent Escort Ser...
VIP Call Girls Service Jamshedpur Aishwarya 8250192130 Independent Escort Ser...VIP Call Girls Service Jamshedpur Aishwarya 8250192130 Independent Escort Ser...
VIP Call Girls Service Jamshedpur Aishwarya 8250192130 Independent Escort Ser...
 
CALL ON ➥8923113531 🔝Call Girls Husainganj Lucknow best Female service 🧳
CALL ON ➥8923113531 🔝Call Girls Husainganj Lucknow best Female service  🧳CALL ON ➥8923113531 🔝Call Girls Husainganj Lucknow best Female service  🧳
CALL ON ➥8923113531 🔝Call Girls Husainganj Lucknow best Female service 🧳
 
Delhi Call Girls South Delhi 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls South Delhi 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls South Delhi 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls South Delhi 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
 
定制(UOIT学位证)加拿大安大略理工大学毕业证成绩单原版一比一
 定制(UOIT学位证)加拿大安大略理工大学毕业证成绩单原版一比一 定制(UOIT学位证)加拿大安大略理工大学毕业证成绩单原版一比一
定制(UOIT学位证)加拿大安大略理工大学毕业证成绩单原版一比一
 
Employee of the Month - Samsung Semiconductor India Research
Employee of the Month - Samsung Semiconductor India ResearchEmployee of the Month - Samsung Semiconductor India Research
Employee of the Month - Samsung Semiconductor India Research
 
PM Job Search Council Info Session - PMI Silver Spring Chapter
PM Job Search Council Info Session - PMI Silver Spring ChapterPM Job Search Council Info Session - PMI Silver Spring Chapter
PM Job Search Council Info Session - PMI Silver Spring Chapter
 
VIP Call Girls in Cuttack Aarohi 8250192130 Independent Escort Service Cuttack
VIP Call Girls in Cuttack Aarohi 8250192130 Independent Escort Service CuttackVIP Call Girls in Cuttack Aarohi 8250192130 Independent Escort Service Cuttack
VIP Call Girls in Cuttack Aarohi 8250192130 Independent Escort Service Cuttack
 
Sonam +91-9537192988-Mind-blowing skills and techniques of Ahmedabad Call Girls
Sonam +91-9537192988-Mind-blowing skills and techniques of Ahmedabad Call GirlsSonam +91-9537192988-Mind-blowing skills and techniques of Ahmedabad Call Girls
Sonam +91-9537192988-Mind-blowing skills and techniques of Ahmedabad Call Girls
 
(Call Girls) in Lucknow Real photos of Female Escorts 👩🏼‍❤️‍💋‍👩🏻 8923113531 ➝...
(Call Girls) in Lucknow Real photos of Female Escorts 👩🏼‍❤️‍💋‍👩🏻 8923113531 ➝...(Call Girls) in Lucknow Real photos of Female Escorts 👩🏼‍❤️‍💋‍👩🏻 8923113531 ➝...
(Call Girls) in Lucknow Real photos of Female Escorts 👩🏼‍❤️‍💋‍👩🏻 8923113531 ➝...
 
女王大学硕士毕业证成绩单(加急办理)认证海外毕业证
女王大学硕士毕业证成绩单(加急办理)认证海外毕业证女王大学硕士毕业证成绩单(加急办理)认证海外毕业证
女王大学硕士毕业证成绩单(加急办理)认证海外毕业证
 
VIP Call Girls in Jamshedpur Aarohi 8250192130 Independent Escort Service Jam...
VIP Call Girls in Jamshedpur Aarohi 8250192130 Independent Escort Service Jam...VIP Call Girls in Jamshedpur Aarohi 8250192130 Independent Escort Service Jam...
VIP Call Girls in Jamshedpur Aarohi 8250192130 Independent Escort Service Jam...
 
Call Girls Mukherjee Nagar Delhi reach out to us at ☎ 9711199012
Call Girls Mukherjee Nagar Delhi reach out to us at ☎ 9711199012Call Girls Mukherjee Nagar Delhi reach out to us at ☎ 9711199012
Call Girls Mukherjee Nagar Delhi reach out to us at ☎ 9711199012
 
The Impact of Socioeconomic Status on Education.pdf
The Impact of Socioeconomic Status on Education.pdfThe Impact of Socioeconomic Status on Education.pdf
The Impact of Socioeconomic Status on Education.pdf
 
VIP High Profile Call Girls Jamshedpur Aarushi 8250192130 Independent Escort ...
VIP High Profile Call Girls Jamshedpur Aarushi 8250192130 Independent Escort ...VIP High Profile Call Girls Jamshedpur Aarushi 8250192130 Independent Escort ...
VIP High Profile Call Girls Jamshedpur Aarushi 8250192130 Independent Escort ...
 
Call Girls In Prashant Vihar꧁❤ 🔝 9953056974🔝❤꧂ Escort ServiCe
Call Girls In Prashant Vihar꧁❤ 🔝 9953056974🔝❤꧂ Escort ServiCeCall Girls In Prashant Vihar꧁❤ 🔝 9953056974🔝❤꧂ Escort ServiCe
Call Girls In Prashant Vihar꧁❤ 🔝 9953056974🔝❤꧂ Escort ServiCe
 
定制(NYIT毕业证书)美国纽约理工学院毕业证成绩单原版一比一
定制(NYIT毕业证书)美国纽约理工学院毕业证成绩单原版一比一定制(NYIT毕业证书)美国纽约理工学院毕业证成绩单原版一比一
定制(NYIT毕业证书)美国纽约理工学院毕业证成绩单原版一比一
 
Delhi Call Girls In Atta Market 9711199012 Book Your One night Stand Call Girls
Delhi Call Girls In Atta Market 9711199012 Book Your One night Stand Call GirlsDelhi Call Girls In Atta Market 9711199012 Book Your One night Stand Call Girls
Delhi Call Girls In Atta Market 9711199012 Book Your One night Stand Call Girls
 
VIP Russian Call Girls in Amravati Deepika 8250192130 Independent Escort Serv...
VIP Russian Call Girls in Amravati Deepika 8250192130 Independent Escort Serv...VIP Russian Call Girls in Amravati Deepika 8250192130 Independent Escort Serv...
VIP Russian Call Girls in Amravati Deepika 8250192130 Independent Escort Serv...
 
NPPE STUDY GUIDE - NOV2021_study_104040.pdf
NPPE STUDY GUIDE - NOV2021_study_104040.pdfNPPE STUDY GUIDE - NOV2021_study_104040.pdf
NPPE STUDY GUIDE - NOV2021_study_104040.pdf
 

24-TensorFlow-Clipper.pptxnjjjjnjjjjjjmm

  • 1. TensorFlow and Clipper (Lecture 24, cs262a) Ali Ghodsi and Ion Stoica, UC Berkeley April 18, 2018
  • 2. Today’s lecture Abadi et al., “TensorFlow: A System for Large-Scale Machine Learning”, OSDI 2016 (https://www.usenix.org/system/files/conference/osdi16/osdi16-abadi.pdf) Crankshaw et al., “Clipper: A Low-Latency Online Prediction Serving System”, NSDI 2017 (https://www.usenix.org/conference/nsdi17/technical- sessions/presentation/crankshaw)
  • 3. A short history of Neural Networks 1957: Perceptron (Frank Rosenblatt): one layer network neural network 1959: first neural network to solve a real world problem, i.e., eliminates echoes on phone lines (Widrow & Hoff) 1988: Backpropagation (Rumelhart, Hinton, Williams): learning a multi-layered network
  • 4. A short history of NNs 1989: ALVINN: autonomous driving car using NN (CMU) 1989: (LeCun) Successful application to recognize handwritten ZIP codes on mail using a “deep” network 2010s: near-human capabilities for image recognition, speech recognition, and language translation
  • 5. Perceptron Invented by Frank Rosenblatt (1957): simplified mathematical model of how the neurons in our brains operate From: http://www.andreykurenkov.com/writing/ai/a-brief-history-of-neural-nets-and-deep-learning/
  • 6. Perceptron Could implement AND, OR, but not XOR From: http://www.andreykurenkov.com/writing/ai/a-brief-history-of-neural-nets-and-deep-learning/
  • 7. Hidden layers Hidden layers can find features within the data and allow following layers to operate on those features • Can implement XOR From: http://www.andreykurenkov.com/writing/ai/a-brief-history-of-neural-nets-and-deep-learning/
  • 9. Context (circa 2015) Deep learning already claiming big successes From: http://www.wsdm-conference.org/2016/slides/WSDM2016-Jeff-Dean.pdfz Imagenet challenge classification task
  • 10. Context (circa 2015) Deep learning already claiming big successes Number of developers/researchers exploding A “zoo” of tools and libraries, some of questionable quality…
  • 11. What is TensorFlow? Open source library for numerical computation using data flow graphs Developed by Google Brain Team to conduct machine learning research • Based on DisBelief used internally at Google since 2011 “TensorFlow is an interface for expressing machine learning algorithms, and an implementation for executing such algorithms”
  • 12. What is TensorFlow Key idea: express a numeric computation as a graph Graph nodes are operations with any number of inputs and outputs Graph edges are tensors which flow between nodes
  • 14. Variables are stateful nodes which output their current value. State is retained across multiple executions of a graph (mostly parameters) Programming model
  • 15. Programming model Placeholders are nodes whose value is fed in at execution time (inputs, labels, …)
  • 16. Programming model Mathematical operations: MatMul: Multiply two matrices Add: Add elementwise ReLU: Activate with elementwise rectified linear function ReLu(x) = 0, x <= 0 x, x > 0
  • 17. Code import tensorflow as tf b = tf.Variable(tf.zeros((100,))) W = tf.Variable(tf.random_uniform((784, 100), -1, 1)) x = tf.placeholder(tf.float32, (1, 784)) h = tf.nn.relu(tf.matmul(x, W) + b)
  • 18. Running the graph Deploy graph with a session: a binding to a particular execution context (e.g. CPU, GPU) CPU GPU
  • 19. End-to-end So far: • Built a graph using variables and placeholders • Deploy the graph onto a session, i.e., execution environment Next: train model • Define loss function • Compute gradients
  • 20. Defining loss Use placeholder for labels Build loss node using labels and prediction prediction = tf.nn.softmax(...) #Output of neural network label = tf.placeholder(tf.float32, [100, 10]) cross_entropy = -tf.reduce_sum(label * tf.log(prediction), axis=1)
  • 21. Gradient computation: Backpropagation train_step = tf.train.GradientDescentOptimizer(0.5).minimize(cross_entropy) tf.train.GradientDescentOptimizer is an Optimizer object tf.train.GradientDescentOptimizer(lr).minimize(cross_entropy) adds optimization operation to computation graph TensorFlow graph nodes have attached gradient operations Gradient with respect to parameters computed with backpropagation … automatically
  • 22. Design Principles Dataflow graphs of primitive operators Deferred execution (two phases) 1. Define program i.e., symbolic dataflow graph w/ placeholders 2. Executes optimized version of program on set of available devices Common abstraction for heterogeneous accelerators 1. Issue a kernel for execution 2. Allocate memory for inputs and outputs 3. Transfer buffers to and from host memory
  • 23. Dynamic Flow Control Problem: support ML algos that contain conditional and iterative control flow, e.g. • Recurrent Neural Networks (RNNs) • Long-Short Term Memory (LSTM) Solution: Add conditional (if statement) and iterative (while loop) programming constructs
  • 24. TensorFlow high-level architecture Core in C++ • Very low overhead Different front ends for specifying/driving the computation • Python and C++ today, easy to add more From: http://www.wsdm-conference.org/2016/slides/WSDM2016-Jeff-Dean.pdf
  • 25. TensorFlow architecture Core in C++ • Very low overhead Different front ends for specifying/driving the computation • Python and C++ today, easy to add more From: http://www.wsdm-conference.org/2016/slides/WSDM2016-Jeff-Dean.pdf
  • 27. Key components Similar to MapReduce, Apache Hadoop, Apache Spark, … From: https://www.tensorflow.org/extend/architecture
  • 30. Computation graph partition From: https://www.tensorflow.org/extend/architecture
  • 31. Computation graph partition From: https://www.tensorflow.org/extend/architecture
  • 33. Fault Tolerance Assumptions: • Fine grain operations: “It is unlikely that tasks will fail so often that individual operations need fault tolerance” ;-) • “Many learning algorithms do not require strong consistency” Solution: user-level checkpointing (provides 2 ops) • save(): writes one or more tensors to a checkpoint file • restore(): reads one or more tensors from a checkpoint file
  • 34. Discussion Eager vs. deferred (lazy) execution Transparent vs. user-level fault tolerance Easy of use
  • 35. Discussion OpenMP/Cilk MPI MapReduce / Spark Environment, Assumptions Single node, multiple core, shared memory Supercomputers Sophisticate programmers High performance Hard to scale hardware Commodity clusters Java programmers Programmer productivity Easier, faster to scale up cluster Computation Model Fine-grained task parallelism Message passing Data flow / BSP Strengths Simplifies parallel programming on multi- cores Can write very fast asynchronous code Fault tolerance Weaknesses Still pretty complex, need to be careful about race conditions Fault tolerance Easy to end up with non- deterministic code (if not using barriers) Not as high performance as MPI

Editor's Notes

  1. 3-D graph Checklist What we want to enable What we have today How we’ll get there
  2. Neural network with one hidden layer The function we are computing is on the left. Relu is an activation function that takes the max of 0 and your input, applies a nonlinearity to your network. The graph on the right is how this function would look like in a tensorflow graph. Let us break down the nodes in the graph into three types
  3. We have two variables in this graph, the bias and W matrix. What we mean by saying that variables are stateful is that they retain their current value over multiple executions, and it’s easy to restore saved values to variables. Variables have a number of other useful features. They can be saved to disk during and after training, and gradient updates will by default apply over all the variables in your graph Variables are still operations (nodes = operations!). When you run a variable you get the value of its state. The variables in your graph are going to be your parameters
  4. The second important node type is placeholders. If you have inputs into your network that depend on some external data, you want to be able to build your graph without depending on any real values yet, as those are passed in at run time. Placeholders, unlike variables that have initial assignment, expect as arguments a data type and a shape of a tensor. Inputs, labels
  5. The other nodes are mathematical operations that you are familiar with. Matmul, addition, and relu are all operations in your graph that combine your inputs and parameters to produce new nodes.