Skip to content

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

[CPU] FC dynamic quantization condition update (#34653)

Chenhu Wangae64fc4d56e1
diff --git a/src/plugins/intel_cpu/src/nodes/executors/dnnl/dnnl_fullyconnected_primitive.cpp b/src/plugins/intel_cpu/src/nodes/executors/dnnl/dnnl_fullyconnected_primitive.cpp
index f5796e1f7ae..e358d24e5e0 100644
--- a/src/plugins/intel_cpu/src/nodes/executors/dnnl/dnnl_fullyconnected_primitive.cpp
+++ b/src/plugins/intel_cpu/src/nodes/executors/dnnl/dnnl_fullyconnected_primitive.cpp
@@ -198,9 +198,13 @@ static bool useDynamicQuantizationImpl(size_t dqGroupSize,
}
MemoryCPtr scalesPtr = memory.count(ARG_WEI | ARG_ATTR_SCALES) ? memory.at(ARG_WEI | ARG_ATTR_SCALES) : nullptr;
- int ic = weightsDesc->getShape().getStaticDims()[1];
+ size_t ic = weightsDesc->getShape().getStaticDims()[1];
- if (ic < static_cast<int>(simdWidth)) {
+ if (ic < simdWidth) {
+ return false;
+ }
+
+ if (ic < dqGroupSize) {
return false;
}