the dark side of dnn pruning - iscaconf.org · outline motivation dnn ... – n-best: our proposal

42
Reza Yazdani Marc Riera Jose-Maria Arnau Antonio González The Dark Side of DNN Pruning 45 th International Symposium on Computer Architecture, Los Angeles, US, June 2018

Upload: nguyenkien

Post on 11-Apr-2019

222 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: The Dark Side of DNN Pruning - iscaconf.org · Outline Motivation DNN ... – N-Best: our proposal

Reza Yazdani Marc Riera Jose-Maria Arnau Antonio González

The Dark Side of DNN Pruning

45th International Symposium on Computer Architecture, Los Angeles, US, June 2018

Page 2: The Dark Side of DNN Pruning - iscaconf.org · Outline Motivation DNN ... – N-Best: our proposal

DNN Pruning● Efficient reduction of DNN size

✔ Higher performance✔ Significant energy-saving✔ Ultra-low power✔ Lower area

The Dark Side of DNN Pruning, Session 9A, Wednesday June 6th, ISCA'18 2

Page 3: The Dark Side of DNN Pruning - iscaconf.org · Outline Motivation DNN ... – N-Best: our proposal

Side-Effect of DNN Pruning● Lack of confidence in DNN classification

– Speech network of acoustic modeling

0

0.2

0.4

0.6

0.8

1

Baseline

Pruned Model

Output Class

Pro

ba

bili

ty

The Dark Side of DNN Pruning, Session 9A, Wednesday June 6th, ISCA'18 3

Page 4: The Dark Side of DNN Pruning - iscaconf.org · Outline Motivation DNN ... – N-Best: our proposal

Confidence Issue● DNN dependent applications

– Automatic Speech Recognition (ASR)

– Machine Translation

● Example: ASR evaluation for pruned DNN

0

20

40

60

80

100

120

140

0

10

20

30

40

50

60

70

80

90

100 Dnn Viterbi

WER

No

rma

lize

d D

eco

din

g T

ime

(%

)

Wo

rd-E

rro

r-R

ate

(%

)

The Dark Side of DNN Pruning, Session 9A, Wednesday June 6th, ISCA'18 4

Page 5: The Dark Side of DNN Pruning - iscaconf.org · Outline Motivation DNN ... – N-Best: our proposal

Outline● Motivation● DNN pruning & Confidence loss ● ASR using pruned DNN● Accelerator's baseline● Efficient design with DNN pruning● Experimental results● Conclusions

Page 6: The Dark Side of DNN Pruning - iscaconf.org · Outline Motivation DNN ... – N-Best: our proposal

DNN Pruning: Accuracy● Maintaining top-5 accuracy

0%

20%

40%

60%

80%

100%Top 1 Top 5

The Dark Side of DNN Pruning, Session 9A, Wednesday June 6th, ISCA'18 5

Page 7: The Dark Side of DNN Pruning - iscaconf.org · Outline Motivation DNN ... – N-Best: our proposal

Loss of Confidence ● The more the pruning rate in DNNs, the lower the

classification probability

0.5

0.55

0.6

0.65

0.7

Ave

rag

e C

on

fide

nce

The Dark Side of DNN Pruning, Session 9A, Wednesday June 6th, ISCA'18 6

Page 8: The Dark Side of DNN Pruning - iscaconf.org · Outline Motivation DNN ... – N-Best: our proposal

Outline● Motivation● DNN pruning & Confidence loss ● ASR using pruned DNN● Accelerator's baseline● Efficient design with DNN pruning● Experimental results● Conclusions

Page 9: The Dark Side of DNN Pruning - iscaconf.org · Outline Motivation DNN ... – N-Best: our proposal

ASR● ASR systems include two phases

– DNN: computes probabilities of different phonemes at each frame

Frame i

The Dark Side of DNN Pruning, Session 9A, Wednesday June 6th, ISCA'18 7

Page 10: The Dark Side of DNN Pruning - iscaconf.org · Outline Motivation DNN ... – N-Best: our proposal

