TensorFlow Guide参考手册
表现 | Performance
Benchmarks(基准)
概观
在多个平台上测试了一系列图像分类模型,为TensorFlow社区创建了参考点。Methodology部分详细说明了测试如何执行并且链接到了所使用的脚本。
图像分类模型的结果
使用ImageNet数据集对InceptionV3(arXiv:1512.00567),ResNet-50(arXiv:1512.03385),ResNet-152(arXiv:1512.03385),VGG16(arXiv:1409.1556)和AlexNet进行测试。测试在Google Compute Engine,Amazon Elastic Compute Cloud(Amazon EC2)和NVIDIA®DGX-1™上运行。大部分测试都使用合成和真实数据来运行。用合成数据进行测试是通过使用atf.Variable
设置为与每个模型预期的ImageNet数据相同的形状。我们认为,在对平台进行基准测试时,包括实际数据测量是非常重要的。此负载测试底层硬件和框架以准备实际培训的数据。我们从合成数据开始,将磁盘I / O作为变量移除并设置基线。然后使用真实数据验证TensorFlow输入管道和底层磁盘I / O是否使计算单元饱和。
使用NVIDIA®DGX-1™(NVIDIA®Tesla®P100)进行训练
详细信息和其他结果详见NVIDIA®DGX-1™(NVIDIA®Tesla®P100)部分。
使用NVIDIA®Tesla®K80进行训练
有关Google Compute Engine(NVIDIA®Tesla®K80)的详细信息以及其他详细信息,请参阅Amazon EC2(NVIDIA®Tesla®K80)的详细信息部分。
使用NVIDIA®Tesla®K80进行分布式训练
有关详细信息和其他结果,请参阅Amazon EC2分布式(NVIDIA®Tesla®K80)部分的详细信息。
比较合成和真实数据训练
NVIDIA® Tesla® P100
NVIDIA® Tesla® K80
NVIDIA®DGX-1™(NVIDIA®Tesla®P100)
环境
- Instance type: NVIDIA® DGX-1™
- GPU: 8x NVIDIA® Tesla® P100
- OS: Ubuntu 16.04 LTS with tests run via Docker
- CUDA / cuDNN: 8.0 / 5.1
- TensorFlow GitHub hash: b1e174e
- Benchmark GitHub hash: 9165a70
- Build Command:
bazel build -c opt --copt=-march="haswell" --config=cuda //tensorflow/tools/pip_package:build_pip_package
- Disk: Local SSD
- DataSet: ImageNet
- Test Date: May 2017
下表列出了每种型号使用的批量和优化器。除表中列出的批量大小外,还对InceptionV3,ResNet-50,ResNet-152和VGG16进行了批量大小为32的测试。这些结果位于其他结果部分。
Options | InceptionV3 | ResNet-50 | ResNet-152 | AlexNet | VGG16 |
---|---|---|---|---|---|
Batch size per GPU | 64 | 64 | 64 | 512 | 64 |
Optimizer | sgd | sgd | sgd | sgd | sgd |
用于每个型号的配置。
Model | variable_update | local_parameter_device |
---|---|---|
InceptionV3 | parameter_server | cpu |
ResNet50 | parameter_server | cpu |
ResNet152 | parameter_server | cpu |
AlexNet | replicated (with NCCL) | n/a |
VGG16 | replicated (with NCCL) | n/a |
Results
训练合成数据
GPUs | InceptionV3 | ResNet-50 | ResNet-152 | AlexNet | VGG16 |
---|---|---|---|---|---|
1 | 142 | 219 | 91.8 | 2987 | 154 |
2 | 284 | 422 | 181 | 5658 | 295 |
4 | 569 | 852 | 356 | 10509 | 584 |
8 | 1131 | 1734 | 716 | 17822 | 1081 |
训练真实的数据
GPUs | InceptionV3 | ResNet-50 | ResNet-152 | AlexNet | VGG16 |
---|---|---|---|---|---|
1 | 142 | 218 | 91.4 | 2890 | 154 |
2 | 278 | 425 | 179 | 4448 | 284 |
4 | 551 | 853 | 359 | 7105 | 534 |
8 | 1079 | 1630 | 708 | N/A | 898 |
由于最大化了输入流水线,所以在上面的图表和表格中排除了在8个GPU上使用真实数据训练AlexNet。
其他结果
下面的结果都是批量大小32。
训练合成数据
GPUs | InceptionV3 | ResNet-50 | ResNet-152 | VGG16 |
---|---|---|---|---|
1 | 128 | 195 | 82.7 | 144 |
2 | 259 | 368 | 160 | 281 |
4 | 520 | 768 | 317 | 549 |
8 | 995 | 1485 | 632 | 820 |
训练真实的数据
GPUs | InceptionV3 | ResNet-50 | ResNet-152 | VGG16 |
---|---|---|---|---|
1 | 130 | 193 | 82.4 | 144 |
2 | 257 | 369 | 159 | 253 |
4 | 507 | 760 | 317 | 457 |
8 | 966 | 1410 | 609 | 690 |
Google Compute Engine(NVIDIA®Tesla®K80)的详细信息
环境
- Instance type: n1-standard-32-k80x8
- GPU: 8x NVIDIA® Tesla® K80
- OS: Ubuntu 16.04 LTS
- CUDA / cuDNN: 8.0 / 5.1
- TensorFlow GitHub hash: b1e174e
- Benchmark GitHub hash: 9165a70
- Build Command:
bazel build -c opt --copt=-march="haswell" --config=cuda //tensorflow/tools/pip_package:build_pip_package
- Disk: 1.7 TB Shared SSD persistent disk (800 MB/s)
- DataSet: ImageNet
- Test Date: May 2017
下表列出了每种型号使用的批量和优化器。除表中列出的批量外,InceptionV3和ResNet-50的批量为32个。这些结果在其他结果部分。
Options | InceptionV3 | ResNet-50 | ResNet-152 | AlexNet | VGG16 |
---|---|---|---|---|---|
Batch size per GPU | 64 | 64 | 32 | 512 | 32 |
Optimizer | sgd | sgd | sgd | sgd | sgd |
用于每个模型的配置variable_update
等于parameter_server
和local_parameter_device
等于cpu
。
结果
训练合成数据
GPUs | InceptionV3 | ResNet-50 | ResNet-152 | AlexNet | VGG16 |
---|---|---|---|---|---|
1 | 30.5 | 51.9 | 20.0 | 656 | 35.4 |
2 | 57.8 | 99.0 | 38.2 | 1209 | 64.8 |
4 | 116 | 195 | 75.8 | 2328 | 120 |
8 | 227 | 387 | 148 | 4640 | 234 |
训练真实的数据
GPUs | InceptionV3 | ResNet-50 | ResNet-152 | AlexNet | VGG16 |
---|---|---|---|---|---|
1 | 30.6 | 51.2 | 20.0 | 639 | 34.2 |
2 | 58.4 | 98.8 | 38.3 | 1136 | 62.9 |
4 | 115 | 194 | 75.4 | 2067 | 118 |
8 | 225 | 381 | 148 | 4056 | 230 |
其他结果
训练合成数据
GPUs | InceptionV3 (batch size 32) | ResNet-50 (batch size 32) |
---|---|---|
1 | 29.3 | 49.5 |
2 | 55.0 | 95.4 |
4 | 109 | 183 |
8 | 216 | 362 |
训练真实数据
GPUs | InceptionV3 (batch size 32) | ResNet-50 (batch size 32) |
---|---|---|
1 | 29.5 | 49.3 |
2 | 55.4 | 95.3 |
4 | 110 | 186 |
8 | 216 | 359 |
Amazon EC2的详细信息(NVIDIA®Tesla®K80)
环境
- Instance type: p2.8xlarge
- GPU: 8x NVIDIA® Tesla® K80
- OS: Ubuntu 16.04 LTS
- CUDA / cuDNN: 8.0 / 5.1
- TensorFlow GitHub hash: b1e174e
- Benchmark GitHub hash: 9165a70
- Build Command:
bazel build -c opt --copt=-march="haswell" --config=cuda //tensorflow/tools/pip_package:build_pip_package
- Disk: 1TB Amazon EFS (burst 100 MiB/sec for 12 hours, continuous 50 MiB/sec)
- DataSet: ImageNet
- Test Date: May 2017
下表列出了每种型号使用的批量和优化器。除表中列出的批量外,InceptionV3和ResNet-50的批量为32个。这些结果在其他结果部分。
Options | InceptionV3 | ResNet-50 | ResNet-152 | AlexNet | VGG16 |
---|---|---|---|---|---|
Batch size per GPU | 64 | 64 | 32 | 512 | 32 |
Optimizer | sgd | sgd | sgd | sgd | sgd |
用于每个型号的配置。
Model | variable_update | local_parameter_device |
---|---|---|
InceptionV3 | parameter_server | cpu |
ResNet-50 | replicated (without NCCL) | gpu |
ResNet-152 | replicated (without NCCL) | gpu |
AlexNet | parameter_server | gpu |
VGG16 | parameter_server | gpu |
结果
训练合成数据
GPUs | InceptionV3 | ResNet-50 | ResNet-152 | AlexNet | VGG16 |
---|---|---|---|---|---|
1 | 30.8 | 51.5 | 19.7 | 684 | 36.3 |
2 | 58.7 | 98.0 | 37.6 | 1244 | 69.4 |
4 | 117 | 195 | 74.9 | 2479 | 141 |
8 | 230 | 384 | 149 | 4853 | 260 |
训练真实的数据
GPUs | InceptionV3 | ResNet-50 | ResNet-152 | AlexNet | VGG16 |
---|---|---|---|---|---|
1 | 30.5 | 51.3 | 19.7 | 674 | 36.3 |
2 | 59.0 | 94.9 | 38.2 | 1227 | 67.5 |
4 | 118 | 188 | 75.2 | 2201 | 136 |
8 | 228 | 373 | 149 | N/A | 242 |
由于我们的EFS设置没有提供足够的吞吐量,所以在上面的图表和表格中排除了使用8个GPU上的真实数据训练AlexNet。
其他结果
训练合成数据
GPUs | InceptionV3 (batch size 32) | ResNet-50 (batch size 32) |
---|---|---|
1 | 29.9 | 49.0 |
2 | 57.5 | 94.1 |
4 | 114 | 184 |
8 | 216 | 355 |
训练真实的数据
GPUs | InceptionV3 (batch size 32) | ResNet-50 (batch size 32) |
---|---|---|
1 | 30.0 | 49.1 |
2 | 57.5 | 95.1 |
4 | 113 | 185 |
8 | 212 | 353 |
Amazon EC2分布式(NVIDIA®Tesla®K80)
环境
- Instance type: p2.8xlarge
- GPU: 8x NVIDIA® Tesla® K80
- OS: Ubuntu 16.04 LTS
- CUDA / cuDNN: 8.0 / 5.1
- TensorFlow GitHub hash: b1e174e
- Benchmark GitHub hash: 9165a70
- Build Command:
bazel build -c opt --copt=-march="haswell" --config=cuda //tensorflow/tools/pip_package:build_pip_package
- Disk: 1.0 TB EFS (burst 100 MB/sec for 12 hours, continuous 50 MB/sec)
- DataSet: ImageNet
- Test Date: May 2017
表中列出了用于测试的批量大小和优化程序。除表中列出的批量外,InceptionV3和ResNet-50的批量为32个。这些结果在其他结果部分。
Options | InceptionV3 | ResNet-50 | ResNet-152 |
---|---|---|---|
Batch size per GPU | 64 | 64 | 32 |
Optimizer | sgd | sgd | sgd |
用于每个型号的配置。
Model | variable_update | local_parameter_device | cross_replica_sync |
---|---|---|---|
InceptionV3 | distributed_replicated | n/a | True |
ResNet-50 | distributed_replicated | n/a | True |
ResNet-152 | distributed_replicated | n/a | True |
为了简化服务器设置,运行工作服务器的EC2实例(p2.8xlarge)也运行参数服务器。使用了相同数量的参数服务器和工作服务器,但有以下例外情况:
- InceptionV3:8个实例/ 6个参数服务器
- ResNet-50 :(批量大小32)8个实例/ 4个参数服务器
- ResNet-152:8个实例/ 4个参数服务器
结果
训练合成数据
GPUs | InceptionV3 | ResNet-50 | ResNet-152 |
---|---|---|---|
1 | 29.7 | 52.4 | 19.4 |
8 | 229 | 378 | 146 |
16 | 459 | 751 | 291 |
32 | 902 | 1388 | 565 |
64 | 1783 | 2744 | 981 |
其他结果
训练合成数据
GPUs | InceptionV3 (batch size 32) | ResNet-50 (batch size 32) |
---|---|---|
1 | 29.2 | 48.4 |
8 | 219 | 333 |
16 | 427 | 667 |
32 | 820 | 1180 |
64 | 1608 | 2315 |
方法
该脚本在各种平台上运行,以生成上述结果。高性能模型详细介绍了脚本中的技术以及如何执行脚本的示例。
为了创建尽可能重复的结果,每次测试运行5次,然后将时间平均在一起。GPU在给定平台上以默认状态运行。对于NVIDIA®Tesla®K80而言,这意味着要放在GPU Boost上。对于每个测试,完成10个预热步骤,然后对接下来的100个步骤进行平均。
表现 | Performance相关
TensorFlow是谷歌基于DistBelief进行研发的第二代人工智能学习系统,其命名来源于本身的运行原理。Tensor(张量)意味着N维数组,Flow(流)意味着基于数据流图的计算,TensorFlow为张量从流图的一端流动到另一端计算过程。TensorFlow是将复杂的数据结构传输至人工智能神经网中进行分析和处理过程的系统。
主页 | https://www.tensorflow.org/ |
源码 | https://github.com/tensorflow/tensorflow |
版本 | Guide |
发布版本 | 1.4 |