JANUS: Fast and Flexible Deep Learning via Symbolic Graph Execution - - PowerPoint PPT Presentation

janus fast and flexible deep learning via symbolic graph
SMART_READER_LITE
LIVE PREVIEW

JANUS: Fast and Flexible Deep Learning via Symbolic Graph Execution - - PowerPoint PPT Presentation

JANUS: Fast and Flexible Deep Learning via Symbolic Graph Execution of Imperative Programs Eunji Jeong , Sungwoo Cho, Gyeong-In Yu, Joo Seong Jeong, Dong-Jin Shin, Byung-Gon Chun Demo 1 Introduction Challenge Solution Results Deep Neural


slide-1
SLIDE 1

JANUS: Fast and Flexible Deep Learning

via Symbolic Graph Execution of Imperative Programs

Eunji Jeong, Sungwoo Cho, Gyeong-In Yu, Joo Seong Jeong, Dong-Jin Shin, Byung-Gon Chun

1

Demo

slide-2
SLIDE 2

2

Introduction Challenge Solution Results

Images From: http://www.mdpi.com/ https://adeshpande3.github.io/A-Beginner%27s-Guide-To-Understanding-Convolutional-Neural-Networks/ Going Deeper with Convolutions, 2014, https://towardsdatascience.com/learn-how-recurrent-neural-networks-work-84e975feaaf7 Short-Term Load Forecasting Using EMD-LSTM Neural Networks with a Xgboost Algorithm for Feature Importance Evaluation, Energies 2017 https://skymind.ai/wiki/generative-adversarial-network-gan https://en.wikipedia.org/wiki/Reinforcement_learning https://medium.com/@Petuum/intro-to-dynamic-neural-networks-and-dynet-67694b18cb23

Deep Neural Networks

slide-3
SLIDE 3

Images From: http://www.mdpi.com/ https://adeshpande3.github.io/A-Beginner%27s-Guide-To-Understanding-Convolutional-Neural-Networks/ Going Deeper with Convolutions, 2014, https://towardsdatascience.com/learn-how-recurrent-neural-networks-work-84e975feaaf7 Short-Term Load Forecasting Using EMD-LSTM Neural Networks with a Xgboost Algorithm for Feature Importance Evaluation, Energies 2017 https://skymind.ai/wiki/generative-adversarial-network-gan https://en.wikipedia.org/wiki/Reinforcement_learning https://medium.com/@Petuum/intro-to-dynamic-neural-networks-and-dynet-67694b18cb23

3

Introduction Challenge Solution Results

Deep Learning (DL) Frameworks

Deep Neural Networks

slide-4
SLIDE 4

4

2.0

Introduction Challenge Solution Results

1.x

Images From: http://www.mdpi.com/ https://adeshpande3.github.io/A-Beginner%27s-Guide-To-Understanding-Convolutional-Neural-Networks/ Going Deeper with Convolutions, 2014, https://towardsdatascience.com/learn-how-recurrent-neural-networks-work-84e975feaaf7 Short-Term Load Forecasting Using EMD-LSTM Neural Networks with a Xgboost Algorithm for Feature Importance Evaluation, Energies 2017 https://skymind.ai/wiki/generative-adversarial-network-gan https://en.wikipedia.org/wiki/Reinforcement_learning https://medium.com/@Petuum/intro-to-dynamic-neural-networks-and-dynet-67694b18cb23

Symbolic DL Frameworks Imperative DL Frameworks

Deep Neural Networks

slide-5
SLIDE 5

Symbolic DL Frameworks ✓ Build a Symbolic Graph ✓ Execute the Graph

def build_graph(g): x = g.placeholder(float) linear = g.add(g.mul(W, x), b) build_graph(graph) run_graph(graph, x_data)

Imperative DL Frameworks ✓ Directly Execute the Computations

x Mul Add W b

5

def linear(x): return W * x + b linear(x_data)

2.0 1.x

Introduction Challenge Solution Results

slide-6
SLIDE 6

Symbolic DL Frameworks + Easy to Optimize

+ Compiler Optimization + Parallel Execution of Operations + Deploy on GPU, Cluster, Mobile,...

  • Decoupled View:

Hard to Program & Debug Imperative DL Frameworks + Direct Execution: Easy to Program & Debug

  • Hard to Optimize

Pros Cons

6

Introduction Challenge Solution Results

slide-7
SLIDE 7

JANUS: Combining the Best of Both Worlds

7

Imperative DL Program def foo(x): tmp = mul(3, x) return add(tmp, 2)

