-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
[TRANSFORMATIONS] Call KeepPrecisionSensitiveInFP32 transformations recursively for internal MultiSubGraph body #28050
Merged
CuriousPanCake
merged 12 commits into
openvinotoolkit:master
from
CuriousPanCake:CVS-158631_real_fix
Dec 17, 2024
Merged
[TRANSFORMATIONS] Call KeepPrecisionSensitiveInFP32 transformations recursively for internal MultiSubGraph body #28050
CuriousPanCake
merged 12 commits into
openvinotoolkit:master
from
CuriousPanCake:CVS-158631_real_fix
Dec 17, 2024
+132
−17
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CuriousPanCake
requested review from
itikhono
and removed request for
a team
December 12, 2024 21:40
github-actions
bot
added
the
category: transformations
OpenVINO Runtime library - Transformations
label
Dec 12, 2024
CuriousPanCake
changed the title
[TRANSFORMATIONS] Add ConvertLike to MVN decomposition
[TRANSFORMATIONS] Make KeepMixedPrecision transformations are called recursively for internal MultiSubGraphBody
Dec 13, 2024
CuriousPanCake
changed the title
[TRANSFORMATIONS] Make KeepMixedPrecision transformations are called recursively for internal MultiSubGraphBody
[TRANSFORMATIONS] Call KeepMixedPrecision transformations recursively for internal MultiSubGraph body
Dec 13, 2024
CuriousPanCake
changed the title
[TRANSFORMATIONS] Call KeepMixedPrecision transformations recursively for internal MultiSubGraph body
[TRANSFORMATIONS] Call KeepPrecisionSensitiveInFP32 transformations recursively for internal MultiSubGraph body
Dec 13, 2024
It may happen that a MultiSubGraph body may contain an MVN node that is usually decomposed into simpler operations. If during ConvertPrecision transformation the inputs of the MultiSubGraph body are converted to a different precision than the original model and MultiSubGraph had (as it's done in the GPU pipeline f32 -> f16), the desired precision for all the nodes appeared during decomposition will be propagated through. However this will not apply to Constants resulting into the error of mixed-precision for binary element-wise operations. Fix it by adding a ConvertLike for the Constant that will be folded and posses the correct desired precision. - Ticket: * CVS-158631 Signed-off-by: Andrii Staikov <[email protected]>
CuriousPanCake
force-pushed
the
CVS-158631_real_fix
branch
from
December 13, 2024 18:18
cdb55d4
to
e04eb57
Compare
CuriousPanCake
commented
Dec 13, 2024
Comment on lines
-68
to
-71
// todo xxx-101766: if we don't skip Results there is an error on GPU | ||
if (ov::as_type_ptr<ov::op::v0::Result>(out_node)) | ||
continue; | ||
|
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.
Removed per discussion with @pavel-esir
itikhono
approved these changes
Dec 16, 2024
pavel-esir
approved these changes
Dec 17, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
[TRANSFORMATIONS] Call KeepPrecisionSensitiveInFP32 transformations recursively for internal MultiSubGraph body
A set of KeepPrecisionSensitiveInFP32 transformations (MarkSugraphsToKeepInMixedPrecision & AlignMixedFP32FP16Types) preserves the output precisions for certain parts of a model that need to remain in high precision, despite the general model conversion to a different precision (like it's done in the GPU pipeline fp32 -> fp16).
The AlignMixedFP32FP16Types transformation makes sure the high precision parts of the graph are surrounded with the required Converts to facilitate with the other parts of the model that have a different precision now. However, this won't take place if the model is an internal body of a MultiSubGraph as the transformation will not be called for it.
Fix it by calling the KeepPrecisionSensitiveInFP32 transformations recursively to make sure each internal body is converted correctly having the required Converts for it.
CVS-158631
Signed-off-by: Andrii Staikov [email protected]