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
tesorflow-v1.0-on-ec2
Search
ryo nakamaru
February 20, 2017
Programming
1
640
tesorflow-v1.0-on-ec2
MaruLabo × JAWS-UG AI 支部 #2 用の資料です
ryo nakamaru
February 20, 2017
Tweet
Share
More Decks by ryo nakamaru
See All by ryo nakamaru
AWSで楽をするサービスメッシュ入門/appmesh-trial
pottava
1
1.3k
reinforce-2019-recap-lt
pottava
2
4.1k
ScaleShift-jp-2019-summer
pottava
1
190
Firecracker とは何か/what is Firecracker
pottava
13
5.2k
ハイブリッド並列 on Kubernetes/hybrid-parallel-program-on-kubernetes
pottava
1
400
AWS Fargate + Code 兄弟で始める継続的デリバリー / Continuous Delivery with AWS Fargate and Code brothers
pottava
12
3k
Singularity と NVIDIA GPU Cloud で作る ハイブリッド機械学習環境の構築 / Building a hybrid environment for Machine Learning with Singularity and NGC
pottava
3
1.2k
明日から始めるちょい足し λ / get-started-with-aws-lambda
pottava
4
2.4k
NGC と Singularity によるハイブリッド機械学習環境 / A hybrid environment for Machine Learning with NGC and Singularity
pottava
0
450
Other Decks in Programming
See All in Programming
Re:PandasAI:生成AIがデータ分析業務にもたらすパラダイムシフト【増補改訂版】
negi111111
1
1.1k
Micro Frontends for Java Microservices - dev2next 2024
mraible
PRO
0
210
The Efficiency Paradox and How to Save Yourself and the World
hollycummins
0
190
モジュラモノリス、その前に / Modular monolith, before that
euglena1215
7
720
色んなオートローダーを覗き見る #phpcon_okinawa
o0h
PRO
5
410
Memory API: Patterns, Use Cases, and Performance
josepaumard
1
180
perl for shell, awk and sed programmers
mackee
1
740
GrafanaのHTTP API を眺めてみよう
rinchoku
0
170
(Deep|Web) Link support with expo-router
mrtry
0
180
C#および.NETに対する誤解をひも解く
ymd65536
0
310
Cancel Next.js Page Navigation: Full Throttle
ypresto
1
210
dbt-ga4パッケージを実業務に導入してみた話
t_tokumaru_feedcorp
0
130
Featured
See All Featured
XXLCSS - How to scale CSS and keep your sanity
sugarenia
246
1.3M
Web development in the modern age
philhawksworth
205
10k
Happy Clients
brianwarren
97
6.7k
Designing for Performance
lara
604
68k
The World Runs on Bad Software
bkeepers
PRO
65
11k
Producing Creativity
orderedlist
PRO
341
39k
The Language of Interfaces
destraynor
154
24k
Done Done
chrislema
181
16k
The Pragmatic Product Professional
lauravandoore
31
6.2k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
504
140k
Creatively Recalculating Your Daily Design Routine
revolveconf
217
12k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
355
29k
Transcript
TensorFlow v1.0 with GPU on AWS MaruLabo × JAWS-UG AI
#2 @ 2017.02.20
@pottava SUPINF Inc.
ࠓ TensorFlow Ͱ͕͢ɺMXNet ɻ http://qiita.com/pottava/items/0d40747287ff31b8db77
DeepLeaning ͷֶशʹظ͕ߴ·Δ AWS Batchʂ https://jawsug-cli.doorkeeper.jp/events/52026
3 / 11ɺͥͻ͝ࢀՃ͍ͩ͘͞ʂʂ http://jawsdays2017.jaws-ug.jp/
ͦͦͳͥ GPU ͏ͷʁ
ʢࠓʣϋϯζΦϯ͔ͩΒͰ͢ ɾσΟʔϓϥʔχϯάͷֶशΛҰఆ࣌ؒʹऴ͍͑ͨ ɾGPU ߦྻܭࢉ͕ CPU ΑΓͣͬͱ͍ ɾֶशͷଟ͘ߦྻܭࢉ ɾGPU ͑ϋϯζΦϯΛͰ͖ΔՄೳੑ͕ߴ·Δ
ΫϥυͳΒ GPU ͷํ͕͍҆ʁʁ ɾΫϥυҰൠతʹ࣌ؒ՝ۚ ɾCPU ͩͱ 1 ͔͔࣌ؒΔॲཧɺGPU ͳΒ 45
ɹͲ͕͍ͬͪ҆ʁ ɾϓϩάϥϜنʹԠͯ͡બ͠·͠ΐ͏
ݟ͑ͳ͍ίετ ɾͰ GPU ͚ʹॻ͘ͷେมͳΜͰ͠ΐɾɾʁ ɾTensorFlow ͳͲ GPU Λҙࣝͤͣͱॻ͚Δ ɾࢼߦࡨޡ͢Δաఔ͕͍ͷຯʹετϨε ɾ͍ਖ਼ٛ
ͯ͞
Topics 1. AWS GPU Πϯελϯε & NVIDIA ͓͞Β͍ 2. g2
ܥͰ TensorFlow v1.0 Λ͏ 3 ͭͷํ๏ 3. ҆͘͏ʹ
1. AWS GPU Πϯελϯε & NVIDIA ͓͞Β͍
GPU Πϯελϯε AWS ʹ 2 छྨ͋Γ·͢ʢݱߦੈʣ g2 ܥ: NVIDIA GRID
K520 ɹɹɹɹ1,536 CUDA cores / GPU ͕ 2 ͭͰ 1 ͭͷ K520 ɹɹɹɹg2 Ͱ͑Δ GPU ຊདྷάϥϑΟοΫɾήʔϛϯά༻్ p2 ܥ: NVIDIA Tesla K80 ɹɹɹɹഒਫ਼ԋࢉ࠷େ 2.91 TFLOPSɺ୯ਫ਼ԋࢉ࠷େ 8.74 TFLOPS ɹɹɹɹ2,496 CUDA cores / GPU ͕ 2 ͭͰ 1 ͭͷ K80 ɹɹɹɹp2 ͷ GPU ൚༻ίϯϐϡʔςΟϯά༻్
EC2 Ͱ GPU Λಈ͔͢ʹ GPU υϥΠόΛΠϯετʔϧ͢Ε OKʂ ͱ͍͑ͦΕΛૢ࡞͢Δͷɾɾ ݱ࣮తʹ CUDA
Toolkit ඞཁͰ͢ɻ TensorFlow cuDNN ෦Ͱ͏ͷͰͦΕɻ
υϥΠόʁ ɾGPU ͝ͱʹ NVIDIA Driver ͕͞Ε͍ͯ·͢ ɹg2 ͳΒ GRID K520ɺp2
ͳΒ Tesla K80 ͷυϥΠό ɾυϥΠόͷόʔδϣϯ൪߸௨͠ɻ ɹྫ: ࠷৽όʔδϣϯͩͱ g2 ܥ GPU ೝࣝͰ͖ͳ͍
CUDAʁ ɾ͘ʔͩ ɾNVIDIA ࣾ GPU ͚ C ݴޠ౷߹։ൃڥ ɾίϯύΠϥͱ͔ϥΠϒϥϦͱ͔ศརπʔϧ܈ ɾTensorFlow
ͳͲ CUDA ܦ༝Ͱ GPU Λૢ࡞
CUDA ͱ NVIDIA υϥΠόͷରԠ ৽͍͠ CUDA Λ͏ʹ৽͠ΊͷυϥΠό͕ඞཁɻ https://github.com/NVIDIA/nvidia-docker/wiki/CUDA#requirements
Πϯετʔϧํ๏ 3 ͭ ɾυϥΠόΛೖΕͯɺCUDA Toolkit ΛೖΕΔ ɾCUDA ͷ Runfile ΠϯετʔϧͰυϥΠό͝ͱೖΕΔ
ɾυϥΠό͚ͩೖΕͯɺͦͷ্ Docker Λ͏
ҙ ɾυϥΠό GPU ͝ͱɺCUDA OS ͝ͱͷ༻ҙ ɾRunfile ΠϯετʔϧͰ GPU
ͱͷ߹ੑʹҙ ɾg2 ܥͱ p2 ܥ݉༻ͷ AMI Λ࡞ΔͳΒ ɹGRID K520 ͱ Tesla K80 ͲͪΒͰ͑ͯ ɹ͔ͭͳΔ͘৽͍͠υϥΠόΛ͏
ͦ͠͏
͍͠Ͱ͢
ͬͱ؆୯ʹ͑ͳ͍ͷʁ
ָ͍ͨ͠ํ ɾAWS ʹ AMI ͱ͍͏ϚγϯΠϝʔδ͕͋Γ·ͯ͠ ɹNVIDIA υϥΠό CUDA ͢Ͱʹೖͬͨͷ͕ʂ ɾNVIDIA
ެࣜ AMI → AWS Marketplace Go ɾAWS ެࣜ → “Deep Learning AMI” Ͱ୳ͤ·͢
AMI ར༻ͷώϯτ ɾଞΫϥυͰ CUDA ೖΓެࣜΠϝʔδ·ͩͳ͍ ɾNVIDIA / AWS ͍ͣΕͷ AMI
ݱঢ় CUDA 7.5 ɾࣗ࡞ͨ͠ AMI Λ Public ʹ͢Δͷɾɾ ɹɹ- NVIDIA ͷϥΠηϯε ɹɹ- υϥΠόͷΈ NVIDIA AMI + Docker ͱ͍͏ख
2. g2 ܥͰ TensorFlow v1.0 Λ ͏ 3 ͭͷํ๏
ͦͦ TensorFlow Λ͏ʹ ɾpip install ɾ./configure ͔Βͷ pip installʢࣗͰϏϧυʣ ɾnvidia-docker
run
TensorFlow v1.0 ͷґଘ GPU ൛ TensorFlow CUDA ͱ cuDNN
ʹґଘɻ v0.12 Ҏ߱ CUDA 8.0 ΛλʔήοτʹϏϧυ͞Ε͍ͯ ΔͨΊɺ8.0 ܥϥΠϒϥϦʢToolkit શମ͕ 8.0 Ͱ͋Δඞ ཁͳ͍ʣͱ 367.48 Ҏ߱ ͷ NVIDIA υϥΠό͕ඞཁɻ
ͱ͍͏͜ͱ
ҎԼͷ͍ͣΕ͔͕ඞཁ ɾґଘΛຬͨ͢Α͏ʹαʔόΛηοτΞοϓ ɾCUDA 7.5 ΛλʔήοτʹࣗͰ TF ΛϏϧυ ɾ݅Λຬͨ͢υϥΠό͚ͩೖΕͯɺDocker Ͱىಈ
g2 ܥ + CUDA 8.0
ણࡉͳυϥΠόόʔδϣϯ g2 ܥ GRID K520 ͷ࠷৽ରԠυϥΠό 367.57ɻ TensorFlow ͷϏϧυࡁΈόΠφϦ͕ཁٻ͢Δ CUDA
8.0 + NVIDIA Driver (>= 367.48) Λຬͨ͢ͷ ຯʹ͍͠ɻubuntu 16.04 + ҎԼ Runfile Ͱ OK https://developer.nvidia.com/compute/cuda/8.0/prod/local_installers/ cuda_8.0.44_linux-run
g2 ܥ + CUDA 7.5
ࣗͰϏϧυ͢ΔͳΒ Compute capability: g2 ͷ K520 3.0ɺp2 ͷ K80
3.7 TensorFlow ͷϏϧυ࣌ʹࢦఆ͠·͢ɻ https://en.wikipedia.org/wiki/CUDA#GPUs_supported
Docker Λ͏ͳΒ K520 ରԠͷ NVIDIA υϥΠό 367.57 ΛೖΕɺ nvidia-docker ΛηοτΞοϓ͢Ε
OKʂ ͘͠ AWS ެࣜͷ DeepLearning AMI ubuntu ൛Λ͑υϥΠόΠϯετʔϧ͑͞ෆཁɻ
p2 ܥʁ
جຊಉ͡ ͦͷ্ Tesla K80 ͱͳΕαʔόηοτΞοϓ ਵָʹͳΔͨΊɺׂѪ͠·͢ɻ
3. ҆͘͏ʹ
εϙοτΠϯελϯε AWS Ͱ GPU Λ͏ͳΒͥͻ͍͍ͨͱ͜Ζɻ ຊޠͷࢿྉॆ࣮͍ͯ͠ΔͷͰௐͯΈ͍ͯͩ͘͞
גࣜձࣾεϐϯϑ ΞΠσΟΞΛ͔ͨͪʹʂ +
http://prtimes.jp/main/html/rd/p/000000007.000007768.html Comfy for Docker ϓϩδΣΫτͷ Docker ಋೖɾ։ൃࢧԉɾӡ༻ࢹߦΛ͍ͨ͠·͢ɻ ʢGCP / Azure
ͪΖΜରԠ͍ͯ͠·͢ɾɾʣ https://www.supinf.co.jp/service/dockersupport/
͝૬ஊ͓ؾܰʹͪ͜Β·Ͱ.. 41 <Thank you !! https://www.supinf.co.jp/service/dockersupport/