Low memory RNNs... for emoji! Xavier Snelgrove , CTO & - - PowerPoint PPT Presentation

low memory rnns for emoji
SMART_READER_LITE
LIVE PREVIEW

Low memory RNNs... for emoji! Xavier Snelgrove , CTO & - - PowerPoint PPT Presentation

Low memory RNNs... for emoji! Xavier Snelgrove , CTO & Co-Founder, Whirlscape @wxswxs March 2017 Me, me, me! Me, me, me! Me, me, me! Minuum Dango http:/ /minuum.com http:/ /getdango.com Me, me, me! Minuum Dango http:/


slide-1
SLIDE 1

Xavier Snelgrove, CTO & Co-Founder, Whirlscape @wxswxs March 2017

Low memory RNNs... for emoji!

slide-2
SLIDE 2

Me, me, me!

slide-3
SLIDE 3

Me, me, me!

slide-4
SLIDE 4

Me, me, me!

Dango

http:/ /getdango.com

Minuum

http:/ /minuum.com

slide-5
SLIDE 5

Me, me, me!

Dango

http:/ /getdango.com

Minuum

http:/ /minuum.com

slide-6
SLIDE 6

Title Text

slide-7
SLIDE 7

Title Text

slide-8
SLIDE 8

Title Text

slide-9
SLIDE 9

Title Text

slide-10
SLIDE 10

Title Text

slide-11
SLIDE 11

Title Text

slide-12
SLIDE 12

Title Text

slide-13
SLIDE 13
slide-14
SLIDE 14
slide-15
SLIDE 15

With Dango

slide-16
SLIDE 16

With Dango

slide-17
SLIDE 17

With Dango

slide-18
SLIDE 18

With Dango

slide-19
SLIDE 19

With Dango

slide-20
SLIDE 20

100s of Millions of Examples

Hi prince 👒 Never mind. I forgot I’m single 😓😪 that's what I like to hear 😈❤ Highway driving in the morning 🌆👍 happy bro bro it was cool chilling with you in line for Travis gotta catch another show turn up one time🙐😝

slide-21
SLIDE 21

100s of Millions

  • f Examples
slide-22
SLIDE 22

100s of Millions

  • f Examples

GPUs crunch away for days

💮

💮

💮

slide-23
SLIDE 23

100s of Millions

  • f Examples

Trained Model

💭

💮

📛 GPUs crunch away for days

💮

💮

💮

slide-24
SLIDE 24

Let’s eat lunch later

slide-25
SLIDE 25

Let’s eat lunch later

slide-26
SLIDE 26

Let’

Let’s eat lunch later

slide-27
SLIDE 27

Let’

Let’s eat lunch later

slide-28
SLIDE 28

Let’

Let’s eat lunch later

🍵😌🍞

slide-29
SLIDE 29

Emoji in semantic-space

slide-30
SLIDE 30

How can we run this on device?

slide-31
SLIDE 31

Let’s eat lunch later

Word Embedding Recurrent Layers Dense Output Layers

slide-32
SLIDE 32

Embedding memory

the and cat yesterday eggplant . . . alchemist missspellling

slide-33
SLIDE 33

Embedding memory

the and cat yesterday eggplant . . . alchemist missspellling

}

}

512 100,000

slide-34
SLIDE 34

Embedding memory

512 100,000 4 bytes × ×

slide-35
SLIDE 35

Embedding memory

512 100,000 4 bytes × ×

=200 MB

slide-36
SLIDE 36

Embedding memory

512 100,000 4 bytes × ×

=200 MB

SQLite

slide-37
SLIDE 37

Embedding memory

512 100,000 4 bytes × ×

=200 MB

SQLite

3 bits

20 MB

Quantize

slide-38
SLIDE 38

Embedding memory

SQLite

Distribution of embedding values

Hufgman coding? Depends on quantization

slide-39
SLIDE 39

Let’s eat lunch later

Word Embedding Recurrent Layers Dense Output Layers

slide-40
SLIDE 40

Recurrent Layer Memory

Input Vector Previous State Next State

+

Output Vector

slide-41
SLIDE 41

Recurrent Layer Memory

slide-42
SLIDE 42

Recurrent Layer Memory

}

768

}

768

slide-43
SLIDE 43

Recurrent Layer Memory

768 768 4 bytes × × 3 ×

= 14MB

2 layers ×

slide-44
SLIDE 44

Recurrent Layer Memory

768 768 4 bytes × × 3 ×

= 14MB

2 layers × 2 bytes

Quantize (float16)

7MB

slide-45
SLIDE 45

Recurrent Layer Memory

Distribution of weight values

slide-46
SLIDE 46

Recurrent Layer Memory

Distribution of weight values

Many near-zero values

slide-47
SLIDE 47

Recurrent Layer Memory

slide-48
SLIDE 48

Recurrent Layer Memory

Prune 50% of weights closest to 0

slide-49
SLIDE 49

Recurrent Layer Memory

Prune 50% of weights closest to 0 Train the rest of the network

slide-50
SLIDE 50

Recurrent Layer Memory

Prune 50% of weights closest to 0 Train the rest of the network Repeat, pruning more each iteration

slide-51
SLIDE 51

Recurrent Layer Memory

Prune 50% of weights closest to 0 Train the rest of the network Repeat, pruning more each iteration

90% prune 7MB × 0.1 = 700 kB

slide-52
SLIDE 52

Recurrent Layer Memory

Prune 50% of weights closest to 0 Train the rest of the network Repeat, pruning more each iteration

90% prune 7MB × 0.1 = 700 kB

slide-53
SLIDE 53

Questions?

http:/ /getdango.com

Xavier Snelgrove, CTO & Co-Founder @wxswxs