SlideShare a Scribd company logo
1 of 15
Download to read offline
ディープラーニングを
まともに動かすために
ハードウェアの人が考えていること
情報理工学系研究科システム情報学専攻M2
上野洋典
概要
• DLの高速・高効率化のために行われていることを簡単に説明
• ハードウェアを全く知らない人向け
• 高速化のための基本の思想
• そもそもどこがボトルネックなのか
• アーキテクチャ系トップカンファの論文のお気持ちを紹介
• GANの学習を高速で行う論文
基本の思想
• 並列化
• パイプライン
• スーパースカラ
• GPU, FPGA
• メモリアクセスを抑える
• キャッシュ
• データの再利用
並列化
過去の発表資料から 「FPGA入門」
https://www.slideshare.net/DeepLearningJP2016/dl-hacksfpga
• 時間的に展開された逐次的な処理を空間的に展開して同時に処理
• コア数
• CPU(Core-i9): 18
• GPU(Tesla V100): 5120
• クロック数
• CPU: 2.6GHz (定格)
• GPU: 1.4GHz (ブースト)
メモリアクセス
• メモリアクセスはキャッシュの
50~100倍くらい時間がかかる
• HDDのI/Oとかは論外
• キャッシュが机の引き出しだとすると
(所要時間10秒)
• メモリ: 5~10分 (書斎くらい?)
• SSD I/O: 11.5日 (Amazon UK発注くらい?)
ヘネシー&パターソン コンピュータアーキテクチャ 定量的アプローチ 第5版
ディジタル回路設計とコンピュータアーキテクチャ 第2版
キャッシュの有効活用
• 一度キャッシュに乗せたデータは再利用するべき
• わざわざメモリに行かなくて済む
• 次に使いそうなデータをキャッシュに乗せる
• 右gifだと、フィルタの値は再利用されている
論文紹介
• LerGAN: A Zero-free, Low Data Movement and PIM-based
GAN Architecture
• H. Mao et al. 清華大学
• MICRO51 (2018)
• マイクロアーキテクチャ系トップカンファ
• 簡単に言うと、PIMという強いメモリ使ってDCGANの学習を
高速化
• シミュレーションで評価していい値
• 実際にチップを作ったわけではない
GANの学習
• 逆畳み込み (Transpose Convolution)に無駄が多い
• 0を詰めるせいで不要な積算が多発
• わざわざ転送する必要なし
• データフローが複雑
• GとDで2つのネットワークがある
• G, DそれぞれのBackwardに相手のForwardが必要
逆畳み込みについて
• 左下図の畳み込み演算で、フィルタの係数のうち必要なのは
𝑊1~ 𝑊4だけ
• 入力フィルタ数の分だけ𝑊1~𝑊4を掛ける演算が繰り返される
• (in_filter ∗ 4) × (out_filter)に変形
• Matrix-Multiply-Vector (MMV)にマッピング (右下図)
• 並列化!
逆畳み込みについて
• あり得るパターンも少ない
• 下図 (a)と(c)は同じ (全部で25種類)
• あらかじめ保持しておく
• ゼロを含まない形で転送・計算することで高速化
• Conv1層64cycle -> 9cycleの高速化(MMVは1cycle)
複雑なデータフロー
• ネットワーク間 (DとG) の通信が多い
• メモリアクセスがネックになりそう
• これを解消したい
PIMとは
• Processor In Memory
• (弱い)プロセッサをDRAMチップ上に載せるタイプのメモリ
• 中のプロセッサはメモリに近い = 素早くアクセスできる
• メモリの中で (簡単な) 命令を処理できる
• メモリの (より賢い) 制御が可能
• 現実的にうまみがあるのかはまだなんとも
• シミュレーションで述べられることが多い
PIMによるGANの学習
• メモリを3次元的に並べて、𝐵1~𝐵3にGを、𝐵4~𝐵6にDを展開
• 1段目はForward, 2段目は誤差伝播, 3段目はBackward
• どこが通信するかをPIMで制御
結論
• FPGA, GPUに対してそれぞれ47.2倍, 21.42倍高速に学習できた
• GPUの9.75倍低消費電力
• FPGAの1.04倍の消費電力
• 性能比では勝っている
感想
• 紹介する論文を間違った感
• そもそもPIMは反則っぽい
• 難しい
• アーキテクチャ系トップカンファを聴講した感想
• メモリアクセスを親の敵のように嫌っていた
• 理由を聞くとやっぱりそれが一番効くらしい
• MLの高速化はかなり熱い
• ソフトウェアの2~3年遅れな感じ

