-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
[MO] relax condition for casting into FP16 #8083
[MO] relax condition for casting into FP16 #8083
Conversation
…hen potentially dangerous clipping is done
@evolosen, please review it as well. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We discussed to proceed with different solution, namely, to fuse the sub-graph into MVN operation with original epsilon value.
As we agreed on Friday (19 Nov) moved small eps modifying transformation in specific patterns into nGraph with separate PR. But the current PR is still needed. |
Closing since old mechanism to convert to FP16 will not be supported in MO. |
Root cause and solution 1: In some models -inf values are present in the original FW file, and these models after conversion into FP16 work correctly. But in #6590 strong condition for limit check was introduced. Need to relax limit check condition in
ChangeOutputTypeAttributes.py
.Ticket: CVS-65735
Root cause and solution 2: In some models patternsinput_1/Maximum(input_2, eps)
andinput_1/Add(input_2, eps)
are used to prevent division to zero. But usually in FP32 networks eps is such small (e.g. 1e-9, 1e-12, ...) that after casting to FP16 it's collapsed to zero. This can lead to division to zero if input_2 is also zero. To prevent that we change eps to FP16 smallest normal value in such patterns in transformationDivisionToZeroFP16Resolver.py
.Moved solution 2 into nGraph and created separate PR #8676
Ticket: xxx-66045
Code:
Validation:
Dien
there are some problems but they are caused not by my changesDocumentation: