際際滷

際際滷Share a Scribd company logo
2017 TensorFlow Dev Summit
Sequence Models and the RNN API
Produced By Tae Young Lee
2017 tensor flow dev summit
伎 蠍一給れ  レ 覩語
 語
語 覈
覯
 譯殊 蠍
chatbot
Chatbot code
2017 tensor flow dev summit
2017 tensor flow dev summit
2017 tensor flow dev summit
2017 tensor flow dev summit
RNN  覦
https://github.com/macournoyer/neuralconvo
る 覲企ゼ 蠍一牛 蟆
LSTM ろ語
ル蠍 蠍一 ろ語(Long Short Term Memory networks) 覲危 ろ一
襦 覿襴暑. ろ一 リ鍵 譟伎(Vanishing Gradient) 旧   
覲 譬襯  蟆暑. ろ一 Hochreiter Schmidhuber (1997)
  螳給.
蠏碁Μ螻 危 郁規 襷   る伎螻 襴 れ給.1 ろ
 襷れ れ 譬襯 覓語れ  襷  . 蠏碁Μ螻  
一 襴 螻 給.
ろ一 リ鍵 譟伎 覓語襯 狩螻 り給. る 覲企ゼ 蠍
牛 蟆 れ ろ一 蠍磯蓋 . 覓伎瑚 覦一磯り 郁鍵覲企
.
覈  蟆暑   覦覲給 蟆暑 覈れ 螳讌. 譴 
蟆暑,  覦覲給 覈  螳 tanh 豸 螳 襷れ 螳 蟲譟磯ゼ 螳讌 蟆
.
https://docs.google.com/document/d/1M25vrmJHp21lK-
C8Xhg42zFzXke9_NrvhHBqH2qISfY/edit#
2017 tensor flow dev summit
2017 tensor flow dev summit
LSTM 旧  
れ伎願係 讓曙 糾骸 讌螳 
  殊 貉覯伎 覯
Sigmoid 豸旧 0 1 襯 豢
0 覓願 糾骸 覈詩
1 覈 糾骸
First   企 覲企ゼ 覯襴伎 蟆一 蟆
蠍(forget) 蟆危 豸汲企 覿襴 
蠏碁企 豸旧  蟆一.  豸
 ht-1螻 xt襯 覲願   Ct-1
螳 襯  0螻 1  襯 豢
. 1 願  讌,
0 願  蟇壱
Second 企 襦 覲企ゼ   ロ讌 蟆一

豌讌, (input) 蟆危 豸汲企 覿襴
  蠏碁企 豸旧 磯Μ螳 企 螳
 螳煙讌 蟆一
讌, tanh 豸旧   伎  
 襦 覲 螳れ 覯″ Ct襯 襷
. れ 螻, 磯Μ  襯 螳
 螳 襷り鍵
Third 伎 伎  Ct-1 Ct襦 螳煙
伎  Ct-1 ft襯 螻燕. ft 
襴螳  螻壱 蠍 蟆危 豢レ
. ft 磯Μ螳 蠍磯 蟆一 蟆れ 
蟆 襷 
蠏碁 れ itCt襯 . 願 螳
 螳 磯Μ螳 朱 螳煙讌 蟆一
 螳朱 蠍 覲蟆渚(scaled)  覲
螳
Four 覓伎 豢ロ讌 蟆一
豢レ   蠍磯 讌襷 螻朱
(filtered) 覯
一, sigmoid 豸旧 .
蠏 sigmoid 豸旧   企 覿覿
れ 豢ロ讌 蟆一
蠏碁 れ, 螳 -1螻 1  螳 螳
襦  襯 tanh l
蟆一 覿覿襷 豢ロ襦, tanh 豢レ
れ sigmoid 蟆危 豢リ骸 螻燕
2017 tensor flow dev summit
1
2
3
4
Topics
 Reading Sequence Data
 The RNN API
 Fully Dynamic Calculation
 Fused RNN Cells
 Dynamic Decoding
Reading and Batching
Sequence Data
1
Feeding Sequence Data
SequenceExample proto to store sequence
 Efficient storage of multiple sequence
 Per time step variable feature counts
 Efficient Parser Op
 tf.parse_single_sequence_example
 Coming soon : TensorFlow Serving First Class citizen
https://www.tensorflow.org/api_docs/python/tf/parse_single_sequence_example
2017 tensor flow dev summit
Batching Sequence Data : Static Padding
Pad each input sequence yourself, use FIFOQueue :
tf.train.batch()
https://www.tensorflow.org/api_docs/python/tf/train/batch
Batching Sequence Data : Dynamic Padding
Use Padding FIFOQueue :
tf.train.batch( dynamic_pad=True)
https://www.tensorflow.org/api_docs/python/tf/train/batch
Batching Sequence Data : Bucketing
Use N + 1 Queues with conditional enqueueing :
tf.contrib.training.bucket_by_sequence_length(. dynamic_pad=True)
https://github.com/tensorflow/tensorflow/blob/master/tensorflow/g3doc/api
_docs/python/functions_and_classes/shard8/tf.contrib.training.bucket_by_sequ
ence_length.md
Batching Sequence Data :
Truncated BPTT via State Saver
Use Barrier + Queues, you must call save_state each training step :
tf.contrib.training.batch_sequences_with_states()
https://github.com/tensorflow/tensorflow/blob/master/tensorflow/g3doc/api
_docs/python/contrib.training.md
BPTT (Backpropagation Through Time)
BPTT 蟆暑(RNN)  (譴)  螻襴讀. RNN
覈 螳 ろ 朱磯ゼ 螻旧蠍 覓語,   る螳 
覃 覈 伎 朱 殊 BPTT 企 覿給. 覦 螳 蠍語企ゼ 螳
蠍  り れ伎る, 螻 觜 譴願鍵  螻 覈 ろ 危 
襯襯 伎 讌 螻 覃豢蠍磯 .
The RNN API
Evolution and Design Decisions
2017 tensor flow dev summit
2017 tensor flow dev summit
Simple RNN
2017 tensor flow dev summit
2017 tensor flow dev summit
RNNCell
 Provide knowledge about the specific RNN architecture
 Represent a time step as a layer (c.f. Keras layers)