ASR● ASR systems include two phases

– DNN: computes probabilities of different phonemes at each frame

Frame i

HiddenLayers

.

n . .

.

. m.

DNN

The Dark Side of DNN Pruning, Session 9A, Wednesday June 6th, ISCA'18 7

Page 11: The Dark Side of DNN Pruning - iscaconf.org · Outline Motivation DNN ... – N-Best: our proposal

ASR● ASR systems include two phases

– DNN: computes probabilities of different phonemes at each frame

Frame i

HiddenLayers

.

n . .

.

. m.

DNN

0

0.2

0.4

0.6

0.8

1

Output Class

DN

N S

core

The Dark Side of DNN Pruning, Session 9A, Wednesday June 6th, ISCA'18 7

Page 12: The Dark Side of DNN Pruning - iscaconf.org · Outline Motivation DNN ... – N-Best: our proposal

ASR● ASR systems include two phases

– DNN: computes probabilities of different phonemes at each frame

– Viterbi search: explores WFST based on DNN scores

Frame 0 Frame 1 Frame 2

S1

S2

S1

S2

S2

S3

S4

......

...

...

...

...

The Dark Side of DNN Pruning, Session 9A, Wednesday June 6th, ISCA'18 7

Page 13: The Dark Side of DNN Pruning - iscaconf.org · Outline Motivation DNN ... – N-Best: our proposal

ASR Evaluation● Viterbi search under pruned DNN model

Frame 2 DNN Scores of Frame 2

The Dark Side of DNN Pruning, Session 9A, Wednesday June 6th, ISCA'18 8

Page 14: The Dark Side of DNN Pruning - iscaconf.org · Outline Motivation DNN ... – N-Best: our proposal

ASR Evaluation● Viterbi search under pruned DNN model

DNN Scores of Frame 2Frame 2

The Dark Side of DNN Pruning, Session 9A, Wednesday June 6th, ISCA'18 8

Page 15: The Dark Side of DNN Pruning - iscaconf.org · Outline Motivation DNN ... – N-Best: our proposal

Viterbi Workload● Increase in Viterbi's search activity

The Dark Side of DNN Pruning, Session 9A, Wednesday June 6th, ISCA'18 9

Page 16: The Dark Side of DNN Pruning - iscaconf.org · Outline Motivation DNN ... – N-Best: our proposal

Outline● Motivation● DNN pruning & Confidence loss ● ASR using pruned DNN● Accelerator's baseline● Efficient design with DNN pruning● Experimental results● Conclusions

Page 17: The Dark Side of DNN Pruning - iscaconf.org · Outline Motivation DNN ... – N-Best: our proposal

Hardware Baseline● UNFOLD: state-of-the-art Viterbi accelerator

The Dark Side of DNN Pruning, Session 9A, Wednesday June 6th, ISCA'18 10

Page 18: The Dark Side of DNN Pruning - iscaconf.org · Outline Motivation DNN ... – N-Best: our proposal

Hardware Baseline● UNFOLD: state-of-the-art Viterbi accelerator

st0

st1

The Dark Side of DNN Pruning, Session 9A, Wednesday June 6th, ISCA'18 10

Page 19: The Dark Side of DNN Pruning - iscaconf.org · Outline Motivation DNN ... – N-Best: our proposal

Hardware Baseline● UNFOLD: state-of-the-art Viterbi accelerator

st0

st1

10

Page 20: The Dark Side of DNN Pruning - iscaconf.org · Outline Motivation DNN ... – N-Best: our proposal

Hardware Baseline● UNFOLD: state-of-the-art Viterbi accelerator

st0

st1

The Dark Side of DNN Pruning, Session 9A, Wednesday June 6th, ISCA'18 10

Page 21: The Dark Side of DNN Pruning - iscaconf.org · Outline Motivation DNN ... – N-Best: our proposal

Hardware Baseline● UNFOLD: state-of-the-art Viterbi accelerator

st0

st1

0.00015

0.31

0.0014

