Titan V 和 Titan Xp 還有 GTX 1080 Ti 在深度學習的應用上,效能到底差了多少呢? 我在這邊提供一些實測結果讓大家在挑選硬體的時候可以有一些參考。
測試的硬體及軟體環境:
系統 : Ubuntu 16.04
GTX 1080 Ti : Tensorflow 1.4, CUDA 8, cuDNN 5, nvidia-381 driver
Titan Xp : Tensorflow 1.4, CUDA 9, cuDNN 7, nvidia-387 driver
Titan V : Tensorflow 1.4, CUDA 9, cuDNN 7, nvidia-387 driver
資料集: cifar-10
神經網路 : Convolution * 6 + fully connected * 2
測試結果為每一個batch,訓練神經網路所用掉的秒數(數字越小表示計算效能越好)
Float32 batchsize 256
1080 Ti : 0.0772
Titan Xp : 0.0691
Titan V : 0.0601
Float32 batchsize 512
1080 Ti : 0.1516
Titan Xp : 0.1410
Titan V : 0.1193
Float16 batchsize 256
1080 Ti : 0.0656
Titan Xp : 0.0675
Titan V : 0.0360
Float16 batchsize 512
1080 Ti : 0.1300
Titan Xp : 0.1349
Titan V : 0.0690
最重要的差距出現在半精度 (float16) 的計算。Titan V 幾乎是 Titan Xp 的兩倍速度。這應該是有用到了Titan V裡面的 tensor core所產生的差異。
另外,以上所列 GTX 1080 Ti 是 founders edition。如果是超頻版,像是Gigabyte GTX 1080 Ti Extreme Edition,那還比 founders edition 快了15% 左右。這還是在沒有做進一步硬體調教的狀況下。這種特殊版本的1080Ti,因為風扇有三個,冷卻效果好很多,GPU 的溫度都比 founder edition低了十度以上。
NVIDIA 所說的 Titan V 十倍的加速,應該是只在比較單純的矩陣運算上 (詳情見此: https://devblogs.nvidia.com/programming-tensor-cores-cuda-9/ ) 。但深度神經網路裡面應該還有除了張量運算之外其他的程序,這些程序大概沒有受惠於tensor core。
依平常會用到的深度學習的應用來說,我想單純在神經網路計算上大概最多就是速度加倍。其實也是滿不錯的結果,有顯現出Volta架構的優點。
這裡有一篇其他人的測試,得到的結果跟我的差不多。 https://www.pcper.com/reviews/Graphics-Cards/NVIDIA-TITAN-V-Review-Part-3-Deep-Learning-Performance
附註 :
用Tensorflow benchmark script ( https://github.com/tensorflow/benchmarks/tree/master/scripts/tf_cnn_benchmarks) 得到的結果:
Titan Xp :
Float32 : images/sec: 212.76
Float16 : images/sec: 252.74
Titan V :
Float32 : images/sec: 257.91
Float16 : images/sec: 411.86
來源: https://www.facebook.com/groups/marketing.gpu/ 葉肇元醫師實測數據