TPU和GPU跑模型时间统计(持续更新中)以及TPU Research Cloud的申请
下面記錄的訓練時間就是所有數據開始訓練到生成模型為止的時間,代碼中都不包含交叉驗證等策略。
已經嘗試過的實驗如下:
?
| 框架 | 數據集 | 代碼 | 加速設備 | 平臺 | 耗時 |
| ResNet | cifar10 | TPU運行Cifar10.ipynb | TPU | Google Colaboratory | 2000s |
| XGBoost | IEEE-CIS-Fraud-Detection | ieee-fraud-xgboost-with-gpu-fit-in-40s.ipynb | Tesla P100-PCIE-16GB | KaggleNotebook | 38s |
| XGBoost | IEEE-CIS-Fraud-Detection | ieee-fraud-xgboost-with-gpu-fit-in-40s.ipynb | NVIDIA Corporation GK210GL [Tesla K80] (rev a1) | Google Colaboratory | 15min 39s |
| XGBoost | IEEE-CIS-Fraud-Detection | ieee-fraud-xgboost-with-gpu-fit-in-40s.ipynb | Tesla V100-SXM2-16GB | Baidu AIStudio | 30s |
| tf.keras.models.Sequential() | MNIST | colab上使用GPU和TPU比較.ipynb(已經提交bug給Tensorflow,暫不可用) | TPU | Google Colaboratory | 44s |
| tf.keras.models.Sequential() | MNIST | colab上使用GPU和TPU比較.ipynb(已經提交bug給Tensorflow,暫不可用) | NVIDIA Corporation GK210GL [Tesla K80] (rev a1) | Google Colaboratory | 2min |
| torch_xla | MNIST | mnist-training-xrt-1-15.ipynb | TPU | Google Colaboratory | 1min4s |
| torch | rsna_train_stage_1_images_png_224x rsna_test_stage_1_images_png_224x | Pytorch ResNeXt 32x8d CenterCrop-修改數據量 .ipynb | Tesla P100-PCIE-16GB | KaggleNotebook | 約4.5小時/epoch |
?
?
?
如何根據模型選擇最佳平臺呢?結論是:
XGBoost最佳是Baidu AIStudio
Tensorflow最佳選擇是Google Colaboratory
?
?
TPU Research Cloud的申請鏈接是:
https://www.tensorflow.org/tfrc/?hl=zh-cn
注意,不要去問他們設置問題,他們很煩你問設置問題,如果你一次申請完了之后問設置問題,第二次就別想申請了,
他們希望你對google的版面足夠熟悉
?
申請后的配置看了下,略坑,這么點配置根本沒法用來打Kaggle.
pkuappleyuchi@cloudshell:~$ df -H
Filesystem ? ? ?Size ?Used Avail Use% Mounted on
overlay ? ? ? ? ?44G ? 33G ? 11G ?76% /
tmpfs ? ? ? ? ? ?68M ? ? 0 ? 68M ? 0% /dev
tmpfs ? ? ? ? ? 888M ? ? 0 ?888M ? 0% /sys/fs/cgroup
/dev/sda1 ? ? ? ?44G ? 33G ? 11G ?76% /root
/dev/sdb1 ? ? ? 5.2G ? 11M ?4.9G ? 1% /home
shm ? ? ? ? ? ? ?68M ? ? 0 ? 68M ? 0% /dev/shm
overlayfs ? ? ? 1.1M ?168k ?881k ?17% /etc/ssh/ssh_host_rsa_key
tmpfs ? ? ? ? ? 888M ?713k ?887M ? 1% /run/metrics
overlayfs ? ? ? 1.1M ?168k ?881k ?17% /etc/ssh/keys
tmpfs ? ? ? ? ? 888M ? ? 0 ?888M ? 0% /run/google/devshell
?
?
?
?
根據[1]可知,TPU的長處是CNN,而不是LSTM.
Reference:
[1]https://blog.csdn.net/weixin_42137700/article/details/89041913
總結
以上是生活随笔為你收集整理的TPU和GPU跑模型时间统计(持续更新中)以及TPU Research Cloud的申请的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: AttributeError: 'Mod
- 下一篇: GPU代码修改成TPU代码