Skip to content

OpenVINO™ is an open source toolkit for optimizing and deploying AI inference

[LPT] MatMul: remove useless zero point check (#28956)

Vladislav Golubeva601c9a96d1f
diff --git a/src/common/low_precision_transformations/src/mat_mul.cpp b/src/common/low_precision_transformations/src/mat_mul.cpp
index b153173d264..6c1011a8589 100644
--- a/src/common/low_precision_transformations/src/mat_mul.cpp
+++ b/src/common/low_precision_transformations/src/mat_mul.cpp
@@ -214,10 +214,6 @@ bool MatMulTransformation::canBeTransformed(const std::shared_ptr<Node>& layer)
return false;
}
}
-
- if (!NetworkHelper::checkZeroPoint(dequantization1.subtract)) {
- return false;
- }
} else {
return false;
}
diff --git a/src/plugins/intel_cpu/tests/functional/shared_tests_instances/low_precision_transformations/x64/mat_mul_with_constant_transformation.cpp b/src/plugins/intel_cpu/tests/functional/shared_tests_instances/low_precision_transformations/x64/mat_mul_with_constant_transformation.cpp
index db0e6b50568..444743a242d 100644
--- a/src/plugins/intel_cpu/tests/functional/shared_tests_instances/low_precision_transformations/x64/mat_mul_with_constant_transformation.cpp
+++ b/src/plugins/intel_cpu/tests/functional/shared_tests_instances/low_precision_transformations/x64/mat_mul_with_constant_transformation.cpp
@@ -10,10 +10,10 @@ using namespace LayerTestsDefinitions;
namespace {
const std::vector<ov::element::Type> precisions = {
- ov::element::f32
+ ov::element::f32
};
-//transpose_a = false, transpose_b = true
+// transpose_a = false, transpose_b = true
std::vector<MatMulWithConstantTransformationTestValues> testValues = {
// 3D with different values
{
@@ -110,7 +110,17 @@ std::vector<MatMulWithConstantTransformationTestValues> testValues = {
{ ov::element::f32, {}, {0.1f} },
"FullyConnected",
"u8"
- }
+ },
+ // 2D with unusual subtract on activations & Dq on weights
+ {
+ { 2, 3 },
+ { 256ul, {{1, 1}, {1, 1}, {1, 1}, {1, 1}}, {-128.f}, {383.f}, {0.5f}, {1.5f} },
+ { std::vector<float>{1, 2, 3, 4, 5, 6}, ov::element::i8, ov::Shape{ 2, 3 } },
+ {},
+ { ov::element::f32, {}, {0.1f} },
+ "FullyConnected",
+ "u8"
+ },
};
INSTANTIATE_TEST_SUITE_P(smoke_LPT, MatMulWithConstantTransformation,
diff --git a/src/plugins/intel_gpu/tests/functional/shared_tests_instances/low_precision_transformations/mat_mul_with_constant_transformation.cpp b/src/plugins/intel_gpu/tests/functional/shared_tests_instances/low_precision_transformations/mat_mul_with_constant_transformation.cpp
index fb73fdaf5e6..6d97cb5a52d 100644
--- a/src/plugins/intel_gpu/tests/functional/shared_tests_instances/low_precision_transformations/mat_mul_with_constant_transformation.cpp
+++ b/src/plugins/intel_gpu/tests/functional/shared_tests_instances/low_precision_transformations/mat_mul_with_constant_transformation.cpp
@@ -14,7 +14,7 @@ const std::vector<ov::element::Type> precisions = {
ov::element::f16
};
-//transpose_a = false, transpose_b = true
+// transpose_a = false, transpose_b = true
std::vector<MatMulWithConstantTransformationTestValues> testValues = {
{
{ 2, 3, 4 },
@@ -87,7 +87,16 @@ std::vector<MatMulWithConstantTransformationTestValues> testValues = {
{ ov::element::f32, {}, {0.1f} },
"FullyConnected",
"U8"
- }
+ },
+ {
+ { 2, 3 },
+ { 256ul, {{1, 1}, {1, 1}, {1, 1}, {1, 1}}, {-128.f}, {383.f}, {0.5f}, {1.5f} },
+ { std::vector<float>{1, 2, 3, 4, 5, 6}, ov::element::i8, ov::Shape{ 2, 3 } },
+ {},
+ { ov::element::f32, {}, {0.1f} },
+ "FullyConnected",
+ "U8"
+ },
};
INSTANTIATE_TEST_SUITE_P(smoke_LPT, MatMulWithConstantTransformation,