Tensorflow train speed mit mehreren GPU´s
Verfasst: Montag 4. Januar 2021, 17:55
Ich habe derzeit ein Problem mit der Geschwindigkeit des Trainings eines neuen Tensorflow-Modells. Eigentlich bin ich davon ausgegangen, dass sich die Geschwindigkeit des Trainings deutlich erhöht, wenn ich mehr als eine GPU für das Training verwende. Ich habe jedoch herausgefunden, dass dies nicht der Fall ist. Nach mehreren Tests lokal und in der Google Cloud bin ich langsam ratlos, wie ich die Geschwindigkeit deutlich erhöhen kann. Vielleicht hat ja jemand einen Tipp, wie ich das Training beschleunigen kann. Derzeit werden knapp über 10.000 Bilder mit einer Bildgröße von 628 x 628 trainiert. Das ganze geschieht mit yolov3.
Lokale Umgebung:
absl-py==0.11.0
astor==0.8.1
cycler==0.10.0
gast==0.4.0
grpcio==1.34.0
h5py==2.10.0
imageai==2.1.5
importlib-metadata==2.1.1
Keras==2.2.4
Keras-Applications==1.0.8
Keras-Preprocessing==1.1.2
kiwisolver==1.1.0
Markdown==3.2.2
matplotlib==3.0.3
mock==3.0.5
numpy==1.18.5
opencv-python==4.2.0.32
Pillow==7.2.0
protobuf==3.14.0
pyparsing==2.4.7
python-dateutil==2.8.1
PyYAML==5.3.1
scipy==1.4.1
six==1.15.0
tensorboard==1.12.2
tensorflow-estimator==1.13.0
tensorflow-gpu==1.12.0
termcolor==1.1.0
Werkzeug==1.0.1
zipp==1.2.0
Ryzen 5 3600, Nvidia 1060 (6 GB), 50 GB RAM
Cloud Umgebung:
absl-py==0.11.0
astor==0.8.1
cycler==0.10.0
gast==0.4.0
grpcio==1.34.0
h5py==2.10.0
imageai==2.1.5
importlib-metadata==2.1.1
Keras==2.2.4
Keras-Applications==1.0.8
Keras-Preprocessing==1.1.2
kiwisolver==1.1.0
Markdown==3.2.2
matplotlib==3.0.3
mock==3.0.5
numpy==1.18.5
opencv-python==4.2.0.32
Pillow==7.2.0
protobuf==3.14.0
pyparsing==2.4.7
python-dateutil==2.8.1
PyYAML==5.3.1
scipy==1.4.1
six==1.15.0
tensorboard==1.12.2
tensorflow-estimator==1.13.0
tensorflow-gpu==1.12.0
termcolor==1.1.0
Werkzeug==1.0.1
zipp==1.2.0
16 vCPU, 60 GB RAM, 4 x NVIDIA Tesla T4
Meine Zeiten pro Epoche:
1x Nvidia 1060 with a batch size of 4 = 2,97 hours
1x Tesla T4 with a batch size of 12 = 1,19 hours
2x Tesla T4 with a batch size of 12 = 3,37 hours
2x Tesla T4 with a batch size of 24 = 3,37 hours
Warum dauert das Training mit zwei Tesla T4 länger als mit nur einer und warum ist die Trainingszeit bei einer höheren batch size nicht schneller?
Ich bin für jeden Hinweis dankbar.
Lokale Umgebung:
absl-py==0.11.0
astor==0.8.1
cycler==0.10.0
gast==0.4.0
grpcio==1.34.0
h5py==2.10.0
imageai==2.1.5
importlib-metadata==2.1.1
Keras==2.2.4
Keras-Applications==1.0.8
Keras-Preprocessing==1.1.2
kiwisolver==1.1.0
Markdown==3.2.2
matplotlib==3.0.3
mock==3.0.5
numpy==1.18.5
opencv-python==4.2.0.32
Pillow==7.2.0
protobuf==3.14.0
pyparsing==2.4.7
python-dateutil==2.8.1
PyYAML==5.3.1
scipy==1.4.1
six==1.15.0
tensorboard==1.12.2
tensorflow-estimator==1.13.0
tensorflow-gpu==1.12.0
termcolor==1.1.0
Werkzeug==1.0.1
zipp==1.2.0
Ryzen 5 3600, Nvidia 1060 (6 GB), 50 GB RAM
Cloud Umgebung:
absl-py==0.11.0
astor==0.8.1
cycler==0.10.0
gast==0.4.0
grpcio==1.34.0
h5py==2.10.0
imageai==2.1.5
importlib-metadata==2.1.1
Keras==2.2.4
Keras-Applications==1.0.8
Keras-Preprocessing==1.1.2
kiwisolver==1.1.0
Markdown==3.2.2
matplotlib==3.0.3
mock==3.0.5
numpy==1.18.5
opencv-python==4.2.0.32
Pillow==7.2.0
protobuf==3.14.0
pyparsing==2.4.7
python-dateutil==2.8.1
PyYAML==5.3.1
scipy==1.4.1
six==1.15.0
tensorboard==1.12.2
tensorflow-estimator==1.13.0
tensorflow-gpu==1.12.0
termcolor==1.1.0
Werkzeug==1.0.1
zipp==1.2.0
16 vCPU, 60 GB RAM, 4 x NVIDIA Tesla T4
Meine Zeiten pro Epoche:
1x Nvidia 1060 with a batch size of 4 = 2,97 hours
1x Tesla T4 with a batch size of 12 = 1,19 hours
2x Tesla T4 with a batch size of 12 = 3,37 hours
2x Tesla T4 with a batch size of 24 = 3,37 hours
Warum dauert das Training mit zwei Tesla T4 länger als mit nur einer und warum ist die Trainingszeit bei einer höheren batch size nicht schneller?
Ich bin für jeden Hinweis dankbar.