More Related Content

Similar to [DL Hacks]ディープラーニングを まともに動かすために ハードウェアの人が考えていること

Java EE7 䛸㻌JCache 
Java EE7 䛸㻌JCache Java EE7 䛸㻌JCache 
Java EE7 䛸㻌JCache 
maruyama097
 

Similar to [DL Hacks]ディープラーニングを まともに動かすために ハードウェアの人が考えていること (20)

CPUの同時実行機能
CPUの同時実行機能CPUの同時実行機能
CPUの同時実行機能
 
MemoryPlus Workshop
MemoryPlus WorkshopMemoryPlus Workshop
MemoryPlus Workshop
 
【2017年】ディープラーニングのフレームワーク比較
【2017年】ディープラーニングのフレームワーク比較【2017年】ディープラーニングのフレームワーク比較
【2017年】ディープラーニングのフレームワーク比較
 
Slurmのジョブスケジューリングと実装
Slurmのジョブスケジューリングと実装Slurmのジョブスケジューリングと実装
Slurmのジョブスケジューリングと実装
 
強化学習初心者が強化学習でニューラルネットワークの設計を自動化してみたい
強化学習初心者が強化学習でニューラルネットワークの設計を自動化してみたい強化学習初心者が強化学習でニューラルネットワークの設計を自動化してみたい
強化学習初心者が強化学習でニューラルネットワークの設計を自動化してみたい
 
FPGAを用いたEdge AIの現状
FPGAを用いたEdge AIの現状FPGAを用いたEdge AIの現状
FPGAを用いたEdge AIの現状
 
ICD/CPSY 201412
ICD/CPSY 201412ICD/CPSY 201412
ICD/CPSY 201412
 
Hadoop/AI基盤における考慮点、PoCの進め方、基盤構成例
Hadoop/AI基盤における考慮点、PoCの進め方、基盤構成例Hadoop/AI基盤における考慮点、PoCの進め方、基盤構成例
Hadoop/AI基盤における考慮点、PoCの進め方、基盤構成例
 
USENIX ATC '15 輪読会 Memory Session
USENIX ATC '15 輪読会 Memory SessionUSENIX ATC '15 輪読会 Memory Session
USENIX ATC '15 輪読会 Memory Session
 
ACRi_webinar_20220118_miyo
ACRi_webinar_20220118_miyoACRi_webinar_20220118_miyo
ACRi_webinar_20220118_miyo
 
Cho Bachelor Thesis
Cho Bachelor Thesis Cho Bachelor Thesis
Cho Bachelor Thesis
 
Django/Celeyを用いたデータ分析Webアプリケーションにおける非同期処理の設計と実装
Django/Celeyを用いたデータ分析Webアプリケーションにおける非同期処理の設計と実装Django/Celeyを用いたデータ分析Webアプリケーションにおける非同期処理の設計と実装
Django/Celeyを用いたデータ分析Webアプリケーションにおける非同期処理の設計と実装
 
20130126 sc12-reading
20130126 sc12-reading20130126 sc12-reading
20130126 sc12-reading
 
Kuduを調べてみた #dogenzakalt
Kuduを調べてみた #dogenzakaltKuduを調べてみた #dogenzakalt
Kuduを調べてみた #dogenzakalt
 
「NVIDIA プロファイラを用いたPyTorch学習最適化手法のご紹介(修正版)」
「NVIDIA プロファイラを用いたPyTorch学習最適化手法のご紹介(修正版)」「NVIDIA プロファイラを用いたPyTorch学習最適化手法のご紹介(修正版)」
「NVIDIA プロファイラを用いたPyTorch学習最適化手法のご紹介(修正版)」
 
