You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Enable AMP (Automatic Mixed Precision ) in Tensorflow Serving. #1583
How do I turn on AMP in serving ? I have observed 50% improvement in processiong time with fp16 over fp32 without any noticeable change in accuracy. Reduced precision is one of the corner stones of Nvidia TensorRT, etc. See this one also - https://medium.com/@whatdhack/neural-network-inference-optimization-8651b95e44ee .
I just ran some tests on a MaskRCNN Saved Model in nvcr.io/nvidia/tensorflow:20.03-tf1-py3. TF_ENABLE_AUTO_MIXED_PRECISION seems to work very well for inference - requires less memory and speeds up significantly. The following are the numbers , if you need more convincing.
Hello @ALL Thank you so much for showing interest! We truly appreciate your enthusiasm and support.
We regret to inform you that we are not accepting new implementation requests or feature additions at this time. Please feel free to fork the repository and submit pull requests if you have any suggestions for enhancements, problem fixes, or ideas. We’d be more than happy to review and collaborate! If you would like to contribute , please follow our CONTRIBUTION GUIDELINES here and submit a pull request.
Thank you again for your interest, and we look forward to seeing your contributions!
BFloat16 Automatic Mixed Precision support has been available on CPU for some time now after #2193.
It can be enabled by adding the --mixed_precision=bfloat16 flag when starting the TensorFlow model server.
Activity
whatdhack commentedon Apr 3, 2020
This I think should be very high priority ( at the least FP16) , otherwise the case for TFS becomes weak.
shadowdragon89 commentedon Apr 10, 2020
The AMP is mainly target on training instead of serving.(https://www.tensorflow.org/guide/keras/mixed_precision)
Have you observed the significant performance difference for serving as well? If so, could you share the benchmark and related numbers?
whatdhack commentedon Apr 12, 2020
How do I turn on AMP in serving ? I have observed 50% improvement in processiong time with fp16 over fp32 without any noticeable change in accuracy. Reduced precision is one of the corner stones of Nvidia TensorRT, etc. See this one also - https://medium.com/@whatdhack/neural-network-inference-optimization-8651b95e44ee .
whatdhack commentedon Apr 13, 2020
Is there a way to do the following in TFS ?
whatdhack commentedon May 14, 2020
I just ran some tests on a MaskRCNN Saved Model in nvcr.io/nvidia/tensorflow:20.03-tf1-py3. TF_ENABLE_AUTO_MIXED_PRECISION seems to work very well for inference - requires less memory and speeds up significantly. The following are the numbers , if you need more convincing.
TF_ENABLE_AUTO_MIXED_PRECISION =1, memory = 4.2GB , inference speed 0.25 sec .
vs
memory = 7.1 GB , inference speed 0.53 sec .
shadowdragon89 commentedon May 14, 2020
Thanks for the experiments and numbers! Based on the number, we could add the option. I will also follow up with our GPU team.
jeisinge commentedon Nov 2, 2020
Any update here? Also, is it possible to enable JIT/XLA as well like #1515 ?
lre commentedon Feb 22, 2022
Any update here?
DerryFitz commentedon Apr 12, 2022
I'd really appreciate this feature being added too
junA2Z commentedon May 17, 2023
Hi, Any updates here?
BobLiu20 commentedon Sep 11, 2023
Hi, Any updates here?
bharatjetti commentedon Mar 16, 2026
Hello @ALL Thank you so much for showing interest! We truly appreciate your enthusiasm and support.
We regret to inform you that we are not accepting new implementation requests or feature additions at this time. Please feel free to fork the repository and submit pull requests if you have any suggestions for enhancements, problem fixes, or ideas. We’d be more than happy to review and collaborate! If you would like to contribute , please follow our CONTRIBUTION GUIDELINES here and submit a pull request.
Thank you again for your interest, and we look forward to seeing your contributions!
alex-chaiko commentedon Mar 25, 2026
BFloat16 Automatic Mixed Precision support has been available on CPU for some time now after #2193.
It can be enabled by adding the
--mixed_precision=bfloat16flag when starting the TensorFlow model server.jeelania10 commentedon Oct 29, 2026
Closing this due to inactivity. Please feel free to reopen and post your comments (if you still have queries on this). Thank you!