How to run float16 on CUDAExecutionProvider #13145
Replies: 3 comments 3 replies
-
CUDA EP supports float16, you need make sure your model uses float16 (like weights shall be in float16) first. You can use https://github.com/microsoft/onnxconverter-common/blob/master/onnxconverter_common/float16.py to convert model from float to float16. |
Beta Was this translation helpful? Give feedback.
-
Hi @tianleiwu , thanks a lot! Do you think converting my models weights to fp16 in pytorch before exporting is sufficient? |
Beta Was this translation helpful? Give feedback.
-
@FrancescoSaverioZuppichini, I recommend export fp32 models, then run graph optimization and finally convert to fp16. It is because some optimization requires that (extra Cast nodes might block some graph optimizations). |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Like title.
Thanks!
Cheers
Beta Was this translation helpful? Give feedback.
All reactions