産総研AIクラウドでChainerMN
産総研AIクラウドでChainerMN産総研AIクラウドでChainerMN
産総研AIクラウドでChainerMN
 
CPU / GPU高速化セミナー!性能モデルの理論と実践:実践編
CPU / GPU高速化セミナー!性能モデルの理論と実践:実践編CPU / GPU高速化セミナー!性能モデルの理論と実践:実践編
CPU / GPU高速化セミナー!性能モデルの理論と実践:実践編
 
[DL Hacks]FPGA入門
[DL Hacks]FPGA入門[DL Hacks]FPGA入門
[DL Hacks]FPGA入門
 
Tensor flow usergroup 2016 (公開版)
Tensor flow usergroup 2016 (公開版)Tensor flow usergroup 2016 (公開版)
Tensor flow usergroup 2016 (公開版)
 
Java EE7 䛸㻌JCache 
Java EE7 䛸㻌JCache Java EE7 䛸㻌JCache 
Java EE7 䛸㻌JCache 
 

More from Deep Learning JP

More from Deep Learning JP (20)

【DL輪読会】AdaptDiffuser: Diffusion Models as Adaptive Self-evolving Planners
【DL輪読会】AdaptDiffuser: Diffusion Models as Adaptive Self-evolving Planners【DL輪読会】AdaptDiffuser: Diffusion Models as Adaptive Self-evolving Planners
【DL輪読会】AdaptDiffuser: Diffusion Models as Adaptive Self-evolving Planners
 
【DL輪読会】事前学習用データセットについて
【DL輪読会】事前学習用データセットについて【DL輪読会】事前学習用データセットについて
【DL輪読会】事前学習用データセットについて
 
【DL輪読会】 "Learning to render novel views from wide-baseline stereo pairs." CVP...
【DL輪読会】 "Learning to render novel views from wide-baseline stereo pairs." CVP...【DL輪読会】 "Learning to render novel views from wide-baseline stereo pairs." CVP...
【DL輪読会】 "Learning to render novel views from wide-baseline stereo pairs." CVP...
 
【DL輪読会】Zero-Shot Dual-Lens Super-Resolution
【DL輪読会】Zero-Shot Dual-Lens Super-Resolution【DL輪読会】Zero-Shot Dual-Lens Super-Resolution
【DL輪読会】Zero-Shot Dual-Lens Super-Resolution
 
【DL輪読会】BloombergGPT: A Large Language Model for Finance arxiv
【DL輪読会】BloombergGPT: A Large Language Model for Finance arxiv【DL輪読会】BloombergGPT: A Large Language Model for Finance arxiv
【DL輪読会】BloombergGPT: A Large Language Model for Finance arxiv
 
【DL輪読会】マルチモーダル LLM
【DL輪読会】マルチモーダル LLM【DL輪読会】マルチモーダル LLM
【DL輪読会】マルチモーダル LLM
 
【 DL輪読会】ToolLLM: Facilitating Large Language Models to Master 16000+ Real-wo...
 【 DL輪読会】ToolLLM: Facilitating Large Language Models to Master 16000+ Real-wo... 【 DL輪読会】ToolLLM: Facilitating Large Language Models to Master 16000+ Real-wo...
【 DL輪読会】ToolLLM: Facilitating Large Language Models to Master 16000+ Real-wo...
 
【DL輪読会】AnyLoc: Towards Universal Visual Place Recognition
【DL輪読会】AnyLoc: Towards Universal Visual Place Recognition【DL輪読会】AnyLoc: Towards Universal Visual Place Recognition
【DL輪読会】AnyLoc: Towards Universal Visual Place Recognition
 
【DL輪読会】Can Neural Network Memorization Be Localized?
【DL輪読会】Can Neural Network Memorization Be Localized?【DL輪読会】Can Neural Network Memorization Be Localized?
【DL輪読会】Can Neural Network Memorization Be Localized?
 
