Chainer MeetUp #6
2017/9/30
TensorFlow XLA
と
ハードウェア
なんで、
Chainer Meetupで
TensorFlow XLAの
お話をするのでしょうかね?
@Vengineer
ブログ : Vengineerの戯言
http://blogs.yahoo.co.jp/verification_engineer
Twitter : @Vengineer
FPGAマガジンに連載中
FPGAコミュニティ探索記
http://fpga.cqpub.co.jp/
自己紹介
SlideShare
https://www.slideshare.net/ssuser479fa3
Design Solution Forum
2017年10月13日(金)開催@新横浜
今年で4年目、毎年500名を越える来場者
絶賛、申込受付中
http://www.dsforum.jp/
「ディーブラーニングトラック」
「RISC-Vトラック」
それぞれ5講演の予定
TensorFlow XLAとは
https://www.tensorflow.org/performance/xla/
XLA(Accelerated Linear Algebra)は、TensorFlow計算を最適化
する線形代数のドメイン固有のコンパイラです。 結果として、サー
バーおよびモバイルプラットフォームでの速度、メモリ使用率、移植性
が向上します。 当初、ほとんどのユーザーはXLAの大きなメリットは
見られませんが、JIT(Just-In-Time)コンパイルや
AOT(Ahead-Of-Time)コンパイルを使用してXLAを使用することで
実験を開始できます。 新しいハードウェアアクセラレータをターゲット
とする開発者は、XLAを試すことを特にお勧めします。
原文(英語)をそのまま、Google翻訳にお願いしました。
TensorFlow w/XLA: TensorFlow, Compiled! Expressiveness with performance
https://autodiff-workshop.github.io/slides/JeffDean.pdf
XLA対応のデバイス
2017年2月20日
TensorFlow XLAの衝撃
http://blogs.yahoo.co.jp/verification_engineer/71016304.html
2017年4月21日
TensorFlow User Group ハード部 #2
TensorFlow XLAは、
中で何をやっているのか?
https://tfug-tokyo.connpass.com/event/54426/
CQ出版社インターフェース
8月号、9月号に
TensorFlow XLAのAOTについての記事を書きま
した
8月号:
衝撃的な性能UPの可能性を秘めた注目テクノロジ速報
AIをサクサク動かすGoogle新機能TensorFlow「XLA」を探る
9月号:
最新テクノロジ・マニアの挑戦 ...AIサクサク用TensorFlow XLA AOTコンパイラ探訪
初めてのGoogleソースコード!AI用コンパイラの可能性を探る
2017年8月19日
日経エレクトロニクス、2017年9月号の記事、
ソニーも参戦、深層学習ソフト 組み込み向けの開発環境で競う
日経エレクトロニクスの
   取材を受けましたよ
https://blogs.yahoo.co.jp/verification_engineer/71267571.html
2017年7月3日
TensorFlow XLAに動きあり
https://blogs.yahoo.co.jp/verification_engineer/71198977.html
2017年9月3日
Deep Learning Acceleration勉強会
TensorFlow XLAの可能性
https://blogs.yahoo.co.jp/verification_engineer/71287454.html
サンプルコードで
確認してみよう
gpu => XLA_GPU
デバイスをgpu から           
XLA_GPU に変更
def testXLA_JIT(self):
with tf.Session() as sess:
x = tf.placeholder(tf.float32, [2], name="x")
with tf.device("device:XLA_GPU:0"):
y = x * 2
  result = sess.run(y, {x: [1.5, 0.5]})
