Can FP16 speed-up translation?
Description
We are trying to transform a regular FP32 transformer-big model into a much smaller FP16 one. We successfully down-scaled all values so that now our model on disk is (roughly) half the size.
The problem is that, when we run the decoding, the GPU RAM used is exactly the same of the FP32 model and also the decoding time is the same. I suspect that, for some reason, the model is somehow re-converted back to FP32 on the fly by tensor2tensor/tensorflow right after the loading, and we a re still translating with a 32-bit model.
Is there something obvious that I'm missing?
Thanks for the help.
Environment information
OS: Ubuntu 16.04
$ pip freeze | grep tensor
tensor2tensor==1.6.3
tensorboard==1.8.0
tensorflow-gpu==1.8.0
$ python -V
Python 2.7.12
Both the training and decoding process can be accelerated by FP16, I have tried on Titan V by Fairseq system. As you said, I think you should check if your device support the FP16 accelerated , only Volta 100 and Titan V can achieve good support. By the way, I don't now how to use FP16 to train my model on GPU device , if you now, it's appreciate to tell me how
Unfortunately no luck with t2t, no idea how to train in fp16, and we were unable to even decode with fp16 (as I said in the first post, everything seems to be re-converted backto fp32).
On fairseq on the contrary we observed some improvements, however we had no success into "porting" those ideas on t2t.
Yeah, the same as mine, I found it will gain 2.6-2.9 faster training with FP16 Transformer Big using Fairseq, it seems that the bigger structure you train , the faster speed you will gain. And I saw it really support FP16 training on TPU device, so it may be feasible on GPU with some details to fix!!!
Hi, is there any progress for it ? We also wanna accelerate the decoding speed by FP16.
mark