【DL輪読会】Hopfield network 関連研究について
【DL輪読会】Hopfield network 関連研究について【DL輪読会】Hopfield network 関連研究について
【DL輪読会】Hopfield network 関連研究について
 
【DL輪読会】SimPer: Simple self-supervised learning of periodic targets( ICLR 2023 )
【DL輪読会】SimPer: Simple self-supervised learning of periodic targets( ICLR 2023 )【DL輪読会】SimPer: Simple self-supervised learning of periodic targets( ICLR 2023 )
【DL輪読会】SimPer: Simple self-supervised learning of periodic targets( ICLR 2023 )
 
【DL輪読会】RLCD: Reinforcement Learning from Contrast Distillation for Language M...
【DL輪読会】RLCD: Reinforcement Learning from Contrast Distillation for Language M...【DL輪読会】RLCD: Reinforcement Learning from Contrast Distillation for Language M...
【DL輪読会】RLCD: Reinforcement Learning from Contrast Distillation for Language M...
 
【DL輪読会】"Secrets of RLHF in Large Language Models Part I: PPO"
【DL輪読会】"Secrets of RLHF in Large Language Models Part I: PPO"【DL輪読会】"Secrets of RLHF in Large Language Models Part I: PPO"
【DL輪読会】"Secrets of RLHF in Large Language Models Part I: PPO"
 
【DL輪読会】"Language Instructed Reinforcement Learning for Human-AI Coordination "
【DL輪読会】"Language Instructed Reinforcement Learning  for Human-AI Coordination "【DL輪読会】"Language Instructed Reinforcement Learning  for Human-AI Coordination "
【DL輪読会】"Language Instructed Reinforcement Learning for Human-AI Coordination "
 
【DL輪読会】Llama 2: Open Foundation and Fine-Tuned Chat Models
【DL輪読会】Llama 2: Open Foundation and Fine-Tuned Chat Models【DL輪読会】Llama 2: Open Foundation and Fine-Tuned Chat Models
【DL輪読会】Llama 2: Open Foundation and Fine-Tuned Chat Models
 
【DL輪読会】"Learning Fine-Grained Bimanual Manipulation with Low-Cost Hardware"
【DL輪読会】"Learning Fine-Grained Bimanual Manipulation with Low-Cost Hardware"【DL輪読会】"Learning Fine-Grained Bimanual Manipulation with Low-Cost Hardware"
【DL輪読会】"Learning Fine-Grained Bimanual Manipulation with Low-Cost Hardware"
 
【DL輪読会】Parameter is Not All You Need:Starting from Non-Parametric Networks fo...
【DL輪読会】Parameter is Not All You Need:Starting from Non-Parametric Networks fo...【DL輪読会】Parameter is Not All You Need:Starting from Non-Parametric Networks fo...
【DL輪読会】Parameter is Not All You Need:Starting from Non-Parametric Networks fo...
 
【DL輪読会】Drag Your GAN: Interactive Point-based Manipulation on the Generative ...
【DL輪読会】Drag Your GAN: Interactive Point-based Manipulation on the Generative ...【DL輪読会】Drag Your GAN: Interactive Point-based Manipulation on the Generative ...
【DL輪読会】Drag Your GAN: Interactive Point-based Manipulation on the Generative ...
 
【DL輪読会】Self-Supervised Learning from Images with a Joint-Embedding Predictive...
【DL輪読会】Self-Supervised Learning from Images with a Joint-Embedding Predictive...【DL輪読会】Self-Supervised Learning from Images with a Joint-Embedding Predictive...
【DL輪読会】Self-Supervised Learning from Images with a Joint-Embedding Predictive...
 
【DL輪読会】Towards Understanding Ensemble, Knowledge Distillation and Self-Distil...
【DL輪読会】Towards Understanding Ensemble, Knowledge Distillation and Self-Distil...【DL輪読会】Towards Understanding Ensemble, Knowledge Distillation and Self-Distil...
【DL輪読会】Towards Understanding Ensemble, Knowledge Distillation and Self-Distil...
 

Recently uploaded

Recently uploaded (11)

