Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Distributed Deep Newral Networks
Search
Livesense Inc.
PRO
April 11, 2017
Programming
0
72
Distributed Deep Newral Networks
ニューラルネット x 分散コンピューティング ※社内LT資料
Livesense Inc.
PRO
April 11, 2017
Tweet
Share
More Decks by Livesense Inc.
See All by Livesense Inc.
27新卒_Webエンジニア職採用_会社説明資料
livesense
PRO
0
77
株式会社リブセンス・転職会議 採用候補者様向け資料
livesense
PRO
0
14
株式会社リブセンス 会社説明資料(報道関係者様向け)
livesense
PRO
0
1.4k
データ基盤の負債解消のためのリプレイス
livesense
PRO
0
390
26新卒_総合職採用_会社説明資料
livesense
PRO
0
8.8k
株式会社リブセンス会社紹介資料 / Invent the next common.
livesense
PRO
1
27k
26新卒_Webエンジニア職採用_会社説明資料
livesense
PRO
1
12k
中途セールス職_会社説明資料
livesense
PRO
0
250
EM候補者向け転職会議説明資料
livesense
PRO
0
120
Other Decks in Programming
See All in Programming
Rubyでやりたい駆動開発 / Ruby driven development
chobishiba
1
520
deno-redisの紹介とJSRパッケージの運用について (toranoana.deno #21)
uki00a
0
160
AWS CDKの推しポイント 〜CloudFormationと比較してみた〜
akihisaikeda
3
320
アンドパッドの Go 勉強会「 gopher 会」とその内容の紹介
andpad
0
280
#kanrk08 / 公開版 PicoRubyとマイコンでの自作トレーニング計測装置を用いたワークアウトの理想と現実
bash0c7
1
660
Hypervel - A Coroutine Framework for Laravel Artisans
albertcht
1
110
たった 1 枚の PHP ファイルで実装する MCP サーバ / MCP Server with Vanilla PHP
okashoi
1
220
童醫院敏捷轉型的實踐經驗
cclai999
0
210
Kotlin エンジニアへ送る:Swift 案件に参加させられる日に備えて~似てるけど色々違う Swift の仕様 / from Kotlin to Swift
lovee
1
260
ふつうの技術スタックでアート作品を作ってみる
akira888
0
220
Java on Azure で LangGraph!
kohei3110
0
170
生成AIコーディングとの向き合い方、AIと共創するという考え方 / How to deal with generative AI coding and the concept of co-creating with AI
seike460
PRO
1
340
Featured
See All Featured
Designing for humans not robots
tammielis
253
25k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
48
5.4k
Designing for Performance
lara
609
69k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
44
2.4k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
357
30k
How to train your dragon (web standard)
notwaldorf
94
6.1k
Code Review Best Practice
trishagee
69
18k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
20
1.3k
Speed Design
sergeychernyshev
32
1k
[RailsConf 2023] Rails as a piece of cake
palkan
55
5.6k
Mobile First: as difficult as doing things right
swwweet
223
9.7k
Code Reviewing Like a Champion
maltzj
524
40k
Transcript
Distributed Deep Newral Networks 0x64 物語 reboot 第01 夜 "Network"
@yubessy
今日の話 ニュー ラルネットワー ク x 分散コンピュー ティング
Why Distributed? デー タ量の増加 テキスト < 画像 < 動画 計算量の増加
いわゆるディー プラー ニング 単一マシンの処理能力の頭打ち -> 時代は分散コンピュー ティング
分散コンピュー ティングの歩き方 分散対象: 何を分けるか そもそも分割できるのか 負荷を均等化できるか アー キテクチャ: どうつなぐか クライアント・
サー バ型 / メッシュ型 / ... 同期 / 非同期 スルー プット / レイテンシ プロトコル
深層ニュー ラルネット (DNN) 多数のレイヤを接続した有向グラフ Back Propagation (BP) 入力値に対する、 モデルの出力値と正解値の 差分を求める
差分が小さくなるよう、 出力側から順に 各レイヤのパラメー タを調整 Stochastic Gradient Descent (SGD) デー タ点を1つずつ与えながらモデルを学習
深層ニュー ラルネット (DNN) From http://joelouismarino.github.io/blog_posts/blog_googlenet_keras.html
DNN と分散処理 DNN は分散処理に向いている モデル並列化 = 計算グラフを複数の部分に分割 デー タ並列化 =
デー タを分割しノー ド毎にSGD "Large Scale Distributed Deep Networks" Dean, et al. 2012. By Google DNN のモデル / デー タ並列化両方について解説
モデル並列化 分散対象 = DNN のグラフ グラフ全体を部分グラフに分割 各部分グラフを別々 のノー ドに割り当て アー
キテクチャ = メッシュ型 元のグラフで結合されていた部分が ノー ドをまたいで通信 ボトルネック 適切に分割しないと ノー ド間のトラフィックがえらいことに
モデル並列化 Dean, et al. [1] Figure 1
デー タ並列化 分散対象 = 学習デー タ デー タをチャンクに分割 各チャンクを別々 のノー
ドに処理させる アー キテクチャ = Parameter Server (PS) 方式 PS ノー ドが各レイヤのパラメー タを保持 ワー カー ノー ドは一定量の学習を終えるごとに 非同期通信によりパラメー タを更新 ボトルネック ワー カが増えるとPS ノー ドの負荷が高くなる
デー タ並列化 Dean, et al. [1] Figure 2
Distributed TensorFlow ここまで説明した分散処理機能が 実はすでに TensorFlow に組み込まれている Distributed TensorFlow ノー ド間はgRPC
で通信
雰囲気だけ紹介
クラスタ定義 cluster = tf.train.ClusterSpec({ # ワー カー ( デー タ分散)
"worker": [ "worker0.example.com:2222", "worker1.example.com:2222", "worker2.example.com:2222" ], # パラメー タサー バ ( モデル分散) "ps": [ "ps0.example.com:2222", "ps1.example.com:2222" ]})
モデル並列化 レイヤを複数のPS に分散 # 同じPS に乗せたいパラメー タ群を tf.device でくくる with
tf.device("/job:ps/task:0"): weights_1 = tf.Variable(...) biases_1 = tf.Variable(...) # タスクの番号に応じてラウンドロビンでPS が決まる with tf.device("/job:ps/task:1"): weights_2 = tf.Variable(...) biases_2 = tf.Variable(...)
デー タ並列化 各ワー カー に同じグラフを複製 # replica_device_setter で # 複数のワー
カに同じグラフを複製 with tf.device(tf.train.replica_device_setter( worker_device="/job:worker/task:%d" % task_index, cluster=cluster)): input, labels = ... layer_1 = tf.nn.relu( tf.matmul(input, weights_1) + biases_1) logits = tf.nn.relu( tf.matmul(layer_1, weights_2) + biases_2) train_op = ...
まとめ NN は分散コンピュー ティングと相性がよい モデル並列化 / デー タ並列化 TensorFlow 最強
参考 [1] Large Scale Distributed Deep Networks [2] Distributed TensorFlow
[3] Distributed TensorFlow を試してみる [4] Distributed TensorFlow の話