[CPU] Fixed legacy post ops behavior (#10542)
This commit is contained in:
@@ -2083,7 +2083,6 @@ void MKLDNNEltwiseNode::appendPostOpsImpl(mkldnn::post_ops& ops, const VectorDim
|
||||
}
|
||||
} else {
|
||||
const size_t chIdx = postOpDims.size() > 1 ? getFusingAxis() : 0;
|
||||
constexpr int bufferAlignment = 16; // always align for legacy scale/shift post ops
|
||||
// since legacy depthwise post ops mechanism requires broadcasted data we need to reinitilize it in case of changed shape
|
||||
if (depthwiseData.empty() || depthwiseDataSize != 2 * postOpDims[chIdx]) {
|
||||
depthwiseData.clear();
|
||||
@@ -2106,7 +2105,10 @@ void MKLDNNEltwiseNode::appendPostOpsImpl(mkldnn::post_ops& ops, const VectorDim
|
||||
}
|
||||
depthwiseDataSize = 2 * postOpDims[chIdx];
|
||||
|
||||
depthwiseData.resize(rnd_up(depthwiseData.size(), bufferAlignment), 0);
|
||||
// always align for legacy scale/shift post ops
|
||||
constexpr int bufferAlignment = 16;
|
||||
int bufferPaddingSize = rnd_up(postOpDims[chIdx], bufferAlignment) - postOpDims[chIdx];
|
||||
depthwiseData.resize(depthwiseDataSize + bufferPaddingSize, 0);
|
||||
}
|
||||
|
||||
if (depthwiseData.empty())
|
||||
|
||||
@@ -1791,7 +1791,9 @@ void MKLDNNFakeQuantizeNode::initializePostOpDataLegacy(const VectorDims &dims,
|
||||
quantizationData.insert(quantizationData.end(), outputScale.begin(), outputScale.end());
|
||||
quantizationData.insert(quantizationData.end(), outputShift.begin(), outputShift.end());
|
||||
quantizationDataSize = quantizationData.size();
|
||||
quantizationData.resize(rnd_up(quantizationData.size(), bufferAlignment), 0);
|
||||
|
||||
int bufferPaddingSize = rnd_up(outputShift.size(), bufferAlignment) - outputShift.size();
|
||||
quantizationData.resize(quantizationDataSize + bufferPaddingSize, 0);
|
||||
}
|
||||
|
||||
isPostOpDataInitialized = true;
|
||||
|
||||
2
src/plugins/intel_cpu/thirdparty/mkl-dnn
vendored
2
src/plugins/intel_cpu/thirdparty/mkl-dnn
vendored
Submodule src/plugins/intel_cpu/thirdparty/mkl-dnn updated: 7e92a2dfe8...82ca2f931c
Reference in New Issue
Block a user