forked from openvinotoolkit/openvino
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into an/general_fix_fp16
- Loading branch information
Showing
80 changed files
with
2,652 additions
and
298 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: Take Issue | ||
|
||
on: | ||
issue_comment: | ||
types: | ||
- created | ||
- edited | ||
|
||
jobs: | ||
take-issue: | ||
name: Take issue | ||
runs-on: ubuntu-latest | ||
permissions: | ||
issues: write | ||
timeout-minutes: 10 | ||
steps: | ||
- name: take an issue | ||
uses: bdougie/[email protected] | ||
with: | ||
message: Thank you for looking into this issue! Please let us know if you have any questions or require any help. | ||
issueCurrentlyAssignedMessage: Thanks for being interested in this issue. It looks like this ticket is already assigned to a contributor. Please communicate with the assigned contributor to confirm the status of the issue. | ||
trigger: .take | ||
token: ${{ secrets.GITHUB_TOKEN }} |
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
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
66 changes: 66 additions & 0 deletions
66
...mon/transformations/include/transformations/symbolic_transformations/dereshape_matmul.hpp
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
// Copyright (C) 2018-2023 Intel Corporation | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
|
||
#pragma once | ||
|
||
#include "openvino/pass/graph_rewrite.hpp" | ||
#include "transformations_visibility.hpp" | ||
|
||
namespace ov { | ||
namespace pass { | ||
class TRANSFORMATIONS_API DeReshapeMatMul; | ||
} // namespace pass | ||
} // namespace ov | ||
|
||
/** | ||
* @ingroup ie_transformation_common_api | ||
* @brief Transformation uses symbol / label information to optimize out Reshape operations surrounding MatMul. | ||
* It checks that surrounding Reshapes are only manipulating with batch dimensions of tensor in a do-undo kind of way. | ||
* | ||
* Example: | ||
* Before: | ||
* [A,B,C,D] -> Reshape -> [A*B,C,D] | ||
* MatMul [A*B,C,E] -> Reshape -> [A,B,C,E] | ||
* [A,B,D,E] -> Reshape -> [A*B,D,E] | ||
* | ||
* After: | ||
* [A,B,C,D] -> | ||
* MatMul -> [A,B,C,E] | ||
* [A,B,D,E] -> | ||
* | ||
* Transformation allows slightly different variations of the pattern on inputs of MatMul. | ||
* - Simplest pattern contains only Reshape operation on MatMul input: | ||
* Reshape -> MatMul | ||
* | ||
* - The next acceptable variation is Concat of two inputs on MatMul input: | ||
* Reshape -[-> Concat -]-> MatMul | ||
* This variation would be transformed with realignment of the other input of Concat and the other outputs of | ||
* Concat with the help of Reshape operations | ||
* | ||
* - The most complex variation on the MatMul input pattern is with Binary Elementwise Operation with scalar second | ||
* input: Reshape -[-> Concat -]-[-> BEA (scalar) -]-> MatMul | ||
* | ||
* Additionally, transformation supports variation of the pattern on output of MatMul. It allows for | ||
* Binary Elementwise Arithmetic operation without second input scalar restriction. | ||
* MatMul -[-> BEA -]-> Reshape | ||
* this pattern variation is only applicable for the case when input reshapes are 4D -> 3D and output reshape is 3D -> | ||
* 4D. Additionally, shape labels on output of MatMul should be equal to the input shape labels of the last Reshape, | ||
* meaning that this Binary Elementwise Arithmetic doesn't perform any broadcasting of input coming from MatMul -- only | ||
* other input may be broadcasted to the MatMul input of this BEA. This effect (equality of MatMul output shape labels | ||
* and output shape of BEA) is being handled by LabelResolvingThroughSelect transformation in the particular models | ||
* that this variation targets. | ||
* | ||
* Full pattern this transformation searches for: | ||
* -> Reshape -[-> Concat -]-[-> BEA (scalar) -]-> | ||
* MatMul -[-> BEA -]-> Reshape -> | ||
* -> Reshape -[-> Concat -]-[-> BEA (scalar) -]-> | ||
* | ||
* NOTE: input branches could be (and in observed model cases are) asymmetrical, meaning that the presence of Concat | ||
* on one input of MatMul doesn't require the other input to also have Concat | ||
*/ | ||
class ov::pass::DeReshapeMatMul : public ov::pass::MatcherPass { | ||
public: | ||
OPENVINO_RTTI("DeReshapeMatMul", "0"); | ||
DeReshapeMatMul(); | ||
}; |
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
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
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
Oops, something went wrong.