tensorflow flexible, scalable, portable

35
TensorFlow Flexible, Scalable, Portable Rajat Monga Engineering Director, TensorFlow

Upload: duongliem

Post on 13-Feb-2017

229 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: TensorFlow Flexible, Scalable, Portable

TensorFlowFlexible, Scalable, Portable

Rajat MongaEngineering Director, TensorFlow

Page 2: TensorFlow Flexible, Scalable, Portable
Page 3: TensorFlow Flexible, Scalable, Portable

repositoryfor “machine learning”

category on GitHub

#1

Released in Nov. 2015

Page 4: TensorFlow Flexible, Scalable, Portable

10,000+ commits since Nov, 2015

450+ contributors

1M+ binary downloads

#20 most popular repository on GitHub by stars

Used in ML classes at many universities:Toronto, Berkeley, Stanford, ...

Some Stats

Page 5: TensorFlow Flexible, Scalable, Portable
Page 6: TensorFlow Flexible, Scalable, Portable
Page 7: TensorFlow Flexible, Scalable, Portable

TensorFlow powered Cucumber Sorter

From: http://workpiles.com/2016/02/tensorflow-cnn-cucumber/

Page 8: TensorFlow Flexible, Scalable, Portable

Flexible

Page 9: TensorFlow Flexible, Scalable, Portable
Page 10: TensorFlow Flexible, Scalable, Portable

MatMul

Add Relu

biases

weights

examples

labels

Xent

Directed graph

Page 11: TensorFlow Flexible, Scalable, Portable

Async SGD with Parameter Server

Model Workers

Parameter Server

p∆p

p’ = p - λ *∆p

Page 12: TensorFlow Flexible, Scalable, Portable

Async SGD with TensorFlow

Model Workers

PS Workers

p∆p

p’ = p - λ *∆p

Page 13: TensorFlow Flexible, Scalable, Portable

Sync SGD with TensorFlow

Model Workers

PS Workers

p∆p

delta = ∑∆pp’ = p - λ * delta

Page 14: TensorFlow Flexible, Scalable, Portable

Alternate version of Parameter sharing

Workers

Page 15: TensorFlow Flexible, Scalable, Portable

More ML Algorithms● Clustering e.g. k-means● Random Forests● Logistic Regression● Bayesian methods

Page 16: TensorFlow Flexible, Scalable, Portable

Scalable

Page 17: TensorFlow Flexible, Scalable, Portable

Deferred Execution

Operations build the dataflow graph; eval() fetches the result.

import tensorflow as tf

with tf.Session():

x = tf.constant([[5, 6], [7, 8]])

z = tf.matmul(x, x) + tf.matmul(x, [[1, 0], [0, 1]])

# Run graph to fetch z.

result = z.eval()

MatMul

const x const

MatMul

+

Page 18: TensorFlow Flexible, Scalable, Portable

Parallelism in Op implementations

MatMul

...

...

Page 19: TensorFlow Flexible, Scalable, Portable

...

...

...

...

...MatMul

MatMul

Task Parallelism in DataFlow graph

Page 20: TensorFlow Flexible, Scalable, Portable

Data Parallelism

MatMul

Input

MatMulParam

...

...MatMul

MatMul

...

...

Page 21: TensorFlow Flexible, Scalable, Portable

Model Parallelism

MatMul

Matrix

MatrixMatMul

Split Concat

Page 22: TensorFlow Flexible, Scalable, Portable

GPU 0 CPU

Add Mul

biases

learning rate

−=......

Distribution across Devices

Page 23: TensorFlow Flexible, Scalable, Portable

GPU 0 CPU

Add Mul

biases

learning rate

−=......

Distribution● TensorFlow inserts Send/Recv Ops to transport tensors across devices● Recv ops pull data from Send ops

Send Recv

Page 24: TensorFlow Flexible, Scalable, Portable

GPU 0 CPU

Add Mul

biases

learning rate

−=......

Distribution● TensorFlow inserts Send/Recv Ops to transport tensors across devices● Recv ops pull data from Send ops

Send Recv

Send Recv

Send

Recv SendRecv

Page 25: TensorFlow Flexible, Scalable, Portable

Scale across machines

Page 26: TensorFlow Flexible, Scalable, Portable

Portable

Page 27: TensorFlow Flexible, Scalable, Portable

Platforms

Page 28: TensorFlow Flexible, Scalable, Portable

TensorFlow Core Execution Engine

CPU GPU Android iOS ...

Device Abstraction

Page 29: TensorFlow Flexible, Scalable, Portable

Languages

Page 30: TensorFlow Flexible, Scalable, Portable

TensorFlow Core Execution Engine

CPU GPU Android iOS ...

Language Abstraction

C++Python ...

Page 31: TensorFlow Flexible, Scalable, Portable

Now what?

Page 32: TensorFlow Flexible, Scalable, Portable
Page 33: TensorFlow Flexible, Scalable, Portable

AutoTrash

Page 34: TensorFlow Flexible, Scalable, Portable

AutoTrash

Page 35: TensorFlow Flexible, Scalable, Portable

Rajat Monga@rajatmonga

Thank You!