RangiLyu / nanodet

NanoDet-Plus⚡Super fast and lightweight anchor-free object detection model. 🔥Only 980 KB(int8) / 1.8MB (fp16) and run 97FPS on cellphone🔥
Apache License 2.0
5.63k stars 1.03k forks source link

AMP没有提升训练速度 #506

Open geoffzhang opened 1 year ago

geoffzhang commented 1 year ago

您好,我在配置文件中将precision设置为16和设置为32,训练的速度是差不多的,请问是为什么? device: gpu_ids: [1] # Set like [0, 1, 2, 3] if you have multi-GPUs workers_per_gpu: 10 batchsize_per_gpu: 96 precision: 16 # set to 16 to use AMP training

RangiLyu commented 1 year ago

如果是30系之后的显卡,因为默认会启用TF32加速,所以FP16提速不明显,也有可能是因为你的计算瓶颈不在GPU而是在数据读取或是数据预处理。 AMP更多的使用来节省显存,增大batch size。

geoffzhang commented 1 year ago

@RangiLyu ,显卡使用的是A40,计算的瓶颈是在GPU上,这个是测试过的。所以说在这种显卡上FP16加速就不明显了是吧,请问还有什么有效提升训练速度的方法。