Skip to content
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

Fix onnx model export not always working properly in half precision #119

Merged
merged 4 commits into from
May 30, 2024

Conversation

lorenzomammana
Copy link
Contributor

@lorenzomammana lorenzomammana commented May 29, 2024

Summary

Right now when we export models in half precision using onnx as inference engine there are certain cases where the export doesn't work properly and the produced model only outputs nan values.
This pr introduce the usage of auto_convert_mixed_precision to retry exporting half precision models in mixed precision if the initial export failed

I've manually tested that finetuning, anomaly and segmentation are working properly after the changes, most of the models doesn't suffer form this issue.

Type of Change

  • Bug fix (non-breaking change that solves an issue)

Checklist

Please confirm that the following tasks have been completed:

  • I have tested my changes locally and they work as expected. (Please describe the tests you performed.)
  • I have added unit tests for my changes, or updated existing tests if necessary.
  • I have updated the documentation, if applicable.
  • I have installed pre-commit and run locally for my code changes.

@lorenzomammana lorenzomammana self-assigned this May 29, 2024
@lorenzomammana lorenzomammana added the bug Something isn't working label May 29, 2024
@lorenzomammana lorenzomammana merged commit 7c4aa31 into main May 30, 2024
2 checks passed
@lorenzomammana lorenzomammana deleted the feature/onnx-mixed-precision branch May 30, 2024 09:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants