SlideShare a Scribd company logo
佐々木邦暢 (@_ksasaki)
エヌビディア合同会社
A100 GPU 搭載! P4d インスタンス
使いこなしのコツ
2
P4D インスタンスに搭載の
NVIDIA A100 GPU
3
NVIDIA A100 TENSOR コア GPU
かつてない飛躍 - Volta 比最大 20 倍のピーク性能
ピーク性能 V100 比
FP32 トレーニング 312 TFLOPS 20X
INT8 インファレンス 1,248 TOPS 20X
FP64 HPC 19.5 TFLOPS 2.5X
Multi-instance GPU (MIG) 7X GPUs
A100 PCIe
A100 SXM4
4
世代別 NVIDIA GPU 製品 (の一部)
GeForce
PC 向け
Quadro
ワークステーション向け
データセンター
GPU
Fermi
(2010)
M2050
6000
Kepler
(2012)
K6000
GTX 780
K80
Maxwell
(2014)
M40
M6000
GTX 980
M60
Volta
(2017)
V100
TITAN V
GV100
Pascal
(2016)
GP100
P5000
GTX 1080
P40
P100
Turing
(2018)
T4
TITAN RTX
RTX 2080
Ampere
(2020)
A100
HPC
DL
学習
DL
推論
VDI
P4
RTX
8000
TITAN XP
NEW!
V100
P100
Tensor コア 世代
RTX 3090
RTX 3080
RTX 3070
P4
GTX 580
AlexNet
K520
5
Tensor コアによる行列演算
A100 GPU の性能を最大限に引き出すカギ
D = A * B + C
C,D
A
B
行列積は、「小」行列積に分解できる
「小」行列積を、各 Tensor コアで計算
A’
B’
C’
行列の FMA (Fused Multiply-Add: 融合積和演算)
125 TFLOPS: NVIDIA V100 では FP32 比で 8 倍のピーク性能
312 TFLOPS: NVIDIA A100 では FP32 比で 16 倍のピーク性能
NEW!
6
https://arxiv.org/abs/1710.03740
7
FP32 と FP16
FP32 (単精度) FP16 (半精度)
指数部: 8 ビット、仮数部: 23 ビット 指数部: 5 ビット、仮数部: 10 ビット
表現可能な範囲
1.4 x 10-45 < x < 3.4 x 1038
表現可能な範囲
5.96 x 10-8 < x < 65504
従来一般的だったのはこちら 混合精度演算で使うのはこちら
8
FP16 を使うことの利点
メモリが節約できる、だけではない
"half-precision math throughput in recent GPUs is 2× to 8× higher
than for single-precision."
「最近の GPU では FP16 の演算スループットが
FP32 の 2 倍から 8 倍高い」
https://arxiv.org/abs/1710.03740
9
混合精度演算でトレーニングを高速化するには
モデル (計算グラフ) を FP16 にキャスト
• 重みのマスターコピーは FP32 で保持 (誤差の蓄積を防ぐ)
• ロススケーリング (勾配消失を防ぐ)
• 積和演算の乗算を FP16 で、加算は FP32 で実行
これだけでは正確度が維持できない
対策
10
Tensor コアによる混合精度演算
モデルの正確度を妥協することなく高いスループットを実現
ILSVRC12 classification top-1 accuracy.
(Sharan Narang, Paulius Micikevicius et al., "Mixed Precision Training“, ICLR 2018)
**Same hyperparameters and learning rate schedule as FP32.
正確度
(Accuracy)
11
Automatic
Mixed
Precision
自動混合精度演算
12
計算グラフを解析し適切にキャスト
Placeholder
Mul
Reciprocal
GradFilter
MatMul
Placeholder
GradInput
ReluGrad
LossGrad
MatMul
Conv2d
Relu
Add
Loss
MatMul
VariableV2
Mul
VariableV2
Mul
VariableV2
13
計算グラフを解析し適切にキャスト
FP16 Cast
Mul
Reciprocal
GradFilter
MatMul
Placeholder
GradInput
ReluGrad
LossGrad
MatMul
Conv2d
Relu
Add
Loss
MatMul
VariableV2
Mul
VariableV2
Mul
VariableV2
Placeholder
FP16 Cast
FP16 Cast
FP32 Cast FP16 Cast
FP32 Cast
FP32 Cast
14
FP16
で表現可能な範囲
勾配のアンダーフロー
FP16 では勾配が小さく (< 2^-24) なるとアンダーフローする
ロス
勾配
勾配が小さくなると FP16 で
表現できず 0 に
FP32
で表現可能な範囲
MODEL
FP16 Layers
15
ロス スケーリング
ロスの値をスケールして FP16 で表現可能な範囲に収める
勾配をスケールダウンして FP32 で更新
MODEL
FP16 Layers
ロスの値を
スケール
スケールされた勾配
FP16
で表現可能な範囲
FP32
で表現可能な範囲
元のロス
16
自動混合精度演算 (AMP) の有効化
わずか数行の追加で高速化
詳しくはこちら: https://developer.nvidia.com/automatic-mixed-precision
TensorFlow
NVIDIA NGC コンテナイメージ 19.07 以降、TF 1.14 以降及び TF 2 以降では、オプティマイザのラッパーが利用可能:
opt = tf.train.experimental.enable_mixed_precision_graph_rewrite (opt)
Keras mixed precision API in TF 2.1+ for eager execution
https://tensorflow.org/api_docs/python/tf/train/experimental/enable_mixed_precision_graph_rewrite
PyTorch
PyTorch はネイティブに AMP をサポート。詳細は公式ドキュメントを:
https://pytorch.org/docs/stable/amp.html
https://pytorch.org/docs/stable/notes/amp_examples.html
MXNet
NVIDIA NGC コンテナイメージ 19.04 以降、MXNet 1.5 以降は、わずかな追加コードで AMP を利用可能:
amp.init()
amp.init_trainer(trainer)
with amp.scale_loss (loss, trainer) as scaled_loss:
autograd.backward(scaled_loss)
https://mxnet.apache.org/api/python/docs/tutorials/performance/backend/amp.html
17
1.4X
2.0X
1.6X 1.7X
1.9X
2.0X
2.4X
2.7X 2.8X
0.0x
0.5x
1.0x
1.5x
2.0x
2.5x
3.0x
WaveGlow TacoTron 2 RN50 Mask R CNN DLRM Jasper GNMT Transformer BERT
A100
AMP による混合精度トレーニングが最大 2.8 倍高速に
V100 (FP16) と A100 (FP16) の比較
CV ASR
RecSys
TTS NLP
Speedup
V100
All results are measured
V100 used is DGX-1 (8xV100 16GB). A100 used is s DGX A100 (8xA100 SXM4), except DLRM which uses 1xV100 and 1xA100; all use FP16
RN50 uses MXNET Batch size =192, Mask R CNN uses PyTorch BS = 4 (V100) and BS=16 (A100), DLRM uses PyTorch and BS=32768, Jasper uses PyTorch and BS=32 (V100) and 96 (A10),
WaveGlow uses PyTorch and BS=10, TacoTron2 uses PyTorch and BS=104 (V100) and 100 (A100), Transformer uses PyTorch and BS=5120 (V100) and 13312 (A100 and GNMT uses PyTorch and
BS=128 (V100) and 256 (A100); BERT Pre-Training Throughput using Pytorch including (2/3)Phase 1 and (1/3)Phase 2 | Phase 1 Seq Len = 128, Phase 2 Seq Len = 512
18
TF32 TENSOR コア
FP32 のレンジと FP16 の精度を合わせ持つ新しい数値データ型
➢ FP32 の指数部、FP16 の仮数部
➢ FP32 を受け取り、TF32 で乗算して FP32 で加算
➢ コード変更不要でモデルのトレーニングを高速化
FP32
TENSOR FLOAT 32 (TF32)
FP16
BFLOAT16
8 ビット 23 ビット
8 ビット 10 ビット
5 ビット 10 ビット
8 ビット 7 ビット
指数部 仮数部
符号部
FP32 のレンジ
FP16 の精度
FP32 行列 FP32 行列
TF32 フォーマットで乗算
FP32 で加算
FP32 行列
19
2.0X 1.9X
2.9X
3.2X
4.2X 4.1X
5.0X 5.1X
5.8X
0.0x
0.5x
1.0x
1.5x
2.0x
2.5x
3.0x
3.5x
4.0x
4.5x
5.0x
5.5x
6.0x
6.5x
RN50 Mask R CNN Jasper WaveGlow TacoTron 2 DLRM Transformer GNMT BERT
A100
TF32 によりコード変更なしで AI トレーニングを高速化
V100 (FP32) と A100 (TF32) の比較
CV RecSys
ASR TTS NLP
All results are measured
V100 used is DGX-1 (8xV100 16GB). A100 used is s DGX A100 (8xA100 SXM4), except DLRM which uses 1xV100 and 1xA100; V100 uses FP32 and A100 uses TF32
RN50 uses MXNET Batch size = 96, Mask R CNN uses PyTorch BS = 4 (V100) and BS=8 (A100), DLRM uses PyTorch and BS=32768, Jasper uses PyTorch and BS=16,, WaveGlow uses PyTorch and
BS=4 (V100) and 10 (A100), TacoTron2 uses PyTorch and BS=48 (V100) and 128 (A100), Transformer uses PyTorch and BS=2560 (V100) and 6656 (A100 and GNMT uses PyTorch and BS=128
(V100) and 512 (A100); BERT Pre-Training Throughput using Pytorch including (2/3)Phase 1 and (1/3)Phase 2 | Phase 1 Seq Len = 128, Phase 2 Seq Len = 512
Speedup
V100
20
倍精度演算のピーク性能が 2.5 倍に
A100 の Tensor コアは FP64 に対応
1.5x
2x
0
1
2
LSMS BerkeleyGW
A100 Speedup vs. V100
(FP64)
Application [Benchmarks]: BerkeleyGW [Chi Sum + MTXEL] using DGX-1V (8xV100) and DGX-A100 (8xA100) | LSMS [Fe128] single V100 SXM2 vs. A100 SXM4
• IEEE 754 準拠の倍精度浮動小数点数
• cuBLAS, cuTensor, cuSolver 等のライブラリで対応
NVIDIA V100 FP64 NVIDIA A100 Tensor コア FP64
21
HPC アプリケーションの性能向上
All results are measured
Except BerkeleyGW, V100 used is single V100 SXM2. A100 used is single A100 SXM4
More apps detail: AMBER based on PME-Cellulose, GROMACS with STMV (h-bond), LAMMPS with Atomic Fluid LJ-2.5, NAMD with v3.0a1 STMV_NVE
Chroma with szscl21_24_128, FUN3D with dpw, RTM with Isotropic Radius 4 1024^3, SPECFEM3D with Cartesian four material model
BerkeleyGW based on Chi Sum and uses 8xV100 in DGX-1, vs 8xA100 in DGX A100
1.5X 1.5X 1.6X
1.9X
2.0X
2.1X
1.7X
1.8X
1.9X
0.0x
0.5x
1.0x
1.5x
2.0x
A100
Speedup
V100
分子動力学 物理 工学 地球科学
22
0
40
80
120
160
200
240
280
320
PME-Cellulose_NVE
AMBER Performance Equivalency
Single GPU Node vs Multiple Cascade Lake CPU-Only Nodes
CPU Server: Dual Xeon Gold 6240@2.60GHz , GPU Servers: Platinum 8168@2.70GHz with NVIDIA A100 80GB SXM4
CUDA Version: CUDA 11.1; Dataset: PME-Cellulose_NVE
To arrive at CPU node equivalence, we use measured benchmark with up to 8 CPU nodes. Then we use linear scaling to
scale beyond 8 nodes.
# of CPU Only Nodes
1 node
4x A100 GPUs
140 CPU
Nodes
280 CPU
Nodes
70 CPU
Nodes
1 node
8x A100 GPUs
1 node
2x A100 GPUs
AMBER
Molecular Dynamics
Suite of programs to simulate molecular
dynamics on biomolecule
VERSION
20.6-AT_20.10
ACCELERATED FEATURES
PMEMD Explicit Solvent and GB Implicit Solvent
SCALABILITY
Multi-GPU and Single Node
MORE INFORMATION
http://ambermd.org/gpus
23
MULTI-INSTANCE GPU (MIG)
24
Multi-Instance GPU (MIG)
GPU をハードウェア分割、複数のユーザーに QoS の確保された GPU アクセスを提供
A100 GPU を最大 7 分割:
パーティション毎に、専用の演算器、メモリ、L2 キャッシュを
確保、Noisy Neighbor 問題を回避
QoS を確保しつつ、複数のワークロードを同時に実行:
MIG インスタンスは予測可能なスループットとレイテンシで
並列に動作
適切な GPU 割り当て:
ターゲットワークロードに応じて適切なサイズのインスタンスに
分割可能
様々な環境で利用可能:
EC2 を含む仮想環境はもちろん、ベアメタル、 Docker
コンテナ、Kubernetes や Slurm のようなオーケストレー
ター /ワークロードマネージャの環境をサポート
MIG User Guide: https://docs.nvidia.com/datacenter/tesla/mig-user-guide/index.html
25
Multi-Instance GPU (MIG)
GPU をハードウェア分割、複数のユーザーに QoS の確保された GPU アクセスを提供
メモリ メモリ メモリ
GPU インスタンス
4g.20gb
GPU インスタンス
2g.10gb
GPU インスタンス
1g.5gb
GPU
コンピュート
インスタンス
コンピュート
インスタンス
1c.4g.20gb 1c.4g.20gb 1c.4g.20gb 1c.4g.20gb
GPC GPC GPC GPC GPC GPC GPC
26
MIG 用語 – インスタンス
GPU インスタンスとコンピュート インスタンスから構成される MIG デバイス
● Multi-Instance GPU (MIG) - The MIG feature allows one or more GPU Instances to be allocated within a
GPU. Making a single GPU appear as if it were many.
● GPU Instances (GI) - A fully isolated collection of all physical GPU resources. Can contain one or more
GPU Compute Instances. Contains one or more Compute Instances.
● Compute Instance (CI) - An isolated collection of GPU SMs (CUDA cores) belongs to a single GPU
Instance. Shares GPU memory with other CIs in that GPU Instance.
● Instance Profile - A GPU Instance Profile (GIP) or GPU Compute Instance Profile (CIP) defines the
configuration and available resources in an Instance.
● MIG Device - A MIG Device is the actual “GPU” an application sees and it is the combination of a GPU,
GPU Instance, and Compute Instance.
28
GPU インスタンス プロファイル
GPU
Instance
Number of
Instances
Available
SMs Memory NVDECs
Target use-cases
Training Inference
1g.5gb 7 14 5 GB 0
BERT Fine-tuning (e.g. SQuAD),
Multiple chatbots, Jupyter notebooks
Multiple inference (e.g. TRTIS);
ResNet-50, BERT, WnD networks
2g.10gb 3 28 10 GB 1
3g.20gb 2 42 20 GB 2
Training on ResNet-50, BERT, WnD
networks
4g.20gb 1 56 20 GB 2
7g.40gb 1 98 40 GB 5
For A100-SXM4-40GB
29
MIG の有効化と無効化
● GPU 毎に有効化・無効化
● MIG 有効と無効の GPU が混在可能
● 使用中のGPUは「保留」状態となり、再起動後に変
更が有効に
● MIG の有効化・無効化にはroot権限が必要
● 一度設定した有効・無効の状態は、サーバーの再起
動後も有効
# All MIG configuration requires sudo
dgxuser@DGXA100:~$ nvidia-smi -i 0 -mig 1
Unable to enable MIG Mode for GPU 00000000:07:00.0: Insufficient Permissions
Terminating early due to previous errors.
dgxuser@DGXA100:~$ sudo nvidia-smi -i 0 -mig 1
00000000:07:00.0 is currently being used by one or more other processes (e.g. CUDA application or a monitoring application such as another instance of nvidia-smi).
Please first kill all processes using the device and retry the command or reboot the system to make MIG mode effective.
All done.
dgxuser@DGXA100:~$ sudo nvidia-smi -i 0 -mig 1
Warning: MIG mode is in pending enable state for GPU 00000000:07:00.0:In use by another client
00000000:07:00.0 is currently being used by one or more other processes (e.g. CUDA application or a monitoring application such as another instance of nvidia-smi).
Please first kill all processes using the device and retry the command or reboot the system to make MIG mode effective.
All done.
dgxuser@DGXA100:~$ nvidia-smi -q -i 0 | grep -i MIG -A 2
MIG Mode
Current : Disabled
Pending : Enabled
dgxuser@DGXA100:~$ sudo nvidia-smi -i 0 -r
The following GPUs could not be reset:
GPU 00000000:07:00.0: In use by another client
1 device is currently being used by one or more other processes (e.g., Fabric Manager, CUDA application, graphics application such as an X server, or a monitoring
application such as another instance of nvidia-smi). Please first kill all processes using this device and all compute applications running in the system.
dgxuser@DGXA100:~$ sudo systemctl stop nvsm
dgxuser@DGXA100:~$ sudo systemctl stop dcgm
dgxuser@DGXA100:~$ sudo nvidia-smi -i 0 -r
GPU 00000000:07:00.0 was successfully reset.
All done.
dgxuser@DGXA100:~$ nvidia-smi -i 0 --query-gpu=mig.mode.pending,mig.mode.current --format=csv
mig.mode.pending, mig.mode.current
Enabled, Enabled
dgxuser@DGXA100:~$ sudo nvidia-smi -i 0,1,2,3 -mig 1
Enabled MIG Mode for GPU 00000000:07:00.0
Enabled MIG Mode for GPU 00000000:0F:00.0
Enabled MIG Mode for GPU 00000000:47:00.0
Enabled MIG Mode for GPU 00000000:4E:00.0
All done.
dgxuser@DGXA100:~$ sudo systemctl start nvsm
dgxuser@DGXA100:~$ sudo systemctl start dcgm
30
GA100 と MIG
GPU
GPC
TPC
SM
SM
#1
GPC
TPC
SM
SM
#2
GPC
TPC
SM
SM
#3
GPC
TPC
SM
SM
#4
GPC
TPC
SM
SM
#5
GPC
TPC
SM
SM
#6
GPC
TPC
SM
SM
#7
GPC
TPC
SM
SM
#8
#1
#2
#3
#4
#5
#6
#7
#8
GPU
GPC
TPC
SM
SM
#1
GPC
TPC
SM
SM
#2
GPC
TPC
SM
SM
#3
GPC
TPC
SM
SM
#4
GPC
TPC
SM
SM
#5
GPC
TPC
SM
SM
#6
GPC
TPC
SM
SM
#7
GPC
TPC
SM
SM
#8
GA100 全体
8 GPC, 8 TPC/GPC, 2 SM/TPC, 128 SM
通常の GA100 – MIG 無効
7 GPC, 7 or 8 TPC/GPC, 2 SM/TPC, 108 SM
GPU
GPC
TPC
SM
SM
#1
GPC
TPC
SM
SM
#2
GPC
TPC
SM
SM
#3
GPC
TPC
SM
SM
#4
GPC
TPC
SM
SM
#5
GPC
TPC
SM
SM
#6
GPC
TPC
SM
SM
#7
GPC
TPC
SM
SM
#8
通常の GA100 – MIG 有効
7 GPC, 7 TPC/GPC, 2 SM/TPC, 98 SM
#1
#2
#3
#4
#5
#6
#7
#8
32
Using MIG in Docker Containers
Passing through specific MIG devices
With MIG disabled the GPU is still specified by the GPU index or GPU UUID.
However, when MIG is enabled the device is specified by index in the format <gpu-device-index>:<mig-device-
index> or by UUID in the format MIG-<gpu-id>/<gpu-instance-id>/<gpu-compute-instance-id>.
Configure MIG (as root)
Configure MIG (non-root)
MIG monitoring
Note: Commands are slightly different on Docker version 18.x (shown here is 19.03+)
docker run --cap-add SYS_ADMIN --gpus '"device=0"' -e NVIDIA_MIG_CONFIG_DEVICES="all" nvidia/cuda:9.0-base nvidia-smi
docker run --gpus '"device=0:0,0:1"' nvidia/cuda:9.0-base nvidia-smi # MIG ENABLED
docker run --cap-add SYS_ADMIN --gpus '"device=0"' -e NVIDIA_MIG_MONITOR_DEVICES="all" nvidia/cuda:9.0-base nvidia-smi
chown nobody /proc/driver/nvidia/capabilities/mig/config
docker run --cap-add SYS_ADMIN --user nobody --gpus '"device=0"' ¥
-e NVIDIA_MIG_CONFIG_DEVICES="all" nvidia/cuda:9.0-base nvidia-smi
docker run --gpus '"device=0,1"' nvidia/cuda:9.0-base nvidia-smi # MIG DISABLED
33
NGC
34
NGC: GPU 最適化 ソフトウェア ハブ
機械学習と HPC のワークフローをシンプルに
Innovate Faster
Deploy Anywhere
Simplify Deployments
学習済みモデル
NLP, Classification, Object Detection & more
モデル学習スクリプト
NLP, Image Classification, Object Detection & more
Helm チャート
AI applications, K8s cluster, Registry
コンテナイメージ
DL, ML, HPC
35
継続的なパフォーマンス改善
ソフトウェアの最適化により、同じハードウェアでも性能が向上
ディープラーニングフレームワークと HPC ソフトウェアスタックの月例更新で性能向上
15000
16000
17000
18000
19000
20000
21000
22000
19.03 19.10
Images/Second
MxNet
256 Batch Size | ResNet-50 Training v1.5| 16x V100 | DGX-2
8000
9000
10000
11000
12000
13000
14000
15000
19.03 19.10
Images/Second PyTorch
10000
11000
12000
13000
14000
15000
16000
17000
19.05 20.01
Images/Second
TensorFlow
Speedup across Chroma, GROMACS, LAMMPS, QE, MILC, VASP,
SPECFEM3D, NAMD, AMBER, GTC, RTM | 4x V100 v. Dual-Skylake
| CUDA 9 for Mar '18 & Nov '18, CUDA 10 for Mar '19
15x
16x
17x
18x
Nov '18 Jun '18 Oct '19
HPC Applications
512 Batch Size | ResNet-50 Training v1.5| 16x V100 | DGX-2 512 Batch Size | ResNet-50 Training v1.5| 16x V100 | DGX-2
36
NGC CATALOG IN AWS MARKETPLACE
AWS Marketplace で NGC のコンテナー イメージへアクセス
NGC のアカウント作成は不要
イメージは ECR から pull する形
NVIDIA AI: MXNet, PyTorch, TensorFlow, Triton
Inference Server といったフレームワークやツール
NVIDIA Clara Imaging: 医用画像処理
NVIDIA DeepStream SDK: 動画のリアルタイム解析
NVIDIA HPC SDK: HPC 向けのコンパイラ、ライブラリ、ツール群
NVIDIA Isaac Sim ML Training: ロボティクス向けシミュレーター
NVIDIA Merlin: レコメンデーション エンジン構築フレームワーク
NVIDIA NeMO: 対話型 AI 作成ツールキット
NVIDIA RAPIDS: オープンソースのデータサイエンス ライブラリ
37
EC2 で GPU インスタンスを簡単に使うには
AWS Marketplace の Deep Learning AMI
AWS Deep Learning AMI NVIDIA Deep Learning AMI
A100 GPU 搭載! P4d インスタンス使いこなしのコツ

More Related Content

PDF
トランザクションの並行実行制御 rev.2
Takashi Hoshino
 
PPTX
[DL輪読会]Revisiting Deep Learning Models for Tabular Data (NeurIPS 2021) 表形式デー...
Deep Learning JP
 
PDF
Kubernetesによる機械学習基盤への挑戦
Preferred Networks
 
PDF
Marp Tutorial
Rui Watanabe
 
PDF
分散学習のあれこれ~データパラレルからモデルパラレルまで~
Hideki Tsunashima
 
PDF
入門 Kubeflow ~Kubernetesで機械学習をはじめるために~ (NTT Tech Conference #4 講演資料)
NTT DATA Technology & Innovation
 
PPTX
事業の進展とデータマネジメント体制の進歩(+プレトタイプの話)
Tokoroten Nakayama
 
PPTX
Apache Spark on Kubernetes入門(Open Source Conference 2021 Online Hiroshima 発表資料)
NTT DATA Technology & Innovation
 
トランザクションの並行実行制御 rev.2
Takashi Hoshino
 
[DL輪読会]Revisiting Deep Learning Models for Tabular Data (NeurIPS 2021) 表形式デー...
Deep Learning JP
 
Kubernetesによる機械学習基盤への挑戦
Preferred Networks
 
Marp Tutorial
Rui Watanabe
 
分散学習のあれこれ~データパラレルからモデルパラレルまで~
Hideki Tsunashima
 
入門 Kubeflow ~Kubernetesで機械学習をはじめるために~ (NTT Tech Conference #4 講演資料)
NTT DATA Technology & Innovation
 
事業の進展とデータマネジメント体制の進歩(+プレトタイプの話)
Tokoroten Nakayama
 
Apache Spark on Kubernetes入門(Open Source Conference 2021 Online Hiroshima 発表資料)
NTT DATA Technology & Innovation
 

What's hot (20)

PPTX
分散深層学習 @ NIPS'17
Takuya Akiba
 
PDF
SSII2021 [OS2-02] 深層学習におけるデータ拡張の原理と最新動向
SSII
 
PPTX
【DL輪読会】Efficiently Modeling Long Sequences with Structured State Spaces
Deep Learning JP
 
PDF
研究効率化Tips Ver.2
cvpaper. challenge
 
PDF
ChatGPTは思ったほど賢くない
Carnot Inc.
 
PDF
開発速度が速い #とは(LayerX社内資料)
mosa siru
 
PDF
Data-centricなML開発
Takeshi Suzuki
 
PPTX
え、まって。その並列分散処理、Kafkaのしくみでもできるの? Apache Kafkaの機能を利用した大規模ストリームデータの並列分散処理
NTT DATA Technology & Innovation
 
PDF
PostgreSQL 15 開発最新情報
Masahiko Sawada
 
PPTX
Swin Transformer (ICCV'21 Best Paper) を完璧に理解する資料
Yusuke Uchida
 
PPTX
SageMakerを使った異常検知
Ryohei Yamaguchi
 
PDF
Machine learning CI/CD with OSS
yusuke shibui
 
PPTX
[DL輪読会]ドメイン転移と不変表現に関するサーベイ
Deep Learning JP
 
PDF
全力解説!Transformer
Arithmer Inc.
 
PPTX
モデル高速化百選
Yusuke Uchida
 
PPTX
近年のHierarchical Vision Transformer
Yusuke Uchida
 
PDF
【メタサーベイ】Vision and Language のトップ研究室/研究者
cvpaper. challenge
 
PPTX
【DL輪読会】時系列予測 Transfomers の精度向上手法
Deep Learning JP
 
PDF
スタートアップが提案する2030年の材料開発 - 2022/11/11 QPARC講演
Preferred Networks
 
PDF
20180729 Preferred Networksの機械学習クラスタを支える技術
Preferred Networks
 
分散深層学習 @ NIPS'17
Takuya Akiba
 
SSII2021 [OS2-02] 深層学習におけるデータ拡張の原理と最新動向
SSII
 
【DL輪読会】Efficiently Modeling Long Sequences with Structured State Spaces
Deep Learning JP
 
研究効率化Tips Ver.2
cvpaper. challenge
 
ChatGPTは思ったほど賢くない
Carnot Inc.
 
開発速度が速い #とは(LayerX社内資料)
mosa siru
 
Data-centricなML開発
Takeshi Suzuki
 
え、まって。その並列分散処理、Kafkaのしくみでもできるの? Apache Kafkaの機能を利用した大規模ストリームデータの並列分散処理
NTT DATA Technology & Innovation
 
PostgreSQL 15 開発最新情報
Masahiko Sawada
 
Swin Transformer (ICCV'21 Best Paper) を完璧に理解する資料
Yusuke Uchida
 
SageMakerを使った異常検知
Ryohei Yamaguchi
 
Machine learning CI/CD with OSS
yusuke shibui
 
[DL輪読会]ドメイン転移と不変表現に関するサーベイ
Deep Learning JP
 
全力解説!Transformer
Arithmer Inc.
 
モデル高速化百選
Yusuke Uchida
 
近年のHierarchical Vision Transformer
Yusuke Uchida
 
【メタサーベイ】Vision and Language のトップ研究室/研究者
cvpaper. challenge
 
【DL輪読会】時系列予測 Transfomers の精度向上手法
Deep Learning JP
 
スタートアップが提案する2030年の材料開発 - 2022/11/11 QPARC講演
Preferred Networks
 
20180729 Preferred Networksの機械学習クラスタを支える技術
Preferred Networks
 
Ad

Similar to A100 GPU 搭載! P4d インスタンス 使いこなしのコツ (20)

PDF
【de:code 2020】 AI とデータ サイエンスを加速する NVIDIA の最新 GPU アーキテクチャ
日本マイクロソフト株式会社
 
PDF
[Track2-2] 最新のNVIDIA AmpereアーキテクチャによるNVIDIA A100 TensorコアGPUの特長とその性能を引き出す方法
Deep Learning Lab(ディープラーニング・ラボ)
 
PDF
【A-1】AIを支えるGPUコンピューティングの今
Developers Summit
 
PDF
GPUディープラーニング最新情報
ReNom User Group
 
PDF
20170421 tensor flowusergroup
ManaMurakami1
 
PDF
GTC 2017 基調講演からディープラーニング関連情報のご紹介
NVIDIA Japan
 
PDF
Automatic Mixed Precision の紹介
Kuninobu SaSaki
 
PDF
MII conference177 nvidia
Tak Izaki
 
PDF
[db analytics showcase Sapporo 2017] B14: GPU コンピューティング最前線 by エヌビディア 佐々木邦暢
Insight Technology, Inc.
 
PDF
20161121 open hyperscale#6
ManaMurakami1
 
PDF
Deep Learning Lab MeetUp 学習編 AzureインフラとBatch AI
喜智 大井
 
PDF
【関東GPGPU勉強会#4】GTX 1080でComputer Vision アルゴリズムを色々動かしてみる
Yasuhiro Yoshimura
 
PDF
機械学習とこれを支える並列計算: ディープラーニング・スーパーコンピューターの応用について
ハイシンク創研 / Laboratory of Hi-Think Corporation
 
DOC
GPGPUによるパーソナルスーパーコンピュータの可能性
Yusaku Watanabe
 
PDF
20170726 py data.tokyo
ManaMurakami1
 
PPTX
機械学習 / Deep Learning 大全 (4) GPU編
Daiyu Hatakeyama
 
PDF
AWS Webinar 20201224
陽平 山口
 
PDF
【旧版】2009/12/10 GPUコンピューティングの現状とスーパーコンピューティングの未来
Preferred Networks
 
PDF
TVM の紹介
Masahiro Masuda
 
【de:code 2020】 AI とデータ サイエンスを加速する NVIDIA の最新 GPU アーキテクチャ
日本マイクロソフト株式会社
 
[Track2-2] 最新のNVIDIA AmpereアーキテクチャによるNVIDIA A100 TensorコアGPUの特長とその性能を引き出す方法
Deep Learning Lab(ディープラーニング・ラボ)
 
【A-1】AIを支えるGPUコンピューティングの今
Developers Summit
 
GPUディープラーニング最新情報
ReNom User Group
 
20170421 tensor flowusergroup
ManaMurakami1
 
GTC 2017 基調講演からディープラーニング関連情報のご紹介
NVIDIA Japan
 
Automatic Mixed Precision の紹介
Kuninobu SaSaki
 
MII conference177 nvidia
Tak Izaki
 
[db analytics showcase Sapporo 2017] B14: GPU コンピューティング最前線 by エヌビディア 佐々木邦暢
Insight Technology, Inc.
 
20161121 open hyperscale#6
ManaMurakami1
 
Deep Learning Lab MeetUp 学習編 AzureインフラとBatch AI
喜智 大井
 
【関東GPGPU勉強会#4】GTX 1080でComputer Vision アルゴリズムを色々動かしてみる
Yasuhiro Yoshimura
 
機械学習とこれを支える並列計算: ディープラーニング・スーパーコンピューターの応用について
ハイシンク創研 / Laboratory of Hi-Think Corporation
 
GPGPUによるパーソナルスーパーコンピュータの可能性
Yusaku Watanabe
 
20170726 py data.tokyo
ManaMurakami1
 
機械学習 / Deep Learning 大全 (4) GPU編
Daiyu Hatakeyama
 
AWS Webinar 20201224
陽平 山口
 
【旧版】2009/12/10 GPUコンピューティングの現状とスーパーコンピューティングの未来
Preferred Networks
 
TVM の紹介
Masahiro Masuda
 
Ad

More from Kuninobu SaSaki (20)

PDF
EnrootとPyxisで快適コンテナ生活
Kuninobu SaSaki
 
PDF
GTC 2019 NVIDIA NEWS
Kuninobu SaSaki
 
PDF
SC18 NVIDIA NEWS
Kuninobu SaSaki
 
PDF
GTC Japan 2018 NVIDIA NEWS
Kuninobu SaSaki
 
PDF
ISC17 NVIDIA NEWS 日本版
Kuninobu SaSaki
 
PDF
GTC17 NVIDIA News
Kuninobu SaSaki
 
PDF
SC16 NVIDIA NEWS
Kuninobu SaSaki
 
PDF
20150821 Azure 仮想マシンと仮想ネットワーク
Kuninobu SaSaki
 
PPTX
Azure仮想マシンと仮想ネットワーク
Kuninobu SaSaki
 
PDF
もっとわかる Microsoft Azure 最新技術アップデート編 - 20150123
Kuninobu SaSaki
 
PDF
Cloudera World Tokyo 2014 LTセッション「マイクロソフトとHadoop」
Kuninobu SaSaki
 
PDF
20140818 オープン白熱塾 ksasakims
Kuninobu SaSaki
 
PDF
YAPC::Asia Tokyo 2013 ランチセッション
Kuninobu SaSaki
 
PDF
Windows Azure HDInsight サービスの紹介
Kuninobu SaSaki
 
PPTX
Effective Hyper-V - 久しぶりエディション
Kuninobu SaSaki
 
PDF
HPC Azure TOP500 2012-11
Kuninobu SaSaki
 
PDF
WDD2012_SC-004
Kuninobu SaSaki
 
PPTX
TechEd2010_T2-401_EffectiveHyper-V
Kuninobu SaSaki
 
PPTX
TechEd2009_T1-402_EffectiveHyper-V
Kuninobu SaSaki
 
PPTX
TechEd2008_T1-407_EffectiveHyper-V
Kuninobu SaSaki
 
EnrootとPyxisで快適コンテナ生活
Kuninobu SaSaki
 
GTC 2019 NVIDIA NEWS
Kuninobu SaSaki
 
SC18 NVIDIA NEWS
Kuninobu SaSaki
 
GTC Japan 2018 NVIDIA NEWS
Kuninobu SaSaki
 
ISC17 NVIDIA NEWS 日本版
Kuninobu SaSaki
 
GTC17 NVIDIA News
Kuninobu SaSaki
 
SC16 NVIDIA NEWS
Kuninobu SaSaki
 
20150821 Azure 仮想マシンと仮想ネットワーク
Kuninobu SaSaki
 
Azure仮想マシンと仮想ネットワーク
Kuninobu SaSaki
 
もっとわかる Microsoft Azure 最新技術アップデート編 - 20150123
Kuninobu SaSaki
 
Cloudera World Tokyo 2014 LTセッション「マイクロソフトとHadoop」
Kuninobu SaSaki
 
20140818 オープン白熱塾 ksasakims
Kuninobu SaSaki
 
YAPC::Asia Tokyo 2013 ランチセッション
Kuninobu SaSaki
 
Windows Azure HDInsight サービスの紹介
Kuninobu SaSaki
 
Effective Hyper-V - 久しぶりエディション
Kuninobu SaSaki
 
HPC Azure TOP500 2012-11
Kuninobu SaSaki
 
WDD2012_SC-004
Kuninobu SaSaki
 
TechEd2010_T2-401_EffectiveHyper-V
Kuninobu SaSaki
 
TechEd2009_T1-402_EffectiveHyper-V
Kuninobu SaSaki
 
TechEd2008_T1-407_EffectiveHyper-V
Kuninobu SaSaki
 

Recently uploaded (11)

PDF
20250730_QiitaBash_LT登壇資料_PDC_Kurashina.pdf
pdckurashina
 
PDF
20250726_Devinで変えるエンプラシステム開発の未来
Masaki Yamakawa
 
PDF
VMUG Japan book vsan 20250515 CPU/Memory vSAN
Kazuhiro Sota
 
PDF
MahiroYoshida_セリフに着目したキャラクタロール推定に関する基礎検討_sigcc12th2025
Matsushita Laboratory
 
PDF
TaketoFujikawa_ComicComputing12th_inKumamoto
Matsushita Laboratory
 
PDF
LoRaWAN ウェザーステーションキット v3 -WSC3-L 日本語ユーザーマニュアル
CRI Japan, Inc.
 
PDF
20250729_Devin-for-Enterprise
Masaki Yamakawa
 
PDF
第三世代 ウェザーステーションキット v3 ー WSC3-L 日本語カタログ
CRI Japan, Inc.
 
PPTX
baserCMS『カスタムコンテンツ』徹底活用術〜あなただけの管理画面を自由自在に〜
Ryuji Egashira
 
PPTX
2025_7_25_吉祥寺_設計ナイト_ADR運用におけるデータ利活用の考え方.pptx
ssuserfcafd1
 
PDF
【学会聴講報告】CVPR2025からみるVision最先端トレンド / CVPR2025 report
Sony - Neural Network Libraries
 
20250730_QiitaBash_LT登壇資料_PDC_Kurashina.pdf
pdckurashina
 
20250726_Devinで変えるエンプラシステム開発の未来
Masaki Yamakawa
 
VMUG Japan book vsan 20250515 CPU/Memory vSAN
Kazuhiro Sota
 
MahiroYoshida_セリフに着目したキャラクタロール推定に関する基礎検討_sigcc12th2025
Matsushita Laboratory
 
TaketoFujikawa_ComicComputing12th_inKumamoto
Matsushita Laboratory
 
LoRaWAN ウェザーステーションキット v3 -WSC3-L 日本語ユーザーマニュアル
CRI Japan, Inc.
 
20250729_Devin-for-Enterprise
Masaki Yamakawa
 
第三世代 ウェザーステーションキット v3 ー WSC3-L 日本語カタログ
CRI Japan, Inc.
 
baserCMS『カスタムコンテンツ』徹底活用術〜あなただけの管理画面を自由自在に〜
Ryuji Egashira
 
2025_7_25_吉祥寺_設計ナイト_ADR運用におけるデータ利活用の考え方.pptx
ssuserfcafd1
 
【学会聴講報告】CVPR2025からみるVision最先端トレンド / CVPR2025 report
Sony - Neural Network Libraries
 

A100 GPU 搭載! P4d インスタンス 使いこなしのコツ

  • 1. 佐々木邦暢 (@_ksasaki) エヌビディア合同会社 A100 GPU 搭載! P4d インスタンス 使いこなしのコツ
  • 3. 3 NVIDIA A100 TENSOR コア GPU かつてない飛躍 - Volta 比最大 20 倍のピーク性能 ピーク性能 V100 比 FP32 トレーニング 312 TFLOPS 20X INT8 インファレンス 1,248 TOPS 20X FP64 HPC 19.5 TFLOPS 2.5X Multi-instance GPU (MIG) 7X GPUs A100 PCIe A100 SXM4
  • 4. 4 世代別 NVIDIA GPU 製品 (の一部) GeForce PC 向け Quadro ワークステーション向け データセンター GPU Fermi (2010) M2050 6000 Kepler (2012) K6000 GTX 780 K80 Maxwell (2014) M40 M6000 GTX 980 M60 Volta (2017) V100 TITAN V GV100 Pascal (2016) GP100 P5000 GTX 1080 P40 P100 Turing (2018) T4 TITAN RTX RTX 2080 Ampere (2020) A100 HPC DL 学習 DL 推論 VDI P4 RTX 8000 TITAN XP NEW! V100 P100 Tensor コア 世代 RTX 3090 RTX 3080 RTX 3070 P4 GTX 580 AlexNet K520
  • 5. 5 Tensor コアによる行列演算 A100 GPU の性能を最大限に引き出すカギ D = A * B + C C,D A B 行列積は、「小」行列積に分解できる 「小」行列積を、各 Tensor コアで計算 A’ B’ C’ 行列の FMA (Fused Multiply-Add: 融合積和演算) 125 TFLOPS: NVIDIA V100 では FP32 比で 8 倍のピーク性能 312 TFLOPS: NVIDIA A100 では FP32 比で 16 倍のピーク性能 NEW!
  • 7. 7 FP32 と FP16 FP32 (単精度) FP16 (半精度) 指数部: 8 ビット、仮数部: 23 ビット 指数部: 5 ビット、仮数部: 10 ビット 表現可能な範囲 1.4 x 10-45 < x < 3.4 x 1038 表現可能な範囲 5.96 x 10-8 < x < 65504 従来一般的だったのはこちら 混合精度演算で使うのはこちら
  • 8. 8 FP16 を使うことの利点 メモリが節約できる、だけではない "half-precision math throughput in recent GPUs is 2× to 8× higher than for single-precision." 「最近の GPU では FP16 の演算スループットが FP32 の 2 倍から 8 倍高い」 https://arxiv.org/abs/1710.03740
  • 9. 9 混合精度演算でトレーニングを高速化するには モデル (計算グラフ) を FP16 にキャスト • 重みのマスターコピーは FP32 で保持 (誤差の蓄積を防ぐ) • ロススケーリング (勾配消失を防ぐ) • 積和演算の乗算を FP16 で、加算は FP32 で実行 これだけでは正確度が維持できない 対策
  • 10. 10 Tensor コアによる混合精度演算 モデルの正確度を妥協することなく高いスループットを実現 ILSVRC12 classification top-1 accuracy. (Sharan Narang, Paulius Micikevicius et al., "Mixed Precision Training“, ICLR 2018) **Same hyperparameters and learning rate schedule as FP32. 正確度 (Accuracy)
  • 14. 14 FP16 で表現可能な範囲 勾配のアンダーフロー FP16 では勾配が小さく (< 2^-24) なるとアンダーフローする ロス 勾配 勾配が小さくなると FP16 で 表現できず 0 に FP32 で表現可能な範囲 MODEL FP16 Layers
  • 15. 15 ロス スケーリング ロスの値をスケールして FP16 で表現可能な範囲に収める 勾配をスケールダウンして FP32 で更新 MODEL FP16 Layers ロスの値を スケール スケールされた勾配 FP16 で表現可能な範囲 FP32 で表現可能な範囲 元のロス
  • 16. 16 自動混合精度演算 (AMP) の有効化 わずか数行の追加で高速化 詳しくはこちら: https://developer.nvidia.com/automatic-mixed-precision TensorFlow NVIDIA NGC コンテナイメージ 19.07 以降、TF 1.14 以降及び TF 2 以降では、オプティマイザのラッパーが利用可能: opt = tf.train.experimental.enable_mixed_precision_graph_rewrite (opt) Keras mixed precision API in TF 2.1+ for eager execution https://tensorflow.org/api_docs/python/tf/train/experimental/enable_mixed_precision_graph_rewrite PyTorch PyTorch はネイティブに AMP をサポート。詳細は公式ドキュメントを: https://pytorch.org/docs/stable/amp.html https://pytorch.org/docs/stable/notes/amp_examples.html MXNet NVIDIA NGC コンテナイメージ 19.04 以降、MXNet 1.5 以降は、わずかな追加コードで AMP を利用可能: amp.init() amp.init_trainer(trainer) with amp.scale_loss (loss, trainer) as scaled_loss: autograd.backward(scaled_loss) https://mxnet.apache.org/api/python/docs/tutorials/performance/backend/amp.html
  • 17. 17 1.4X 2.0X 1.6X 1.7X 1.9X 2.0X 2.4X 2.7X 2.8X 0.0x 0.5x 1.0x 1.5x 2.0x 2.5x 3.0x WaveGlow TacoTron 2 RN50 Mask R CNN DLRM Jasper GNMT Transformer BERT A100 AMP による混合精度トレーニングが最大 2.8 倍高速に V100 (FP16) と A100 (FP16) の比較 CV ASR RecSys TTS NLP Speedup V100 All results are measured V100 used is DGX-1 (8xV100 16GB). A100 used is s DGX A100 (8xA100 SXM4), except DLRM which uses 1xV100 and 1xA100; all use FP16 RN50 uses MXNET Batch size =192, Mask R CNN uses PyTorch BS = 4 (V100) and BS=16 (A100), DLRM uses PyTorch and BS=32768, Jasper uses PyTorch and BS=32 (V100) and 96 (A10), WaveGlow uses PyTorch and BS=10, TacoTron2 uses PyTorch and BS=104 (V100) and 100 (A100), Transformer uses PyTorch and BS=5120 (V100) and 13312 (A100 and GNMT uses PyTorch and BS=128 (V100) and 256 (A100); BERT Pre-Training Throughput using Pytorch including (2/3)Phase 1 and (1/3)Phase 2 | Phase 1 Seq Len = 128, Phase 2 Seq Len = 512
  • 18. 18 TF32 TENSOR コア FP32 のレンジと FP16 の精度を合わせ持つ新しい数値データ型 ➢ FP32 の指数部、FP16 の仮数部 ➢ FP32 を受け取り、TF32 で乗算して FP32 で加算 ➢ コード変更不要でモデルのトレーニングを高速化 FP32 TENSOR FLOAT 32 (TF32) FP16 BFLOAT16 8 ビット 23 ビット 8 ビット 10 ビット 5 ビット 10 ビット 8 ビット 7 ビット 指数部 仮数部 符号部 FP32 のレンジ FP16 の精度 FP32 行列 FP32 行列 TF32 フォーマットで乗算 FP32 で加算 FP32 行列
  • 19. 19 2.0X 1.9X 2.9X 3.2X 4.2X 4.1X 5.0X 5.1X 5.8X 0.0x 0.5x 1.0x 1.5x 2.0x 2.5x 3.0x 3.5x 4.0x 4.5x 5.0x 5.5x 6.0x 6.5x RN50 Mask R CNN Jasper WaveGlow TacoTron 2 DLRM Transformer GNMT BERT A100 TF32 によりコード変更なしで AI トレーニングを高速化 V100 (FP32) と A100 (TF32) の比較 CV RecSys ASR TTS NLP All results are measured V100 used is DGX-1 (8xV100 16GB). A100 used is s DGX A100 (8xA100 SXM4), except DLRM which uses 1xV100 and 1xA100; V100 uses FP32 and A100 uses TF32 RN50 uses MXNET Batch size = 96, Mask R CNN uses PyTorch BS = 4 (V100) and BS=8 (A100), DLRM uses PyTorch and BS=32768, Jasper uses PyTorch and BS=16,, WaveGlow uses PyTorch and BS=4 (V100) and 10 (A100), TacoTron2 uses PyTorch and BS=48 (V100) and 128 (A100), Transformer uses PyTorch and BS=2560 (V100) and 6656 (A100 and GNMT uses PyTorch and BS=128 (V100) and 512 (A100); BERT Pre-Training Throughput using Pytorch including (2/3)Phase 1 and (1/3)Phase 2 | Phase 1 Seq Len = 128, Phase 2 Seq Len = 512 Speedup V100
  • 20. 20 倍精度演算のピーク性能が 2.5 倍に A100 の Tensor コアは FP64 に対応 1.5x 2x 0 1 2 LSMS BerkeleyGW A100 Speedup vs. V100 (FP64) Application [Benchmarks]: BerkeleyGW [Chi Sum + MTXEL] using DGX-1V (8xV100) and DGX-A100 (8xA100) | LSMS [Fe128] single V100 SXM2 vs. A100 SXM4 • IEEE 754 準拠の倍精度浮動小数点数 • cuBLAS, cuTensor, cuSolver 等のライブラリで対応 NVIDIA V100 FP64 NVIDIA A100 Tensor コア FP64
  • 21. 21 HPC アプリケーションの性能向上 All results are measured Except BerkeleyGW, V100 used is single V100 SXM2. A100 used is single A100 SXM4 More apps detail: AMBER based on PME-Cellulose, GROMACS with STMV (h-bond), LAMMPS with Atomic Fluid LJ-2.5, NAMD with v3.0a1 STMV_NVE Chroma with szscl21_24_128, FUN3D with dpw, RTM with Isotropic Radius 4 1024^3, SPECFEM3D with Cartesian four material model BerkeleyGW based on Chi Sum and uses 8xV100 in DGX-1, vs 8xA100 in DGX A100 1.5X 1.5X 1.6X 1.9X 2.0X 2.1X 1.7X 1.8X 1.9X 0.0x 0.5x 1.0x 1.5x 2.0x A100 Speedup V100 分子動力学 物理 工学 地球科学
  • 22. 22 0 40 80 120 160 200 240 280 320 PME-Cellulose_NVE AMBER Performance Equivalency Single GPU Node vs Multiple Cascade Lake CPU-Only Nodes CPU Server: Dual Xeon Gold [email protected] , GPU Servers: Platinum [email protected] with NVIDIA A100 80GB SXM4 CUDA Version: CUDA 11.1; Dataset: PME-Cellulose_NVE To arrive at CPU node equivalence, we use measured benchmark with up to 8 CPU nodes. Then we use linear scaling to scale beyond 8 nodes. # of CPU Only Nodes 1 node 4x A100 GPUs 140 CPU Nodes 280 CPU Nodes 70 CPU Nodes 1 node 8x A100 GPUs 1 node 2x A100 GPUs AMBER Molecular Dynamics Suite of programs to simulate molecular dynamics on biomolecule VERSION 20.6-AT_20.10 ACCELERATED FEATURES PMEMD Explicit Solvent and GB Implicit Solvent SCALABILITY Multi-GPU and Single Node MORE INFORMATION http://ambermd.org/gpus
  • 24. 24 Multi-Instance GPU (MIG) GPU をハードウェア分割、複数のユーザーに QoS の確保された GPU アクセスを提供 A100 GPU を最大 7 分割: パーティション毎に、専用の演算器、メモリ、L2 キャッシュを 確保、Noisy Neighbor 問題を回避 QoS を確保しつつ、複数のワークロードを同時に実行: MIG インスタンスは予測可能なスループットとレイテンシで 並列に動作 適切な GPU 割り当て: ターゲットワークロードに応じて適切なサイズのインスタンスに 分割可能 様々な環境で利用可能: EC2 を含む仮想環境はもちろん、ベアメタル、 Docker コンテナ、Kubernetes や Slurm のようなオーケストレー ター /ワークロードマネージャの環境をサポート MIG User Guide: https://docs.nvidia.com/datacenter/tesla/mig-user-guide/index.html
  • 25. 25 Multi-Instance GPU (MIG) GPU をハードウェア分割、複数のユーザーに QoS の確保された GPU アクセスを提供 メモリ メモリ メモリ GPU インスタンス 4g.20gb GPU インスタンス 2g.10gb GPU インスタンス 1g.5gb GPU コンピュート インスタンス コンピュート インスタンス 1c.4g.20gb 1c.4g.20gb 1c.4g.20gb 1c.4g.20gb GPC GPC GPC GPC GPC GPC GPC
  • 26. 26 MIG 用語 – インスタンス GPU インスタンスとコンピュート インスタンスから構成される MIG デバイス ● Multi-Instance GPU (MIG) - The MIG feature allows one or more GPU Instances to be allocated within a GPU. Making a single GPU appear as if it were many. ● GPU Instances (GI) - A fully isolated collection of all physical GPU resources. Can contain one or more GPU Compute Instances. Contains one or more Compute Instances. ● Compute Instance (CI) - An isolated collection of GPU SMs (CUDA cores) belongs to a single GPU Instance. Shares GPU memory with other CIs in that GPU Instance. ● Instance Profile - A GPU Instance Profile (GIP) or GPU Compute Instance Profile (CIP) defines the configuration and available resources in an Instance. ● MIG Device - A MIG Device is the actual “GPU” an application sees and it is the combination of a GPU, GPU Instance, and Compute Instance.
  • 27. 28 GPU インスタンス プロファイル GPU Instance Number of Instances Available SMs Memory NVDECs Target use-cases Training Inference 1g.5gb 7 14 5 GB 0 BERT Fine-tuning (e.g. SQuAD), Multiple chatbots, Jupyter notebooks Multiple inference (e.g. TRTIS); ResNet-50, BERT, WnD networks 2g.10gb 3 28 10 GB 1 3g.20gb 2 42 20 GB 2 Training on ResNet-50, BERT, WnD networks 4g.20gb 1 56 20 GB 2 7g.40gb 1 98 40 GB 5 For A100-SXM4-40GB
  • 28. 29 MIG の有効化と無効化 ● GPU 毎に有効化・無効化 ● MIG 有効と無効の GPU が混在可能 ● 使用中のGPUは「保留」状態となり、再起動後に変 更が有効に ● MIG の有効化・無効化にはroot権限が必要 ● 一度設定した有効・無効の状態は、サーバーの再起 動後も有効 # All MIG configuration requires sudo dgxuser@DGXA100:~$ nvidia-smi -i 0 -mig 1 Unable to enable MIG Mode for GPU 00000000:07:00.0: Insufficient Permissions Terminating early due to previous errors. dgxuser@DGXA100:~$ sudo nvidia-smi -i 0 -mig 1 00000000:07:00.0 is currently being used by one or more other processes (e.g. CUDA application or a monitoring application such as another instance of nvidia-smi). Please first kill all processes using the device and retry the command or reboot the system to make MIG mode effective. All done. dgxuser@DGXA100:~$ sudo nvidia-smi -i 0 -mig 1 Warning: MIG mode is in pending enable state for GPU 00000000:07:00.0:In use by another client 00000000:07:00.0 is currently being used by one or more other processes (e.g. CUDA application or a monitoring application such as another instance of nvidia-smi). Please first kill all processes using the device and retry the command or reboot the system to make MIG mode effective. All done. dgxuser@DGXA100:~$ nvidia-smi -q -i 0 | grep -i MIG -A 2 MIG Mode Current : Disabled Pending : Enabled dgxuser@DGXA100:~$ sudo nvidia-smi -i 0 -r The following GPUs could not be reset: GPU 00000000:07:00.0: In use by another client 1 device is currently being used by one or more other processes (e.g., Fabric Manager, CUDA application, graphics application such as an X server, or a monitoring application such as another instance of nvidia-smi). Please first kill all processes using this device and all compute applications running in the system. dgxuser@DGXA100:~$ sudo systemctl stop nvsm dgxuser@DGXA100:~$ sudo systemctl stop dcgm dgxuser@DGXA100:~$ sudo nvidia-smi -i 0 -r GPU 00000000:07:00.0 was successfully reset. All done. dgxuser@DGXA100:~$ nvidia-smi -i 0 --query-gpu=mig.mode.pending,mig.mode.current --format=csv mig.mode.pending, mig.mode.current Enabled, Enabled dgxuser@DGXA100:~$ sudo nvidia-smi -i 0,1,2,3 -mig 1 Enabled MIG Mode for GPU 00000000:07:00.0 Enabled MIG Mode for GPU 00000000:0F:00.0 Enabled MIG Mode for GPU 00000000:47:00.0 Enabled MIG Mode for GPU 00000000:4E:00.0 All done. dgxuser@DGXA100:~$ sudo systemctl start nvsm dgxuser@DGXA100:~$ sudo systemctl start dcgm
  • 29. 30 GA100 と MIG GPU GPC TPC SM SM #1 GPC TPC SM SM #2 GPC TPC SM SM #3 GPC TPC SM SM #4 GPC TPC SM SM #5 GPC TPC SM SM #6 GPC TPC SM SM #7 GPC TPC SM SM #8 #1 #2 #3 #4 #5 #6 #7 #8 GPU GPC TPC SM SM #1 GPC TPC SM SM #2 GPC TPC SM SM #3 GPC TPC SM SM #4 GPC TPC SM SM #5 GPC TPC SM SM #6 GPC TPC SM SM #7 GPC TPC SM SM #8 GA100 全体 8 GPC, 8 TPC/GPC, 2 SM/TPC, 128 SM 通常の GA100 – MIG 無効 7 GPC, 7 or 8 TPC/GPC, 2 SM/TPC, 108 SM GPU GPC TPC SM SM #1 GPC TPC SM SM #2 GPC TPC SM SM #3 GPC TPC SM SM #4 GPC TPC SM SM #5 GPC TPC SM SM #6 GPC TPC SM SM #7 GPC TPC SM SM #8 通常の GA100 – MIG 有効 7 GPC, 7 TPC/GPC, 2 SM/TPC, 98 SM #1 #2 #3 #4 #5 #6 #7 #8
  • 30. 32 Using MIG in Docker Containers Passing through specific MIG devices With MIG disabled the GPU is still specified by the GPU index or GPU UUID. However, when MIG is enabled the device is specified by index in the format <gpu-device-index>:<mig-device- index> or by UUID in the format MIG-<gpu-id>/<gpu-instance-id>/<gpu-compute-instance-id>. Configure MIG (as root) Configure MIG (non-root) MIG monitoring Note: Commands are slightly different on Docker version 18.x (shown here is 19.03+) docker run --cap-add SYS_ADMIN --gpus '"device=0"' -e NVIDIA_MIG_CONFIG_DEVICES="all" nvidia/cuda:9.0-base nvidia-smi docker run --gpus '"device=0:0,0:1"' nvidia/cuda:9.0-base nvidia-smi # MIG ENABLED docker run --cap-add SYS_ADMIN --gpus '"device=0"' -e NVIDIA_MIG_MONITOR_DEVICES="all" nvidia/cuda:9.0-base nvidia-smi chown nobody /proc/driver/nvidia/capabilities/mig/config docker run --cap-add SYS_ADMIN --user nobody --gpus '"device=0"' ¥ -e NVIDIA_MIG_CONFIG_DEVICES="all" nvidia/cuda:9.0-base nvidia-smi docker run --gpus '"device=0,1"' nvidia/cuda:9.0-base nvidia-smi # MIG DISABLED
  • 32. 34 NGC: GPU 最適化 ソフトウェア ハブ 機械学習と HPC のワークフローをシンプルに Innovate Faster Deploy Anywhere Simplify Deployments 学習済みモデル NLP, Classification, Object Detection & more モデル学習スクリプト NLP, Image Classification, Object Detection & more Helm チャート AI applications, K8s cluster, Registry コンテナイメージ DL, ML, HPC
  • 33. 35 継続的なパフォーマンス改善 ソフトウェアの最適化により、同じハードウェアでも性能が向上 ディープラーニングフレームワークと HPC ソフトウェアスタックの月例更新で性能向上 15000 16000 17000 18000 19000 20000 21000 22000 19.03 19.10 Images/Second MxNet 256 Batch Size | ResNet-50 Training v1.5| 16x V100 | DGX-2 8000 9000 10000 11000 12000 13000 14000 15000 19.03 19.10 Images/Second PyTorch 10000 11000 12000 13000 14000 15000 16000 17000 19.05 20.01 Images/Second TensorFlow Speedup across Chroma, GROMACS, LAMMPS, QE, MILC, VASP, SPECFEM3D, NAMD, AMBER, GTC, RTM | 4x V100 v. Dual-Skylake | CUDA 9 for Mar '18 & Nov '18, CUDA 10 for Mar '19 15x 16x 17x 18x Nov '18 Jun '18 Oct '19 HPC Applications 512 Batch Size | ResNet-50 Training v1.5| 16x V100 | DGX-2 512 Batch Size | ResNet-50 Training v1.5| 16x V100 | DGX-2
  • 34. 36 NGC CATALOG IN AWS MARKETPLACE AWS Marketplace で NGC のコンテナー イメージへアクセス NGC のアカウント作成は不要 イメージは ECR から pull する形 NVIDIA AI: MXNet, PyTorch, TensorFlow, Triton Inference Server といったフレームワークやツール NVIDIA Clara Imaging: 医用画像処理 NVIDIA DeepStream SDK: 動画のリアルタイム解析 NVIDIA HPC SDK: HPC 向けのコンパイラ、ライブラリ、ツール群 NVIDIA Isaac Sim ML Training: ロボティクス向けシミュレーター NVIDIA Merlin: レコメンデーション エンジン構築フレームワーク NVIDIA NeMO: 対話型 AI 作成ツールキット NVIDIA RAPIDS: オープンソースのデータサイエンス ライブラリ
  • 35. 37 EC2 で GPU インスタンスを簡単に使うには AWS Marketplace の Deep Learning AMI AWS Deep Learning AMI NVIDIA Deep Learning AMI