1)、Feed/Fetchノードの追加
Mul
_Recv
Const
_Send
Feed(x)
Fetch(y)
2)、Placement
Mul
_Recv
Const
_Send
cpu : Feed(x)
cpu : Fetch(y)
XLA_GPU
XLA_GPU
3)、グラフの分割
_Recv
_Send
_Send _Recv _Send
XLA_GPU
Feed(x) Fetch(y)cpu
Mul
Const
_Recv
3)、グラフの分割
_XlaLaunch
_Recv
_Recv _Send
_Send _Recv _Send
XLA_GPU
Feed(x) Fetch(y)cpu
複数Opsを_XlaLaunch Opに変換
_XlaLaunch
XLA_GPU
MulConst
gpu
ええええ、
なんで、_XlaLaunch
になっちゃうの?
どうして?
TensorFlow XLA : JITでは!
同じデバイス内で実行できるSubgraph単位の
ノードをギュギュッと1つにまとめて、
_XlaLaunch Op
内で実行する
_XlaLaunchは、
TensorFlow XLA専用のOpとして実装
_XlaLaunch Opで実装は?
・Register the new Op in a C++ file
・Implement the Op in C++
compiler/jit/kernels/xla_launch_op.h
compiler/jit/kernels/xla_launch_op.cc
TensorFlow w/XLA: TensorFlow, Compiled! Expressiveness with performance
https://autodiff-workshop.github.io/slides/JeffDean.pdf
XlaLocalLaunchOp::Computeの処理
コンパイル 実行
Plugin (r1.3)
XLA Interpreter Backend
Intel Nervana
Graphcore
もXLAをサポートするかも?
Intel® Nervana™ Graph Beta
2017-06-22
TensorFlow/XLA Support
https://www.intelnervana.com/intel-nervana-graph-and-neon-3-0-updates/
Intel® Nervana™ Graph: A Universal Tensor JIT Compiler Webinar
https://software.seek.intel.com/IntelNervanaGraphWebinar_Reg
詳細は、このWebinarの資料を見てね!
Graphcore
https://www.nextplatform.com/2017/05/08/dive-deep-learning-chip-startup-graphcores-software-stack/
TensorFlow XLAのPluginのオリジナルコードは、Graphcore
TensorFlow:Remove copyright on non-poplar files
https://github.com/tensorflow/tensorflow/commit/679152e2c13229db9386fe5c3a267e63d0093889
https://www.nextplatform.com/2017/08/23/first-depth-view-wave-computings-dpu-architecture-systems/
Wave Computing
Groq
Co-founder/CEO Doug Wightman
Google :ソフトウェア開発
Co-Founder/CTO Jonathan Ross
Google : TPU開発
COO Krishna Rangasayee
Xilinxから最近ジョイン
Alphaics
You will design, implement next generation
compiler based on Tensorflow XLA
To understand LLVM and IR mechanism to
implement compiler for custom ISA
Knowledge of Tensorflow, Theano, Microsoft cognitive
toolkit, cafee and similar framework is a plus
Prior experience in compiler design,
specifically targeted to OpenCL framework is
desired
FPGAも!
引用:Platform Development Guide,UG1164 (v2016.4) March 9, 2017, Page.8, Figure 2
Amazon EC2 F1
引用:http://www.hwclouds.com/product/fcs.html
Huawei
FPGA Accelerated Cloud Server
Amazon EC2 F1のようなもの?
Xilinx社の Virtex UltraScale+ U9P
fp1.2xlarge vCPUx8 + 1xFPGA
fp1.8xlarge vCPUx32 + 4xFPGA
fp1.32xlarge vCPUx64 + 8xFPGA
Intel Xeon + FPGA
引用
:https://01.org/sites/default/files/downloads/opae/open-programmable-acceleration-e
ngine-paper.pdf
Open Programmable Acceleration Engine (OPAE)
Intel HLS Compilerも
11月に正式リリース
他にも!
Intel募集している?
Deep Learning Computational Graph Engineer
Job Description
What you will be working on:
• Compilation of deep learning model descriptions
in multiple frameworks into efficient code for
execution in a variety of environments
• Intermediate representations and APIs to allow
new frameworks and environments to be defined
引用:http://jobs.intel.com/ShowJob/Id/1196011/Deep-Learning-Computational-Graph-Engineer/
引用:http://news.mynavi.jp/articles/2017/09/05/hotchips29_baidu/images/004.jpg
Baidu XPU
Xilinx社 Vertex Ultra+ VU9Pを使用
https://www.nextplatform.com/2017/08/24/drilling-microsofts-brainwave-soft-deep-leaning-chip/
Microsoft BrainWave
推論で、バッチサイズは、1
http://tvmlang.org/2017/08/17/tvm-release-announcement.html
MXnet-NNVM-TVM
LLVMはCPU、CUDAは別
TensorFlow XLA
と
ハードウェア
他のフレームワークではできない
いろいろなハードウェアへの対応が
できるようになるかも?
そこに注目しました!
SlideShareで公開しています
TensorFlow XLAの可能性
https://www.slideshare.net/ssuser479fa3/tensorflow-xla-78874656
TensroFlow XLA : JIT編 (r1.3版)
https://www.slideshare.net/ssuser479fa3/tensroflow-xla-jit
Intel Nervana Graph とは?
https://www.slideshare.net/ssuser479fa3/intel-nervana-graph-compiler
DSPでディープラーニング
https://www.slideshare.net/ssuser479fa3/dsp-75659146
ありがとうございました
ブログ : Vengineerの戯言
http://blogs.yahoo.co.jp/verification_engineer
Twitter : @Vengineer
Design Solution Forum
2017年10月13日(金)開催@新横浜
http://www.dsforum.jp/

TensorFlow XLA とハードウェア