Keras?
Keras  る http://keras.io/  谿場覲碁.
theano tensor flow襯 伎 襯 覲企 貊 ろ 覲伎企 語ろ伎り
 覦炎係殊企 覘螳螳 襷れ伎螻 る 螳 .
るジ 語企ゼ 磯 れ 企讌 覈襯願讌襷 C++ 譯朱 伎る 襦
危願   貊螳 襷.
Keras 蠏碁 '襷' 螻  ろ 覲伎企 貊襦 theano tensor
flow襯 wrapping  れ
2017 tensor flow dev summit
2017 tensor flow dev summit
Fully Dynamic Calculation
Fast and Memory Efficient Custom Loops
Fully Dynamic Calculation
Goal : Handle sequence of unknown length
Tools :
 tf.while_loop
dynamic loops + gradients
 tf.TensorArray
dynamic Tensor slice access, gradients
https://github.com/tensorflow/tensorflow/blob/master/tensorflow/g3doc/api_do
cs/python/functions_and_classes/shard4/tf.while_loop.md
https://www.tensorflow.org/api_docs/python/tf/TensorArray
2017 tensor flow dev summit
RNN Encoder via Fully Dynamic RNN
2
2017 tensor flow dev summit
Fused RNN Cells
Optimizations for Special Cases
Type of Fusion
 XLA Fused time steps
 Manually fused time steps
 Manually fused loops
Fusion tradeoffs :
 Flexibility for Speed
 Works Everywhere to Fast on XOR(GPU, Android,)
XLA (Accelerated Linear Algebra) is a domain-specific compiler for linear algebra
that optimizes TensorFlow computations. The results are improvements in speed,
memory usage, and portability on server and mobile platforms. Initially, most
users will not see large benefits from XLA, but are welcome to experiment by
using XLA via just-in-time (JIT) compilaton or ahead-of-time (AOT) compilation.
Developers targeting new hardware accelerators are especially encouraged to try
out XLA
XLA (Accelerated Linear Algebra) TensorFlow 螻一 豕  
 覃 覲 貉危朱. 蠏 蟆郁骸 覯 覦 覈覦 弰 , 覃覈襴
 覦 伎煙 螳給. 豌 覿覿 螳 XLA  伎
 覲  讌襷 JIT (Just-In-Time) 貉危  AOT (Ahead-Of-Time) 貉危殊
牛 XLA襯  ろ   給. 襦  螳蠍磯ゼ 覈襦
螳覦 麹 XLA襯  覲企 蟆 譬給.
https://www.tensorflow.org/versions/master/experimental/xla/
2017 tensor flow dev summit
2017 tensor flow dev summit
2017 tensor flow dev summit
2017 tensor flow dev summit
Dynamic Decoding
Forthcoming API
RNN Decoder via Fully Dynamic RNN
3
Dynamic Decoder
 New OO API
 Under active development
 Base decoder library for Open Source Neural Machine
Translation tutorial (coming soon)
 tf.contrib.seq2seq
https://gist.github.com/nikitakit/6ab61a73b86c50ad88d409bac3c3d09f
http://www.slideshare.net/KeonKim/attention-mechanisms-with-tensorflow
http://www.slideshare.net/KeonKim/attention-mechanisms-with-tensorflow
Beam Search 殊 (Path-based algorithm)
Beam Search (t)襷 襷
   襷 .
) 襯  A, O 螻, 危
螻 螻 豸′ .
蠏碁Μ螻 伎 豌危襯 螳 
sequence .
 覦覯 螻螳 讌襦 螻一 蠍壱
蠍朱 讀螳覩襦, 螳螳  螳
 螳レ煙  覈覈 覲 企 蠍郁
螻一 讌. => Beam Search
Helper functions for preparing translation data.
https://www.tensorflow.org/tutorials/seq2seq
2017 tensor flow dev summit
2017 tensor flow dev summit
2017 tensor flow dev summit
Softmax
4
Softmax (碁Д)  cost function
碁Дる 企 覿襯 覓語襯   ( 覯″)襯 (螳 企る 襯)襦 覲
蠍    . 螳  讌(exp)襯 豬 , 蠏
襦  豐 1 襦 螻壱. 蠍一 襷 蠍郁覯 覓語豌
企れ 譬襯螳 譯 襷る 蠏 襯 螻壱  覓 觜 一一
. 朱 螻壱蠍  朱 螻豸旧 碁Дる NCE  襦
蠍磯 襷 蠍磯 煙 給.
noise-contrastive estimation (NCE)  襯  蟆企. 企  
襦一 覩碁Μ 蟲 tf.nn.nce_loss() 襯 伎
2017 tensor flow dev summit

More Related Content

What's hot (20)