0.0002

0.00005

Likelihoods

The Dark Side of DNN Pruning, Session 9A, Wednesday June 6th, ISCA'18 10

Page 22: The Dark Side of DNN Pruning - iscaconf.org · Outline Motivation DNN ... – N-Best: our proposal

Hardware Baseline● UNFOLD: state-of-the-art Viterbi accelerator

st0

st1

Likelihoods

0.00015

0.31

0.0014

0.0002

0.00005

The Dark Side of DNN Pruning, Session 9A, Wednesday June 6th, ISCA'18 10

Page 23: The Dark Side of DNN Pruning - iscaconf.org · Outline Motivation DNN ... – N-Best: our proposal

Hardware Baseline● UNFOLD: state-of-the-art Viterbi accelerator

Hash Bottlenecks

Collision handling● Backup buffer

Overflows● Overflow buffer

Access delay● Backup ● Overflow

The Dark Side of DNN Pruning, Session 9A, Wednesday June 6th, ISCA'18 10

Page 24: The Dark Side of DNN Pruning - iscaconf.org · Outline Motivation DNN ... – N-Best: our proposal

Outline● Motivation● DNN pruning & Confidence loss ● ASR using pruned DNN● Accelerator's baseline● Efficient design with DNN pruning● Experimental results● Conclusions

Page 25: The Dark Side of DNN Pruning - iscaconf.org · Outline Motivation DNN ... – N-Best: our proposal

Efficient Hash Design● Keeping the best N hypotheses at each frame

– Known as Histogram Pruning

The Dark Side of DNN Pruning, Session 9A, Wednesday June 6th, ISCA'18 11

Page 26: The Dark Side of DNN Pruning - iscaconf.org · Outline Motivation DNN ... – N-Best: our proposal

Efficient Hash Design● Keeping the best N hypotheses at each frame

– Known as Histogram Pruning● Implementation issue

– Sorting tokens at every frame– Expensive: O(m*log(m)) for m hypotheses

The Dark Side of DNN Pruning, Session 9A, Wednesday June 6th, ISCA'18 11

Page 27: The Dark Side of DNN Pruning - iscaconf.org · Outline Motivation DNN ... – N-Best: our proposal

Efficient Hash Design● Keeping the best N hypotheses at each frame

– Known as Histogram Pruning● Implementation issue

– Sorting tokens at every frame– Expensive: O(m*log(m)) for m hypotheses

● Our scheme

– Loosely keeping N-best using hash mechanism

The Dark Side of DNN Pruning, Session 9A, Wednesday June 6th, ISCA'18 11

Page 28: The Dark Side of DNN Pruning - iscaconf.org · Outline Motivation DNN ... – N-Best: our proposal

Efficient Hash Design● Direct-mapped

The Dark Side of DNN Pruning, Session 9A, Wednesday June 6th, ISCA'18 12

Page 29: The Dark Side of DNN Pruning - iscaconf.org · Outline Motivation DNN ... – N-Best: our proposal

Efficient Hash Design● Direct-mapped● Way-Associative

The Dark Side of DNN Pruning, Session 9A, Wednesday June 6th, ISCA'18 12

Page 30: The Dark Side of DNN Pruning - iscaconf.org · Outline Motivation DNN ... – N-Best: our proposal

Efficient Hash Design● Our scheme efficiency

The Dark Side of DNN Pruning, Session 9A, Wednesday June 6th, ISCA'18 13

Page 31: The Dark Side of DNN Pruning - iscaconf.org · Outline Motivation DNN ... – N-Best: our proposal

Efficient Hash Design● Way-associative main challenge

– Replace when set is full

– Finding hypothesis with max cost

The Dark Side of DNN Pruning, Session 9A, Wednesday June 6th, ISCA'18 14

Page 32: The Dark Side of DNN Pruning - iscaconf.org · Outline Motivation DNN ... – N-Best: our proposal

Efficient Hash Design● Way-associative main challenge

– Replace when set is full

– Finding hypothesis with max cost

