-
Notifications
You must be signed in to change notification settings - Fork 7.2k
Use onnx function only in tracing mode #5468
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
💊 CI failures summary and remediationsAs of commit 7ca71f0 (more details on the Dr. CI page):
1 failure not recognized by patterns:
This comment was automatically generated by Dr. CI (expand for details).Please report bugs/suggestions to the (internal) Dr. CI Users group. |
Hi @datumbox and @prabhat00155 , do you think that we should also add a unit-test for SSD and fcos when exporting to ONNX, as I know, the downstream TVM also use the JIT tracing mode. |
@zhiqwang If you have the capacity to do this on a follow up PR that would be lovely. One issue we faced previously with onnx unit-tests is that they are very brittle and easy to break. I personally don't have much experience working with ONNX so if you can do it, I'll take it 😄 |
Hi @datumbox
I can try to add it! Recently I also found that TensorRT 8.2+ has very good support for ONNX. It will become very easy for one stage models (SSD / RetineNet / Fcos) to be deployed on TensorRT through ONNX. |
Co-authored-by: Shubham Bhokare <32080845+shubhambhokare1@users.noreply.github.com>
Summary: * Use onnx function only in tracing mode * Add missing import * Address review comments * Fix type annotation * Ignore return type error * Remove unused import * Add fake cast * Fix mypy error * Fix mypy error * Update torchvision/models/detection/_utils.py * _fake_cast_onnx approach Reviewed By: jdsgomes Differential Revision: D34475312 fbshipit-source-id: 09b14cba0242d2e433051707c9081e25bc9cecbc Co-authored-by: Shubham Bhokare <32080845+shubhambhokare1@users.noreply.github.com> Co-authored-by: Vasilis Vryniotis <datumbox@users.noreply.github.com> Co-authored-by: Shubham Bhokare <32080845+shubhambhokare1@users.noreply.github.com>
#5310 introduced extra operations that may affect performance. Adding conditional checks to only use onnx functions when in tracing mode.