-
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
[CPU] [ARM] [INT8] FullyConnected #25171
Open
eshoguli
wants to merge
6
commits into
openvinotoolkit:master
Choose a base branch
from
eshoguli:es/aarch64/int8
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,186
−380
Open
Changes from 3 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
8212473
[CPU] [ARM] FullyConnected: int8 support
eshoguli 7dd226e
[CPU] [ACL] FullyConnected fp32 executor refactoring
eshoguli d4c30c6
cleanup and refactoring
eshoguli 5dbd319
address comments #1
alvoron 03315bf
Merge branch 'master' into es/aarch64/int8
alvoron e6d4880
fixed build
alvoron File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
33 changes: 33 additions & 0 deletions
33
...ommon/low_precision_transformations/include/low_precision/mat_mul_with_dequantization.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,33 @@ | ||
// Copyright (C) 2024 Intel Corporation | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
|
||
#pragma once | ||
|
||
#include <memory> | ||
#include "mat_mul.hpp" | ||
|
||
namespace ov { | ||
namespace pass { | ||
namespace low_precision { | ||
|
||
/** | ||
* @ingroup ov_transformation_common_api | ||
* @brief MatMulWithDequantizationTransformation propagates dequantization operations through MatMul operation and keep dequantisation as is. | ||
* | ||
* For more details about the transformation, refer to | ||
* [MatMulWithDequantizationTransformation](@ref openvino_docs_OV_UG_lpt_MatMulWithDequantizationTransformation) page | ||
* in the OpenVINO Developer Guide. | ||
*/ | ||
class LP_TRANSFORMATIONS_API MatMulWithDequantizationTransformation : public MatMulTransformation { | ||
public: | ||
OPENVINO_RTTI("MatMulWithDequantizationTransformation", "0"); | ||
MatMulWithDequantizationTransformation(const Params& params = Params()); | ||
|
||
protected: | ||
void handleDequantization(const std::shared_ptr<ov::opset1::Multiply>& dequantization) const override; | ||
}; | ||
|
||
} // namespace low_precision | ||
} // namespace pass | ||
} // namespace ov |
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
26 changes: 26 additions & 0 deletions
26
src/common/low_precision_transformations/src/mat_mul_with_dequantization.cpp
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,26 @@ | ||
// Copyright (C) 2024 Intel Corporation | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
|
||
#include "low_precision/mat_mul_with_dequantization.hpp" | ||
|
||
#include <memory> | ||
#include "low_precision/rt_info/bias_attribute.hpp" | ||
|
||
using namespace ov; | ||
using namespace ov::pass; | ||
using namespace ov::pass::low_precision; | ||
|
||
MatMulWithDequantizationTransformation::MatMulWithDequantizationTransformation(const Params& params) : MatMulTransformation(params) { | ||
} | ||
|
||
void MatMulWithDequantizationTransformation::handleDequantization(const std::shared_ptr<ov::opset1::Multiply>& dequantization) const { | ||
const auto& dequantization_constant = is_type<opset1::Constant>(dequantization->get_input_node_shared_ptr(1)) ? | ||
as_type<opset1::Constant>(dequantization->get_input_node_ptr(1)) : | ||
as_type<opset1::Constant>(dequantization->get_input_node_ptr(0)); | ||
if ((dequantization_constant == nullptr) || (ov::shape_size(dequantization_constant->get_shape()) != 1ull)) { | ||
return; | ||
} | ||
|
||
ov::mark_as_bias(dequantization); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
} |
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
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.
Oops, something went wrong.
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.
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.
I believe such reconfiguration should be on plugin's side, not in common LPT code. I'd suggest do the following in CPU's transformation pipeline instead of the current implementation (for ARM platform): We can keep MatMul transformation as is (and not introduce its inheritor), but add an ARM specific transformation which will match on quantized MatMul + multiply, and mark the multiply with the needed attribute.
We already have
additional_main_passes
, which allow to add a custom matcher to LPT pipeline.