Transparent Conversion

Symbolic DL Graph

x Mul Add 3 2

“Easy Programmability” “High Performance”

Introduction Challenge Solution Results

slide-8
SLIDE 8

8

Introduction Challenge Solution Results Imperative DL Program with Dynamic Features

for item in sequence: state = Cell(state, item)

  • utputs += [state]

Symbolic DL Graph

?

  • Dynamic Control Flow
  • Dynamic Types
  • Impure Functions
  • ...
slide-9
SLIDE 9

9

Introduction Challenge Solution Results

Symbolic DL Graph

state Cell Switch Merge i<N Next

  • Correct
  • Slow

?

Imperative DL Program with Dynamic Features

for item in sequence: state = Cell(state, item)

  • utputs += [state]
slide-10
SLIDE 10

Symbolic DL Graph

10

Introduction Challenge Solution Results

Symbolic DL Graph

state Cell Switch Merge i<N Next

  • Correct
  • Slow
  • Fast
  • Incorrect

Cell state Cell Cell

?

Imperative DL Program with Dynamic Features

for item in sequence: state = Cell(state, item)

  • utputs += [state]
slide-11
SLIDE 11

Solution: Speculative Graph Generation and Execution

  • [Performance] Speculatively Specialize the Graph

○ Make reasonable assumptions based on the execution history (Profiling) ○ Run specialized graph (Common Case)

  • [Correctness] Validate Assumptions

○ Fallback if an assumption is broken (Rare Case)

11

Introduction Challenge Solution Results

slide-12
SLIDE 12

Imperative DL Program

for item in sequence: state = rnn(state, item)

  • utputs += [state]

Imperative Executor

Pre-defined DL Operations . Python Interpreter .

Overall Workflow on JANUS

12

Introduction Challenge Solution Results

slide-13
SLIDE 13

Imperative DL Program

for item in sequence: state = rnn(state, item)

  • utputs += [state]

Imperative Executor

Pre-defined DL Operations . Python Interpreter . Profiler len:3

13

Overall Workflow on JANUS

Introduction Challenge Solution Results

slide-14
SLIDE 14

Symbolic Graph Executor

Imperative DL Program

for item in sequence: state = rnn(state, item)

  • utputs += [state]

Symbolic DL Graph Pre-defined DL Operations . Python Interpreter .

14

Overall Workflow on JANUS

Cell state Cell Cell len == 3 ? Assert

Graph Generator len:3

Introduction Challenge Solution Results

slide-15
SLIDE 15

Cell state Cell Cell len == 3 ? Assert

Symbolic Graph Executor

Imperative DL Program

for item in sequence: state = rnn(state, item)

  • utputs += [state]

Symbolic DL Graph Pre-defined DL Operations . Python Interpreter .

15

Overall Workflow on JANUS

Assumption Failure

len:3

Introduction Challenge Solution Results

slide-16
SLIDE 16

Symbolic Graph Executor

Cell state Cell Cell len == 3 ? Assert

Imperative DL Program

for item in sequence: state = rnn(state, item)

  • utputs += [state]

Symbolic DL Graph Pre-defined DL Operations . Python Interpreter .

16

Overall Workflow on JANUS

len:3

Introduction Challenge Solution Results

slide-17
SLIDE 17

Imperative Executor

Imperative DL Program

for item in sequence: state = rnn(state, item)

  • utputs += [state]

Pre-defined DL Operations . Python Interpreter . Profiler

17

Overall Workflow on JANUS

len:?

Introduction Challenge Solution Results

slide-18
SLIDE 18

Symbolic Graph Executor

Imperative DL Program

for item in sequence: state = rnn(state, item)

  • utputs += [state]

Symbolic DL Graph Pre-defined DL Operations . Python Interpreter . Graph Generator

18

Overall Workflow on JANUS

state Cell Switch Merge i<N Next

len:?

Introduction Challenge Solution Results

slide-19
SLIDE 19

ImageNet Test Error with ResNet50

19

Imperative Symbolic

Time

JANUS

36 GPUs

3.4x Faster Convergence

Introduction Challenge Solution Results

slide-20
SLIDE 20

CNN GAN DRL TreeNN RNN

Normalized Training Throughput

20

LeNet ResNet-50 Inception-v3 LSTM LM TreeRNN TreeLSTM A3C PPO AN PIX2PIX Single Machine Imp. Symbolic 47.6x over Imperative 96.0% of Symbolic Imperative JANUS

Introduction Challenge Solution Results

slide-21
SLIDE 21

Thank You!

21