Deep Learning Into Advance - 1. Image, ConvNet
Deep Learning Into Advance - 1. Image, ConvNetDeep Learning Into Advance - 1. Image, ConvNet
Deep Learning Into Advance - 1. Image, ConvNet
Hyojun Kim
Variational Autoencoder襯 螳讌 螳 危危蠍 (Understanding Variational Autoencod...
Variational Autoencoder襯  螳讌 螳 危危蠍 (Understanding Variational Autoencod...Variational Autoencoder襯  螳讌 螳 危危蠍 (Understanding Variational Autoencod...
Variational Autoencoder襯 螳讌 螳 危危蠍 (Understanding Variational Autoencod...
Haezoom Inc.
Ai 蠏瑚願碓
Ai 蠏瑚願碓Ai 蠏瑚願碓
Ai 蠏瑚願碓
A Beginner's guide to understanding Autoencoder
A Beginner's guide to understanding AutoencoderA Beginner's guide to understanding Autoencoder
A Beginner's guide to understanding Autoencoder
Lee Seungeun
ル 一伎襴 - RNN BERT蟾讌
ル 一伎襴 - RNN BERT蟾讌ル 一伎襴 - RNN BERT蟾讌
ル 一伎襴 - RNN BERT蟾讌
deepseaswjh
PYCON KR 2017 - 蟲襴 殊企朱 (れ)
PYCON KR 2017 - 蟲襴  殊企朱 (れ)PYCON KR 2017 - 蟲襴  殊企朱 (れ)
PYCON KR 2017 - 蟲襴 殊企朱 (れ)
Haezoom Inc.
求== 求==梶求午メ求 8
求== 求==梶求午メ求 8求== 求==梶求午メ求 8
求== 求==梶求午メ求 8
Sunggon Song
螳覦襯 螻糾碁碁 tensor-flow
螳覦襯  螻糾碁碁 tensor-flow螳覦襯  螻糾碁碁 tensor-flow
螳覦襯 螻糾碁碁 tensor-flow
瑚概 蟆暑 蟲 蟯 螳 る
瑚概 蟆暑 蟲 蟯 螳 る瑚概 蟆暑 蟲 蟯 螳 る
瑚概 蟆暑 蟲 蟯 螳 る
Woonghee Lee
Tensorflow for Deep Learning(SK Planet)
Tensorflow for Deep Learning(SK Planet)Tensorflow for Deep Learning(SK Planet)
Tensorflow for Deep Learning(SK Planet)
Tae Young Lee
REALM
REALMREALM
REALM
Hoon Heo
Sequence to Sequence Learning with Neural Networks
Sequence to Sequence Learning with Neural NetworksSequence to Sequence Learning with Neural Networks
Sequence to Sequence Learning with Neural Networks
Hoon Heo
Character-Aware Neural Language Models
Character-Aware Neural Language ModelsCharacter-Aware Neural Language Models
Character-Aware Neural Language Models
Hoon Heo
Tensorflow service & Machine Learning
Tensorflow service & Machine LearningTensorflow service & Machine Learning
Tensorflow service & Machine Learning
JEEHYUN PAIK
讌 襯 蟾螻 ル PyCon APAC 2016
讌 襯  蟾螻  ル PyCon APAC 2016讌 襯  蟾螻  ル PyCon APAC 2016
讌 襯 蟾螻 ル PyCon APAC 2016
Taehoon Kim
Machine translation survey vol2
Machine translation survey   vol2Machine translation survey   vol2
Machine translation survey vol2
gohyunwoong
Efficient Training of Bert by Progressively Stacking
Efficient Training of Bert by Progressively StackingEfficient Training of Bert by Progressively Stacking
Efficient Training of Bert by Progressively Stacking
Hoon Heo
Io17ex automl & autodraw
Io17ex automl & autodrawIo17ex automl & autodraw
Io17ex automl & autodraw
Tae Young Lee
Attention is all you need
Attention is all you needAttention is all you need
Attention is all you need
Hoon Heo
[Tf2017] day1 jwkang_pub
[Tf2017] day1 jwkang_pub[Tf2017] day1 jwkang_pub
[Tf2017] day1 jwkang_pub
Jaewook. Kang
Deep Learning Into Advance - 1. Image, ConvNet
Deep Learning Into Advance - 1. Image, ConvNetDeep Learning Into Advance - 1. Image, ConvNet
Deep Learning Into Advance - 1. Image, ConvNet
Hyojun Kim
Variational Autoencoder襯 螳讌 螳 危危蠍 (Understanding Variational Autoencod...
Variational Autoencoder襯  螳讌 螳 危危蠍 (Understanding Variational Autoencod...Variational Autoencoder襯  螳讌 螳 危危蠍 (Understanding Variational Autoencod...
Variational Autoencoder襯 螳讌 螳 危危蠍 (Understanding Variational Autoencod...
Haezoom Inc.
Ai 蠏瑚願碓
Ai 蠏瑚願碓Ai 蠏瑚願碓
Ai 蠏瑚願碓
A Beginner's guide to understanding Autoencoder
A Beginner's guide to understanding AutoencoderA Beginner's guide to understanding Autoencoder
A Beginner's guide to understanding Autoencoder
Lee Seungeun
ル 一伎襴 - RNN BERT蟾讌
ル 一伎襴 - RNN BERT蟾讌ル 一伎襴 - RNN BERT蟾讌
ル 一伎襴 - RNN BERT蟾讌
deepseaswjh
PYCON KR 2017 - 蟲襴 殊企朱 (れ)
PYCON KR 2017 - 蟲襴  殊企朱 (れ)PYCON KR 2017 - 蟲襴  殊企朱 (れ)
PYCON KR 2017 - 蟲襴 殊企朱 (れ)
Haezoom Inc.
求== 求==梶求午メ求 8
求== 求==梶求午メ求 8求== 求==梶求午メ求 8
求== 求==梶求午メ求 8
Sunggon Song
螳覦襯 螻糾碁碁 tensor-flow
螳覦襯  螻糾碁碁 tensor-flow螳覦襯  螻糾碁碁 tensor-flow
螳覦襯 螻糾碁碁 tensor-flow
瑚概 蟆暑 蟲 蟯 螳 る
瑚概 蟆暑 蟲 蟯 螳 る瑚概 蟆暑 蟲 蟯 螳 る
瑚概 蟆暑 蟲 蟯 螳 る
Woonghee Lee
Tensorflow for Deep Learning(SK Planet)
Tensorflow for Deep Learning(SK Planet)Tensorflow for Deep Learning(SK Planet)
Tensorflow for Deep Learning(SK Planet)
Tae Young Lee
Sequence to Sequence Learning with Neural Networks
Sequence to Sequence Learning with Neural NetworksSequence to Sequence Learning with Neural Networks
Sequence to Sequence Learning with Neural Networks
Hoon Heo
Character-Aware Neural Language Models
Character-Aware Neural Language ModelsCharacter-Aware Neural Language Models
Character-Aware Neural Language Models
Hoon Heo
Tensorflow service & Machine Learning
Tensorflow service & Machine LearningTensorflow service & Machine Learning
Tensorflow service & Machine Learning
JEEHYUN PAIK
讌 襯 蟾螻 ル PyCon APAC 2016
讌 襯  蟾螻  ル PyCon APAC 2016讌 襯  蟾螻  ル PyCon APAC 2016
讌 襯 蟾螻 ル PyCon APAC 2016
Taehoon Kim
Machine translation survey vol2
Machine translation survey   vol2Machine translation survey   vol2
Machine translation survey vol2
gohyunwoong
Efficient Training of Bert by Progressively Stacking
Efficient Training of Bert by Progressively StackingEfficient Training of Bert by Progressively Stacking
Efficient Training of Bert by Progressively Stacking
Hoon Heo
Io17ex automl & autodraw
Io17ex automl & autodrawIo17ex automl & autodraw
Io17ex automl & autodraw
Tae Young Lee
Attention is all you need
Attention is all you needAttention is all you need
Attention is all you need
Hoon Heo
[Tf2017] day1 jwkang_pub
[Tf2017] day1 jwkang_pub[Tf2017] day1 jwkang_pub
[Tf2017] day1 jwkang_pub
Jaewook. Kang

Similar to 2017 tensor flow dev summit (20)

LSTM ろ語 危危蠍
LSTM ろ語 危危蠍LSTM ろ語 危危蠍
LSTM ろ語 危危蠍
Mad Scientists
Auto Scalable Deep Learning Production AI Serving Infra 蟲 覦 AI DevOps...
Auto Scalable  Deep Learning Production   AI Serving Infra 蟲 覦 AI DevOps...Auto Scalable  Deep Learning Production   AI Serving Infra 蟲 覦 AI DevOps...
Auto Scalable Deep Learning Production AI Serving Infra 蟲 覦 AI DevOps...
hoondong kim
伎螻 一 5 | ル
伎螻 一 5 | ル伎螻 一 5 | ル
伎螻 一 5 | ル
蟾覯 | 覓伎誤磯伎朱
Going asynchronous with netty - SOSCON 2015
Going asynchronous with netty - SOSCON 2015Going asynchronous with netty - SOSCON 2015
Going asynchronous with netty - SOSCON 2015
Kris Jeong
Lec 00, 01
Lec 00, 01Lec 00, 01
Lec 00, 01
Jinhwan Suk
[磯襭] 蟆 讌 ろ豎_3_蟆 語 讌企 蠍一
[磯襭] 蟆 讌 ろ豎_3_蟆  語 讌企 蠍一[磯襭] 蟆 讌 ろ豎_3_蟆  語 讌企 蠍一
[磯襭] 蟆 讌 ろ豎_3_蟆 語 讌企 蠍一
MinGeun Park
C# / .NET Framework襦 覩碁 覦リ係襴 豈蟆覲伎 (Basic)
C# / .NET Framework襦 覩碁 覦リ係襴 豈蟆覲伎 (Basic)C# / .NET Framework襦 覩碁 覦リ係襴 豈蟆覲伎 (Basic)
C# / .NET Framework襦 覩碁 覦リ係襴 豈蟆覲伎 (Basic)
Dong Chan Shin
一5 | 1谿螳
一5 | 1谿螳一5 | 1谿螳
一5 | 1谿螳
蟾覯 | 覓伎誤磯伎朱
Exploring Deep Learning Acceleration Technology Embedded in LLMs
Exploring Deep Learning Acceleration Technology Embedded in LLMsExploring Deep Learning Acceleration Technology Embedded in LLMs
Exploring Deep Learning Acceleration Technology Embedded in LLMs
Tae Young Lee
llvm 螳
llvm 螳llvm 螳
llvm 螳
Minhyuk Kwon
求梶 =罪= Real-time In-memory Stream Processing 求a
求梶 =罪= Real-time In-memory Stream Processing 求a求梶 =罪= Real-time In-memory Stream Processing 求a
求梶 =罪= Real-time In-memory Stream Processing 求a
Ted Won
[2B2]求 求メ釈梶 釈求戟梶 メ午梶= メ 求メ
[2B2]求 求メ釈梶 釈求戟梶 メ午梶= メ 求メ[2B2]求 求メ釈梶 釈求戟梶 メ午梶= メ 求メ
[2B2]求 求メ釈梶 釈求戟梶 メ午梶= メ 求メ
NAVER D2
蠍壱, れ譴襷
蠍壱, れ譴襷蠍壱, れ譴襷
蠍壱, れ譴襷
xxbdxx
覦煙糾 襦蠏碁ゼ 覈 蟆螻 覿螻 給 貅覲伎 : 襦蠍一
覦煙糾 襦蠏碁ゼ 覈 蟆螻 覿螻 給 貅覲伎 : 襦蠍一覦煙糾 襦蠏碁ゼ 覈 蟆螻 覿螻 給 貅覲伎 : 襦蠍一
覦煙糾 襦蠏碁ゼ 覈 蟆螻 覿螻 給 貅覲伎 : 襦蠍一
NAVER D2
A tour of C++ : the basics
A tour of C++ : the basicsA tour of C++ : the basics
A tour of C++ : the basics
Jaewon Choi
Nvidia architecture
Nvidia architectureNvidia architecture
Nvidia architecture
Tae Young Lee
Assembly ろ磯 1
Assembly ろ磯 1Assembly ろ磯 1
Assembly ろ磯 1
J J
п1. block chain as a platform
п1. block chain as a platformп1. block chain as a platform
п1. block chain as a platform
Jay JH Park
ル Tensor flow(skt academy)
ル  Tensor flow(skt academy)ル  Tensor flow(skt academy)
ル Tensor flow(skt academy)
Tae Young Lee
[蟲] Neural Architecture Search with Reinforcement Learning
[蟲] Neural Architecture Search with Reinforcement Learning[蟲] Neural Architecture Search with Reinforcement Learning
[蟲] Neural Architecture Search with Reinforcement Learning
Kiho Suh
LSTM ろ語 危危蠍
LSTM ろ語 危危蠍LSTM ろ語 危危蠍
LSTM ろ語 危危蠍
Mad Scientists
Auto Scalable Deep Learning Production AI Serving Infra 蟲 覦 AI DevOps...
Auto Scalable  Deep Learning Production   AI Serving Infra 蟲 覦 AI DevOps...Auto Scalable  Deep Learning Production   AI Serving Infra 蟲 覦 AI DevOps...
Auto Scalable Deep Learning Production AI Serving Infra 蟲 覦 AI DevOps...
hoondong kim
Going asynchronous with netty - SOSCON 2015
Going asynchronous with netty - SOSCON 2015Going asynchronous with netty - SOSCON 2015
Going asynchronous with netty - SOSCON 2015
Kris Jeong
[磯襭] 蟆 讌 ろ豎_3_蟆 語 讌企 蠍一
[磯襭] 蟆 讌 ろ豎_3_蟆  語 讌企 蠍一[磯襭] 蟆 讌 ろ豎_3_蟆  語 讌企 蠍一
[磯襭] 蟆 讌 ろ豎_3_蟆 語 讌企 蠍一
MinGeun Park
C# / .NET Framework襦 覩碁 覦リ係襴 豈蟆覲伎 (Basic)
C# / .NET Framework襦 覩碁 覦リ係襴 豈蟆覲伎 (Basic)C# / .NET Framework襦 覩碁 覦リ係襴 豈蟆覲伎 (Basic)
C# / .NET Framework襦 覩碁 覦リ係襴 豈蟆覲伎 (Basic)
Dong Chan Shin
Exploring Deep Learning Acceleration Technology Embedded in LLMs
Exploring Deep Learning Acceleration Technology Embedded in LLMsExploring Deep Learning Acceleration Technology Embedded in LLMs
Exploring Deep Learning Acceleration Technology Embedded in LLMs
Tae Young Lee
求梶 =罪= Real-time In-memory Stream Processing 求a
求梶 =罪= Real-time In-memory Stream Processing 求a求梶 =罪= Real-time In-memory Stream Processing 求a
求梶 =罪= Real-time In-memory Stream Processing 求a
Ted Won
[2B2]求 求メ釈梶 釈求戟梶 メ午梶= メ 求メ
[2B2]求 求メ釈梶 釈求戟梶 メ午梶= メ 求メ[2B2]求 求メ釈梶 釈求戟梶 メ午梶= メ 求メ
[2B2]求 求メ釈梶 釈求戟梶 メ午梶= メ 求メ
NAVER D2
蠍壱, れ譴襷
蠍壱, れ譴襷蠍壱, れ譴襷
蠍壱, れ譴襷
xxbdxx
覦煙糾 襦蠏碁ゼ 覈 蟆螻 覿螻 給 貅覲伎 : 襦蠍一
覦煙糾 襦蠏碁ゼ 覈 蟆螻 覿螻 給 貅覲伎 : 襦蠍一覦煙糾 襦蠏碁ゼ 覈 蟆螻 覿螻 給 貅覲伎 : 襦蠍一
覦煙糾 襦蠏碁ゼ 覈 蟆螻 覿螻 給 貅覲伎 : 襦蠍一
NAVER D2
A tour of C++ : the basics
A tour of C++ : the basicsA tour of C++ : the basics
A tour of C++ : the basics
Jaewon Choi
Nvidia architecture
Nvidia architectureNvidia architecture
Nvidia architecture
Tae Young Lee
Assembly ろ磯 1
Assembly ろ磯 1Assembly ろ磯 1
Assembly ろ磯 1
J J
п1. block chain as a platform
п1. block chain as a platformп1. block chain as a platform
п1. block chain as a platform
Jay JH Park
ル Tensor flow(skt academy)
ル  Tensor flow(skt academy)ル  Tensor flow(skt academy)
ル Tensor flow(skt academy)
Tae Young Lee
[蟲] Neural Architecture Search with Reinforcement Learning
[蟲] Neural Architecture Search with Reinforcement Learning[蟲] Neural Architecture Search with Reinforcement Learning
[蟲] Neural Architecture Search with Reinforcement Learning
Kiho Suh

More from Tae Young Lee (20)

DeepSeek梶 釈 Trend (Faculty Tae Young Lee)
DeepSeek梶 釈  Trend (Faculty Tae Young Lee)DeepSeek梶 釈  Trend (Faculty Tae Young Lee)
DeepSeek梶 釈 Trend (Faculty Tae Young Lee)
Tae Young Lee
Transitioning from the Era of Big Data to LLMs_Deriving Insights
Transitioning from the Era of Big Data to LLMs_Deriving InsightsTransitioning from the Era of Big Data to LLMs_Deriving Insights
Transitioning from the Era of Big Data to LLMs_Deriving Insights
Tae Young Lee
Facebook Meta's technical direction in Large Language Models (LLMs)
Facebook Meta's technical direction in Large Language Models (LLMs)Facebook Meta's technical direction in Large Language Models (LLMs)
Facebook Meta's technical direction in Large Language Models (LLMs)
Tae Young Lee
MultiModal Embedding integrates various data types, like images, text, and au...
MultiModal Embedding integrates various data types, like images, text, and au...MultiModal Embedding integrates various data types, like images, text, and au...
MultiModal Embedding integrates various data types, like images, text, and au...
Tae Young Lee
Review of the Paper on Capabilities of Gemini Models in Medicine
Review of the Paper on Capabilities of Gemini Models in MedicineReview of the Paper on Capabilities of Gemini Models in Medicine
Review of the Paper on Capabilities of Gemini Models in Medicine
Tae Young Lee
A future that integrates LLMs and LAMs (Symposium)
A future that integrates LLMs and LAMs (Symposium)A future that integrates LLMs and LAMs (Symposium)
A future that integrates LLMs and LAMs (Symposium)
Tae Young Lee
LLMs Service that provides what users want to know
LLMs Service that provides what users want to knowLLMs Service that provides what users want to know
LLMs Service that provides what users want to know
Tae Young Lee
LLM 求= メ求 求メ =求
LLM  求= メ求 求メ =求LLM  求= メ求 求メ =求
LLM 求= メ求 求メ =求
Tae Young Lee
Recommendation System History
Recommendation System HistoryRecommendation System History
Recommendation System History
Tae Young Lee
蟆讌 ChatGPT
蟆讌  ChatGPT蟆讌  ChatGPT
蟆讌 ChatGPT
Tae Young Lee
メ戟≡求 メ釈 求午メ求 =釈メ午
メ戟≡求 メ釈 求午メ求  =釈メ午メ戟≡求 メ釈 求午メ求  =釈メ午
メ戟≡求 メ釈 求午メ求 =釈メ午
Tae Young Lee
PaLM Paper Review
PaLM Paper ReviewPaLM Paper Review
PaLM Paper Review
Tae Young Lee
The Deep Learning Compiler
The Deep Learning CompilerThe Deep Learning Compiler
The Deep Learning Compiler
Tae Young Lee
History of Vision AI
History of Vision AIHistory of Vision AI
History of Vision AI
Tae Young Lee
Aws architecture
Aws architectureAws architecture
Aws architecture
Tae Young Lee
Enhanced ai platform
Enhanced ai platformEnhanced ai platform
Enhanced ai platform
Tae Young Lee
Ai based on gpu
Ai based on gpuAi based on gpu
Ai based on gpu
Tae Young Lee
Real estate trust solution
Real estate trust solutionReal estate trust solution
Real estate trust solution
Tae Young Lee
Transfer learning usage
Transfer learning usageTransfer learning usage
Transfer learning usage
Tae Young Lee
Create a solution including deep learning models
Create a solution including deep learning modelsCreate a solution including deep learning models
Create a solution including deep learning models
Tae Young Lee
DeepSeek梶 釈 Trend (Faculty Tae Young Lee)
DeepSeek梶 釈  Trend (Faculty Tae Young Lee)DeepSeek梶 釈  Trend (Faculty Tae Young Lee)
DeepSeek梶 釈 Trend (Faculty Tae Young Lee)
Tae Young Lee
Transitioning from the Era of Big Data to LLMs_Deriving Insights
Transitioning from the Era of Big Data to LLMs_Deriving InsightsTransitioning from the Era of Big Data to LLMs_Deriving Insights
Transitioning from the Era of Big Data to LLMs_Deriving Insights
Tae Young Lee
Facebook Meta's technical direction in Large Language Models (LLMs)
Facebook Meta's technical direction in Large Language Models (LLMs)Facebook Meta's technical direction in Large Language Models (LLMs)
Facebook Meta's technical direction in Large Language Models (LLMs)
Tae Young Lee
MultiModal Embedding integrates various data types, like images, text, and au...
MultiModal Embedding integrates various data types, like images, text, and au...MultiModal Embedding integrates various data types, like images, text, and au...
MultiModal Embedding integrates various data types, like images, text, and au...
Tae Young Lee
Review of the Paper on Capabilities of Gemini Models in Medicine
Review of the Paper on Capabilities of Gemini Models in MedicineReview of the Paper on Capabilities of Gemini Models in Medicine
Review of the Paper on Capabilities of Gemini Models in Medicine
Tae Young Lee
A future that integrates LLMs and LAMs (Symposium)
A future that integrates LLMs and LAMs (Symposium)A future that integrates LLMs and LAMs (Symposium)
A future that integrates LLMs and LAMs (Symposium)
Tae Young Lee
LLMs Service that provides what users want to know
LLMs Service that provides what users want to knowLLMs Service that provides what users want to know
LLMs Service that provides what users want to know
Tae Young Lee
LLM 求= メ求 求メ =求
LLM  求= メ求 求メ =求LLM  求= メ求 求メ =求
LLM 求= メ求 求メ =求
Tae Young Lee
Recommendation System History
Recommendation System HistoryRecommendation System History
Recommendation System History
Tae Young Lee
メ戟≡求 メ釈 求午メ求 =釈メ午
メ戟≡求 メ釈 求午メ求  =釈メ午メ戟≡求 メ釈 求午メ求  =釈メ午
メ戟≡求 メ釈 求午メ求 =釈メ午
Tae Young Lee
PaLM Paper Review
PaLM Paper ReviewPaLM Paper Review
PaLM Paper Review
Tae Young Lee
The Deep Learning Compiler
The Deep Learning CompilerThe Deep Learning Compiler
The Deep Learning Compiler
Tae Young Lee
History of Vision AI
History of Vision AIHistory of Vision AI
History of Vision AI
Tae Young Lee
Enhanced ai platform
Enhanced ai platformEnhanced ai platform
Enhanced ai platform
Tae Young Lee
Real estate trust solution
Real estate trust solutionReal estate trust solution
Real estate trust solution
Tae Young Lee
Transfer learning usage
Transfer learning usageTransfer learning usage
Transfer learning usage
Tae Young Lee
Create a solution including deep learning models
Create a solution including deep learning modelsCreate a solution including deep learning models
Create a solution including deep learning models
Tae Young Lee

2017 tensor flow dev summit

  • 1. 2017 TensorFlow Dev Summit Sequence Models and the RNN API Produced By Tae Young Lee
  • 3. 伎 蠍一給れ レ 覩語
  • 4. 語 語 覈 覯 譯殊 蠍 chatbot
  • 12. LSTM ろ語 ル蠍 蠍一 ろ語(Long Short Term Memory networks) 覲危 ろ一 襦 覿襴暑. ろ一 リ鍵 譟伎(Vanishing Gradient) 旧 覲 譬襯 蟆暑. ろ一 Hochreiter Schmidhuber (1997) 螳給. 蠏碁Μ螻 危 郁規 襷 る伎螻 襴 れ給.1 ろ 襷れ れ 譬襯 覓語れ 襷 . 蠏碁Μ螻 一 襴 螻 給. ろ一 リ鍵 譟伎 覓語襯 狩螻 り給. る 覲企ゼ 蠍 牛 蟆 れ ろ一 蠍磯蓋 . 覓伎瑚 覦一磯り 郁鍵覲企 . 覈 蟆暑 覦覲給 蟆暑 覈れ 螳讌. 譴 蟆暑, 覦覲給 覈 螳 tanh 豸 螳 襷れ 螳 蟲譟磯ゼ 螳讌 蟆 . https://docs.google.com/document/d/1M25vrmJHp21lK- C8Xhg42zFzXke9_NrvhHBqH2qISfY/edit#
  • 15. LSTM 旧 れ伎願係 讓曙 糾骸 讌螳 殊 貉覯伎 覯
  • 16. Sigmoid 豸旧 0 1 襯 豢 0 覓願 糾骸 覈詩 1 覈 糾骸
  • 17. First 企 覲企ゼ 覯襴伎 蟆一 蟆 蠍(forget) 蟆危 豸汲企 覿襴 蠏碁企 豸旧 蟆一. 豸 ht-1螻 xt襯 覲願 Ct-1 螳 襯 0螻 1 襯 豢 . 1 願 讌, 0 願 蟇壱
  • 18. Second 企 襦 覲企ゼ ロ讌 蟆一 豌讌, (input) 蟆危 豸汲企 覿襴 蠏碁企 豸旧 磯Μ螳 企 螳 螳煙讌 蟆一 讌, tanh 豸旧 伎 襦 覲 螳れ 覯″ Ct襯 襷 . れ 螻, 磯Μ 襯 螳 螳 襷り鍵
  • 19. Third 伎 伎 Ct-1 Ct襦 螳煙 伎 Ct-1 ft襯 螻燕. ft 襴螳 螻壱 蠍 蟆危 豢レ . ft 磯Μ螳 蠍磯 蟆一 蟆れ 蟆 襷 蠏碁 れ itCt襯 . 願 螳 螳 磯Μ螳 朱 螳煙讌 蟆一 螳朱 蠍 覲蟆渚(scaled) 覲 螳
  • 20. Four 覓伎 豢ロ讌 蟆一 豢レ 蠍磯 讌襷 螻朱 (filtered) 覯 一, sigmoid 豸旧 . 蠏 sigmoid 豸旧 企 覿覿 れ 豢ロ讌 蟆一 蠏碁 れ, 螳 -1螻 1 螳 螳 襦 襯 tanh l 蟆一 覿覿襷 豢ロ襦, tanh 豢レ れ sigmoid 蟆危 豢リ骸 螻燕
  • 22. 1
  • 23. 2
  • 24. 3
  • 25. 4
  • 26. Topics Reading Sequence Data The RNN API Fully Dynamic Calculation Fused RNN Cells Dynamic Decoding
  • 28. 1
  • 29. Feeding Sequence Data SequenceExample proto to store sequence Efficient storage of multiple sequence Per time step variable feature counts Efficient Parser Op tf.parse_single_sequence_example Coming soon : TensorFlow Serving First Class citizen https://www.tensorflow.org/api_docs/python/tf/parse_single_sequence_example
  • 31. Batching Sequence Data : Static Padding Pad each input sequence yourself, use FIFOQueue : tf.train.batch() https://www.tensorflow.org/api_docs/python/tf/train/batch
  • 32. Batching Sequence Data : Dynamic Padding Use Padding FIFOQueue : tf.train.batch( dynamic_pad=True) https://www.tensorflow.org/api_docs/python/tf/train/batch
  • 33. Batching Sequence Data : Bucketing Use N + 1 Queues with conditional enqueueing : tf.contrib.training.bucket_by_sequence_length(. dynamic_pad=True) https://github.com/tensorflow/tensorflow/blob/master/tensorflow/g3doc/api _docs/python/functions_and_classes/shard8/tf.contrib.training.bucket_by_sequ ence_length.md
  • 34. Batching Sequence Data : Truncated BPTT via State Saver Use Barrier + Queues, you must call save_state each training step : tf.contrib.training.batch_sequences_with_states() https://github.com/tensorflow/tensorflow/blob/master/tensorflow/g3doc/api _docs/python/contrib.training.md
  • 35. BPTT (Backpropagation Through Time) BPTT 蟆暑(RNN) (譴) 螻襴讀. RNN 覈 螳 ろ 朱磯ゼ 螻旧蠍 覓語, る螳 覃 覈 伎 朱 殊 BPTT 企 覿給. 覦 螳 蠍語企ゼ 螳 蠍 り れ伎る, 螻 觜 譴願鍵 螻 覈 ろ 危 襯襯 伎 讌 螻 覃豢蠍磯 .
  • 36. The RNN API Evolution and Design Decisions
  • 42. RNNCell Provide knowledge about the specific RNN architecture Represent a time step as a layer (c.f. Keras layers) Keras? Keras る http://keras.io/ 谿場覲碁. theano tensor flow襯 伎 襯 覲企 貊 ろ 覲伎企 語ろ伎り 覦炎係殊企 覘螳螳 襷れ伎螻 る 螳 . るジ 語企ゼ 磯 れ 企讌 覈襯願讌襷 C++ 譯朱 伎る 襦 危願 貊螳 襷. Keras 蠏碁 '襷' 螻 ろ 覲伎企 貊襦 theano tensor flow襯 wrapping れ
  • 45. Fully Dynamic Calculation Fast and Memory Efficient Custom Loops
  • 46. Fully Dynamic Calculation Goal : Handle sequence of unknown length Tools : tf.while_loop dynamic loops + gradients tf.TensorArray dynamic Tensor slice access, gradients
  • 50. RNN Encoder via Fully Dynamic RNN 2
  • 52. Fused RNN Cells Optimizations for Special Cases
  • 53. Type of Fusion XLA Fused time steps Manually fused time steps Manually fused loops Fusion tradeoffs : Flexibility for Speed Works Everywhere to Fast on XOR(GPU, Android,)
  • 54. XLA (Accelerated Linear Algebra) is a domain-specific compiler for linear algebra that optimizes TensorFlow computations. The results are improvements in speed, memory usage, and portability on server and mobile platforms. Initially, most users will not see large benefits from XLA, but are welcome to experiment by using XLA via just-in-time (JIT) compilaton or ahead-of-time (AOT) compilation. Developers targeting new hardware accelerators are especially encouraged to try out XLA XLA (Accelerated Linear Algebra) TensorFlow 螻一 豕 覃 覲 貉危朱. 蠏 蟆郁骸 覯 覦 覈覦 弰 , 覃覈襴 覦 伎煙 螳給. 豌 覿覿 螳 XLA 伎 覲 讌襷 JIT (Just-In-Time) 貉危 AOT (Ahead-Of-Time) 貉危殊 牛 XLA襯 ろ 給. 襦 螳蠍磯ゼ 覈襦 螳覦 麹 XLA襯 覲企 蟆 譬給. https://www.tensorflow.org/versions/master/experimental/xla/
  • 60. RNN Decoder via Fully Dynamic RNN 3
  • 61. Dynamic Decoder New OO API Under active development Base decoder library for Open Source Neural Machine Translation tutorial (coming soon) tf.contrib.seq2seq
  • 65. Beam Search 殊 (Path-based algorithm) Beam Search (t)襷 襷 襷 . ) 襯 A, O 螻, 危 螻 螻 豸′ . 蠏碁Μ螻 伎 豌危襯 螳 sequence . 覦覯 螻螳 讌襦 螻一 蠍壱 蠍朱 讀螳覩襦, 螳螳 螳 螳レ煙 覈覈 覲 企 蠍郁 螻一 讌. => Beam Search
  • 66. Helper functions for preparing translation data. https://www.tensorflow.org/tutorials/seq2seq
  • 71. Softmax (碁Д) cost function 碁Дる 企 覿襯 覓語襯 ( 覯″)襯 (螳 企る 襯)襦 覲 蠍 . 螳 讌(exp)襯 豬 , 蠏 襦 豐 1 襦 螻壱. 蠍一 襷 蠍郁覯 覓語豌 企れ 譬襯螳 譯 襷る 蠏 襯 螻壱 覓 觜 一一 . 朱 螻壱蠍 朱 螻豸旧 碁Дる NCE 襦 蠍磯 襷 蠍磯 煙 給. noise-contrastive estimation (NCE) 襯 蟆企. 企 襦一 覩碁Μ 蟲 tf.nn.nce_loss() 襯 伎