-
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
RandomUniformFusion transformation. #7187
RandomUniformFusion transformation. #7187
Conversation
...ngine/src/transformations/src/transformations/common_optimizations/random_uniform_fusion.cpp
Outdated
Show resolved
Hide resolved
LGTM |
...ngine/src/transformations/src/transformations/common_optimizations/random_uniform_fusion.cpp
Show resolved
Hide resolved
…ons for general min and max value case.
...ence-engine/tests/functional/inference_engine/transformations/random_uniform_fusion_test.cpp
Outdated
Show resolved
Hide resolved
...ngine/src/transformations/src/transformations/common_optimizations/random_uniform_fusion.cpp
Outdated
Show resolved
Hide resolved
...ngine/src/transformations/src/transformations/common_optimizations/random_uniform_fusion.cpp
Outdated
Show resolved
Hide resolved
...engine/src/transformations/src/transformations/common_optimizations/common_optimizations.cpp
Show resolved
Hide resolved
...ngine/src/transformations/src/transformations/common_optimizations/random_uniform_fusion.cpp
Outdated
Show resolved
Hide resolved
...ence-engine/tests/functional/inference_engine/transformations/random_uniform_fusion_test.cpp
Outdated
Show resolved
Hide resolved
Co-authored-by: Gleb Kazantaev <[email protected]>
...ngine/src/transformations/src/transformations/common_optimizations/random_uniform_fusion.cpp
Outdated
Show resolved
Hide resolved
...ngine/src/transformations/src/transformations/common_optimizations/random_uniform_fusion.cpp
Outdated
Show resolved
Hide resolved
...ngine/src/transformations/src/transformations/common_optimizations/random_uniform_fusion.cpp
Outdated
Show resolved
Hide resolved
...ngine/src/transformations/src/transformations/common_optimizations/random_uniform_fusion.cpp
Outdated
Show resolved
Hide resolved
Also, why this transformation depends on LinOpSequenceFusion if it supports both RU->Add and RU->Mul fusions. So the order of Mul and Add operations after RU doesn't matter. |
Because I execute RandomUniformMulFusion first, than RandomUniformAddFusion after it. If we have RU -> Add -> Mul, than only Add will be fused. |
Co-authored-by: Gleb Kazantaev <[email protected]>
Discussed this offline. Yes, this transformation doesn't depend on LinOpSequenceFusion. |
…povaan/openvino into random_uniform_transformation
...e/src/transformations/include/transformations/common_optimizations/random_uniform_fusion.hpp
Outdated
Show resolved
Hide resolved
...ngine/src/transformations/src/transformations/common_optimizations/random_uniform_fusion.cpp
Outdated
Show resolved
Hide resolved
…n_optimizations/random_uniform_fusion.cpp Co-authored-by: Gleb Kazantaev <[email protected]>
…povaan/openvino into random_uniform_transformation
* Added RandomUniformFusion transformation. * Extended transformations for case with Convert, extended transformations for general min and max value case. * Set to const unchanged variables. * Apply suggestions from code review Co-authored-by: Gleb Kazantaev <[email protected]> * Reformat code, small corrections. * Added const shape checks. * Fixed transformation for case of different const ranks. * Added type checks. * Apply suggestions from code review Co-authored-by: Gleb Kazantaev <[email protected]> * United RandomUniformMulFusion and RandomUniformAddFusion to single transformation. * Added negative tests. * Used get_constant_from_source(). * Moved transformation to common fusions. * Added const refs. * Update inference-engine/src/transformations/src/transformations/common_optimizations/random_uniform_fusion.cpp Co-authored-by: Gleb Kazantaev <[email protected]> * Changed to single class. * Corrected IRs checks in layer tests. * Small corrections. Co-authored-by: Gleb Kazantaev <[email protected]>
Details:
This pattern is needed for RandomUniform with floating output type and min != 0 or max != 1. In this case Tensorflow generates following subgraph:
After LinOpSequenceFusion we have the following graph:
Mul and Add in this case can be moved to min and max inputs of RandomUniform.
This transformation is valid only for RandomUniform with floating output type.
In case if Convert goes after RandomUniform Convert should also have floating type.
Tickets: