#azurejp
https://www.facebook.com/dahatake/
https://twitter.com/dahatake/
https://github.com/dahatake/
https://daiyuhatakeyama.wordpress.com/
https://www.slideshare.net/dahatake/
DNN Processing Units
効率性柔軟性
Soft DPU
(FPGA)
Contro
l Unit
(CU)
Registers
Arithmeti
c Logic
Unit
(ALU)
CPUs GPUs
ASICsHard
DPU
Cerebras
Google TPU
Graphcore
Groq
Intel Nervana
Movidius
Wave Computing
Etc.
BrainWave
Baidu SDA
Deephi Tech
ESE
Teradeep
Etc.
0 1 2
784 x 100 + 100 x 10 = 785000本
9
60000個の
教師あり学習データ
785000 x 60000 = 47100000000回の足し算をします 471億回
14 days 1 hour 31 mins 15 mins
Before
2017
Apr Sept Nov
ResNet-50
NVIDIA M40 GPU
ResNet-50
32 CPU
256 Nvidia P100 GPUs
ResNet-50
1,600 CPUs
ResNet-50
1,024 P100 GPUs
Facebook
UC Berkeley, TACC,
UC Davis
Preferred Network
ChainerMN
1018 single precision operations
2017
NCシリーズ NVシリーズ NCv2シリーズ NDシリーズ NCv3シリーズ
用途 HPC & DL 可視化 HPC & DL DL HPC & DL
GPU Tesla K80
(1~4GPU)
Tesla M60
(1~4GPU)
Tesla P100
(1~4GPU)
Tesla P40
(1~4GPU)
Tesla V100
(1~4GPU)
GPU Xeon E5-2690 v3
(1~24コア)
Xeon E5-2690 v3
(1~24コア)
Xeon E5-2690 v4
(1~24コア)
Xeon E5-2690 v4
(1~24コア)
Xeon E5-2690 v4
(1~24コア)
メモリ 56~224GB 56~224GB 112GB~448GB 112GB~448GB 112GB~448GB
ローカル
SSD
~1.4TB ~1.4TB ~1.344TB ~1.344TB ~1.344TB
InfiniBand FDR InfiniBand N/A FDR InfiniBand FDR InfiniBand FDR InfiniBand
0.00
5.00
10.00
15.00
20.00
25.00
Tflops
#GPUs
AzureのGPUインスタンスで物理サーバーに遜色ない性能を実
Kepler
(2012)
Maxwell
(2014)
Pascal
(2016)
Volta
(2017)
GeForceゲーミング
Quadro
プロフェッショナル
グラフィックス
M40
M6000K6000
GTX
980
GTX
780
HPC 用
GRID 用
K80
DL 用
M60
GP100P5000
K2
K1
GTX 1080 TITAN X
V100データセンタ
& クラウド
Tesla
P40
P100
P6
TITAN V
Fermi
(2010)
M2070
6000
GTX
580
P4
GV100
M6 M10
NC
NCv2 NCv3ND
NV
*full GV100 chip contains 84 SMs
P100 V100 性能UP
トレーニング性能 10 TOPS 125 TOPS 12x
インファレンス性
能
21 TFLOPS 125 TOPS 6x
FP64/FP32 5/10 TFLOPS 7.8/15.6 TFLOPS 1.5x
HBM2 バンド幅 720 GB/s 900 GB/s 1.2x
NVLink バンド幅 160 GB/s 300 GB/s 1.9x
L2 キャッシュ 4 MB 6 MB 1.5x
L1 キャッシュ 1.3 MB 10 MB 7.7x
P100に対する相対性能
HPC アプリケーション性能
System Config Info: 2X Xeon E5-2690 v4, 2.6GHz, w/ 1X Tesla
P100 or V100. V100 measured on pre-production hardware.
Summit Supercom
200+ PetaFlops
~3,400 Nodes
10 Megawatts
D = AB + C
D =
FP16 or FP32 FP16 FP16 FP16 or FP32
A0,0 A0,1 A0,2 A0,3
A1,0 A1,1 A1,2 A1,3
A2,0 A2,1 A2,2 A2,3
A3,0 A3,1 A3,2 A3,3
B0,0 B0,1 B0,2 B0,3
B1,0 B1,1 B1,2 B1,3
B2,0 B2,1 B2,2 B2,3
B3,0 B3,1 B3,2 B3,3
C0,0 C0,1 C0,2 C0,3
C1,0 C1,1 C1,2 C1,3
C2,0 C2,1 C2,2 C2,3
C3,0 C3,1 C3,2 C3,3
4x4 の行列の積和演算を1サイクルで計算する性能 (128演算/サイクル)
行列のFMA (Fused Multiply-Add)
Volta Tensor Core
P100 V100
FP16/Tensorコア 20 TFLOPS 125 TFLOPS
FP32 10 TFLOPS 15.6 TFLOPS
FP16
FP16
+ FP32
FP32
FP16 FP32
16bit
16bit
32bit
最大9倍の
性能向上
Convolution層
の性能比較
0 100 200 300 400 500 600
Series1 Series2 Series3 Series4 Series5
570 ms
360 ms
197 ms
Time per iteration [ms]
約3倍
P100 FP32
V100 FP32
V100
Tensorコア
(*) Chainer 3.0.0rc1+ と CuPy 2.0.0rc1+ を使用
CNN - IMAGES
0
1,000
2,000
3,000
4,000
5,000
6,000
画像/秒(レイテンシ目標:7ms)
ResNet-50 のスループット
17ms
CPU + Caffe P100 +
TensorRT
P4 +
TensorRT
CPU throughput based on measured inference throughput performance on Broadwell-based Xeon E2690v4 CPU, and doubled to reflect Intel’s
stated claim that Xeon Scalable Processor will deliver 2x the performance of Broadwell-based Xeon CPUs on Deep Learning Inference.
V100 +
TensorRT
0
1,000
2,000
3,000
4,000
5,000
6,000
7,000
8,000
9,000
GoogLeNet のスループット
8ms
CPU + Caffe P100 +
TensorRT
P4 +
TensorRT
V100 +
TensorRT
7ms 7ms
CNN - IMAGES
画像/秒(レイテンシ目標:7ms)
P100 V100 P100 V100
ImagesperSecond
ImagesperSecond
2.4x faster 3.7x faster
FP32 Tensorコア FP16 Tensorコア
トレーニング インファレンス
TensorRT - 7ms Latency
(*) DLモデルはResNet50
GPU 構成済みの環境
データサイエンス &
モデリング、開発、
展開
データサイエン
ス
仮想マシン
(DSVM)
• Local tools
• Local Debug
• Faster
experimentation
Single VM
Development
• Larger VMs
• GPU
Scale Up
• Multi Node
• Remote Spark
• Batch Nodes
• VM Scale Sets
Scale Out
DSVM
(Dev/Test Workstation)
Azure File
Store
Azure Batch AI
Cluster
Batch AI Run Script
Store Py Scripts in File Store
Create Py Scripts
Trained AI
Model
Trained AI
Model
score.py
{ JSON
}schema.json conda_dependencies
.yml
Azure Machine Learning
Model Management
Run Time
Model
Registry
Image
Registry
Manifest for
Image Generation
Single
Machines
(e.g.. DSVM, IoT
Devices, local
PC)
Azure Container Service
(AKS) – Kubernetes clusters
4
1 2 3
並列化可能な領域 𝑝並列化できない領域
1 − 𝑝
𝑝
𝑛
1 − 𝑝
並列化可能な領域 𝑝並列化できない領域
1 − 𝑝
𝑝
𝑛
1 − 𝑝
並列化できない領
域
依存関係があり並列化できない処理、
ファイルI/O、ノード間通信、GPU-CPU間
のデータ転送、並列化のためのオーバー
ヘッドなど
並列化可能な領域 依存関係がなく並列化可能な処理など
0
20
40
60
80
100
120
140
0 16 32 48 64 80 96 112 128
スピードアップ
並列数
Series1
Series2
Series3
Series4
並列化率を少しでも向上させることが、
スケーラビリティの向上につながる
メリット
• 待機時間の短縮/1秒当たりのパケット数の向上
• ジッターの削減
• CPU使用率の削減
0
100
200
300
400
500
600
700
800
900
1000
1 10 100 1000 10000
Latency[μsec]
Size [bytes]
SR-IOV
non SR-IOV
0
500
1000
1500
2000
2500
1 100 10000 1000000 100000000 1E+10
Bandwidth[Mbytes/sec]
Size [bytes]
SR-IOV
non SR-IOV
1
10
100
1000
1 10 100 1000 10000
Latency[μsec]
Size [bytes]
SR-IOV (DS5_v2)
non SR-IOV (DS5_v2)
InfiniBand FDR (H16r)
0
1000
2000
3000
4000
5000
6000
7000
1 100 10000 1000000 100000000 1E+10
Bandwidth[Mbytes/sec]
Size [bytes]
SR-IOV (DS5_v2)
non SR-IOV (DS5_v2)
InfiniBand FDR (H16r)
InfiniBand
RDMA
スペック H16r H16mr H8 H8m H16 H16m
コア数 16 16 8 8 16 16
CPU Xeon E5-2667 v3 3.2 GHz - Haswell
メモリ
DDR 4
112 GB
DDR 4
224 GB
DDR 4
56 GB
DDR 4
112 GB
DDR 4
112 GB
DDR 4
224 GB
標準データ
ディスク
2.0 TB SSD 2.0 TB SSD 1.0 TB SSD 1.0 TB SSD 2.0 TB SSD 2.0 TB SSD
フロント
ネットワー
ク
40G bps Ethernet
バックエン
ドネット
ワーク
FDR InfiniBand with RDMA N/A
Azure がベストパフォーマンスを記録
InfiniBandにより、複数ノード実行時の性能劣化を抑制Comparative benchmarking of cloud computing vendors with High Performance Linpack
Mohammad Mohammadi, Timur Bazhirov, Exabyte Inc. https://arxiv.org/pdf/1702.02968.pdf
Azure A9, H16がトップライン Azure H16がトップライン
0
5
10
15
20
25
0 64 128 192 256 320 384 448 512
TFLOPS
Number of Cores
Seri
es1
H16r (東日本リージョン) A9 (東日本リージョン)
CPU Intel Xeon E5-2667 v3 Intel Xeon E5-2670
クロック周波数 3.2GHz 2.6GHz
ソケット当たりのコア数 8コア 8コア
ノード当たりのソケット数(コア
数)
2ソケット(16コア) 2ソケット(16コア)
ノード当たりの主記憶容量 112GB 112GB
OS SLES 12 SP1 for HPC
MPI Intel MPI 2017 update2 Build 20170125
HPL Intel® Optimized MP LINPACK Benchmark for Cluster
Intel Parallel Studio Cluster Edition 2017 update2のMKLに含まれるmp_linpack(static)を使
用
低レイテンシ・高バンド幅のインターコネクトを搭載したHPC向けイン
スタンスH16r(4x FDR)およびA9(4x QDR)でHPLを実行した結果、512
並列(32ノード)でピーク性能比95%以上(H16r)を達成。
NC24r NC24rs_v2
CPU Intel Xeon E5-2690 v3 Intel Xeon E5-2690 v4
クロック周波数 2.6GHz 2.6GHz
ソケット当たりのコア数 12コア 12コア
ノード当たりのソケット数
(コア数)
2ソケット(24コア) 2ソケット(24コア)
ノード当たりの主記憶容量 224GB 224GB
OS Ubuntu 16.04 Ubuntu 16.04
MPI Intel MPI 5.1.3.223 Intel MPI 5.1.3.223
0
2000
4000
6000
8000
10000
12000
0 50 100 150
Speedup(times,linear)
# of GPUs
K80 vs P100 – Scale-out Comparison
NC24r (K80) NC24rs_v2 (P100)
②クラスター(Ubuntu /
データサイエンスVM)の
作成
①ストレージの作成
③ジョブ投入
注意点
• Batch AIのクオータは、仮
想マシンやAzure Batchとは
異なります
• 仮想マシンのクオータを
持っていても、Batch AIで
は別途クオータの申請が必
要です
• リソースグループは
Azureのリソース管
理で一番大きなくく
り
• 通常ライフサイクル
が同じものをまとめ
る
• ワークスペースは
Batch AIの各リソー
スの管理単位
• プロジェクトやチー
ム単位で1つ作るの
がおすすめ
• Experimentはジョブ
管理の単位
• 同じモデルの計算
や、パラメータご
と、日付などで分け
る
推奨
コンテナーの中に仮想的なディレクトリ構造を作る
こともできる
0
50
100
150
200
250
1 2
実行時間[min]
Dockerコンテナー OSイメージ
利点 カスタマイズが容易
すでにあるものを利用できる
DSVMならばMSが提供
ダウンロード時間がかからない
欠点 イメージのダウンロード時間がかかる 作成がやや手間がかかる
こちらを読めばオプションなど細かい部
分含めて詳細な理解が可能です

機械学習 / Deep Learning 大全 (4) GPU編

Editor's Notes