● Our solution– Store index of each set based on max-heap

– Replace with the root of tree

– Updating max-heap fits in one cycle

The Dark Side of DNN Pruning, Session 9A, Wednesday June 6th, ISCA'18 14

Page 33: The Dark Side of DNN Pruning - iscaconf.org · Outline Motivation DNN ... – N-Best: our proposal

Outline● Motivation● DNN pruning & Confidence loss ● ASR using pruned DNN● Accelerator's baseline● Efficient design with DNN pruning● Experimental results● Conclusions

Page 34: The Dark Side of DNN Pruning - iscaconf.org · Outline Motivation DNN ... – N-Best: our proposal

Evaluation Methodology● Cycle-accurate simulation of DNN and Viterbi

● Model accelerator's components in hardware

– Verilog implementation of logic parts

– Synthesized by design compiler

– Cacti: Cache and memory components

– Micron: main memory● Combine simulation results with hardware models

– Decoding time

– Decoding power and energy consumption

– Accelerator's area usage

The Dark Side of DNN Pruning, Session 9A, Wednesday June 6th, ISCA'18 15

Page 35: The Dark Side of DNN Pruning - iscaconf.org · Outline Motivation DNN ... – N-Best: our proposal

Accelerator's Parameters● DNN and Viterbi accelerators

The Dark Side of DNN Pruning, Session 9A, Wednesday June 6th, ISCA'18 16

Page 36: The Dark Side of DNN Pruning - iscaconf.org · Outline Motivation DNN ... – N-Best: our proposal

Experiment Configs● Viterbi Search:

– Baseline: Unfold's design

– Beam: reduce beam without changing baseline

– N-Best: our proposal

● DNN:– Non-pruned version

– Pruned version: 70%, 80% and 90% pruning

The Dark Side of DNN Pruning, Session 9A, Wednesday June 6th, ISCA'18 17

Page 37: The Dark Side of DNN Pruning - iscaconf.org · Outline Motivation DNN ... – N-Best: our proposal

Experimental Results● Decoding time

The Dark Side of DNN Pruning, Session 9A, Wednesday June 6th, ISCA'18 18

Page 38: The Dark Side of DNN Pruning - iscaconf.org · Outline Motivation DNN ... – N-Best: our proposal

Experimental Results● Decoding time● Energy consumption

The Dark Side of DNN Pruning, Session 9A, Wednesday June 6th, ISCA'18 18

Page 39: The Dark Side of DNN Pruning - iscaconf.org · Outline Motivation DNN ... – N-Best: our proposal

Experimental Results● Decoding time● Energy consumption● Area usage: 10.74 mm2 (2x reduction)

The Dark Side of DNN Pruning, Session 9A, Wednesday June 6th, ISCA'18 18

Page 40: The Dark Side of DNN Pruning - iscaconf.org · Outline Motivation DNN ... – N-Best: our proposal

Outline● Motivation● DNN pruning & Confidence loss ● ASR using pruned DNN● Accelerator's baseline● Efficient design with DNN pruning● Experimental results● Conclusions

Page 41: The Dark Side of DNN Pruning - iscaconf.org · Outline Motivation DNN ... – N-Best: our proposal

Conclusions● Major side effect of DNN pruning

– Confidence loss: top-1's low likelihood

● DNN pruning in ASR systems– 20% confidence loss, 33% slowdown

● Our solution: A novel Viterbi accelerator– Resilient to DNN pruning

– Less search activity while maintaining accuracy● Compared to state-of-art ASR accelerated system

– 9x energy-saving, 4.5x speedup, 2x area reduction

The Dark Side of DNN Pruning, Session 9A, Wednesday June 6th, ISCA'18 19

Page 42: The Dark Side of DNN Pruning - iscaconf.org · Outline Motivation DNN ... – N-Best: our proposal

Reza Yazdani Marc Riera Jose-Maria Arnau Antonio González

The Dark Side of DNN Pruning

45th International Symposium on Computer Architecture, Los Angeles, US, June 2018