新人研修 後半 2024/04/26の勉強会で発表されたものです。
新人研修 後半        2024/04/26の勉強会で発表されたものです。新人研修 後半        2024/04/26の勉強会で発表されたものです。
新人研修 後半 2024/04/26の勉強会で発表されたものです。
 
Amazon SES を勉強してみる その22024/04/26の勉強会で発表されたものです。
Amazon SES を勉強してみる その22024/04/26の勉強会で発表されたものです。Amazon SES を勉強してみる その22024/04/26の勉強会で発表されたものです。
Amazon SES を勉強してみる その22024/04/26の勉強会で発表されたものです。
 
LoRaWAN無位置ロープ型水漏れセンサー WL03A-LB/LSカタログ ファイル
LoRaWAN無位置ロープ型水漏れセンサー WL03A-LB/LSカタログ ファイルLoRaWAN無位置ロープ型水漏れセンサー WL03A-LB/LSカタログ ファイル
LoRaWAN無位置ロープ型水漏れセンサー WL03A-LB/LSカタログ ファイル
 
論文紹介: The Surprising Effectiveness of PPO in Cooperative Multi-Agent Games
論文紹介: The Surprising Effectiveness of PPO in Cooperative Multi-Agent Games論文紹介: The Surprising Effectiveness of PPO in Cooperative Multi-Agent Games
論文紹介: The Surprising Effectiveness of PPO in Cooperative Multi-Agent Games
 
LoRaWAN無位置ロープ式水漏れセンサーWL03A 日本語マニュアル
LoRaWAN無位置ロープ式水漏れセンサーWL03A 日本語マニュアルLoRaWAN無位置ロープ式水漏れセンサーWL03A 日本語マニュアル
LoRaWAN無位置ロープ式水漏れセンサーWL03A 日本語マニュアル
 
Utilizing Ballerina for Cloud Native Integrations
Utilizing Ballerina for Cloud Native IntegrationsUtilizing Ballerina for Cloud Native Integrations
Utilizing Ballerina for Cloud Native Integrations
 
LoRaWANスマート距離検出センサー DS20L カタログ LiDARデバイス
LoRaWANスマート距離検出センサー  DS20L  カタログ  LiDARデバイスLoRaWANスマート距離検出センサー  DS20L  カタログ  LiDARデバイス
LoRaWANスマート距離検出センサー DS20L カタログ LiDARデバイス
 
論文紹介:Video-GroundingDINO: Towards Open-Vocabulary Spatio-Temporal Video Groun...
論文紹介:Video-GroundingDINO: Towards Open-Vocabulary Spatio-Temporal Video Groun...論文紹介:Video-GroundingDINO: Towards Open-Vocabulary Spatio-Temporal Video Groun...
論文紹介:Video-GroundingDINO: Towards Open-Vocabulary Spatio-Temporal Video Groun...
 
論文紹介:Selective Structured State-Spaces for Long-Form Video Understanding
論文紹介:Selective Structured State-Spaces for Long-Form Video Understanding論文紹介:Selective Structured State-Spaces for Long-Form Video Understanding
論文紹介:Selective Structured State-Spaces for Long-Form Video Understanding
 
知識ゼロの営業マンでもできた!超速で初心者を脱する、悪魔的学習ステップ3選.pptx
知識ゼロの営業マンでもできた!超速で初心者を脱する、悪魔的学習ステップ3選.pptx知識ゼロの営業マンでもできた!超速で初心者を脱する、悪魔的学習ステップ3選.pptx
知識ゼロの営業マンでもできた!超速で初心者を脱する、悪魔的学習ステップ3選.pptx
 
Amazon SES を勉強してみる その32024/04/26の勉強会で発表されたものです。
Amazon SES を勉強してみる その32024/04/26の勉強会で発表されたものです。Amazon SES を勉強してみる その32024/04/26の勉強会で発表されたものです。
Amazon SES を勉強してみる その32024/04/26の勉強会で発表されたものです。
 

[DL Hacks]ディープラーニングを まともに動かすために ハードウェアの人が考えていること