[CPU] Fix problem with inplace input blob (#8506)
This commit is contained in:
parent
b9c5a477b4
commit
b726aa2c9b
@ -425,10 +425,18 @@ void MKLDNNPlugin::MKLDNNInferRequest::SetBlob(const std::string& name, const In
|
|||||||
IE_THROW(ParameterMismatch) << "Failed to set input blob. Blocking descriptor mismatch.";
|
IE_THROW(ParameterMismatch) << "Failed to set input blob. Blocking descriptor mismatch.";
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto &actualDesc = graph->getInputNodeByName(name)->getChildEdgesAtPort(0)[0]->getMemory().getDesc();
|
MemoryDescPtr actualDesc = graph->getInputNodeByName(name)->getBaseMemDescAtOutputPort(0);
|
||||||
if (blobDesc.getLayout() != InferenceEngine::Layout::ANY &&
|
bool blobHasAnyLayout = blobDesc.getLayout() == InferenceEngine::Layout::ANY;
|
||||||
actualDesc.isCompatible(MemoryDescUtils::convertToCpuBlockedMemoryDesc(blobDesc)) &&
|
if (!blobHasAnyLayout && !actualDesc->isDefined()) {
|
||||||
graph->_normalizePreprocMap.find(name) == graph->_normalizePreprocMap.end() && !graph->getProperty().batchLimit) {
|
// we must define desc for dynamic case
|
||||||
|
// otherwise we got incorrect check on shape compatibility inside isCompatible
|
||||||
|
// because lower and upper bound will be compared
|
||||||
|
actualDesc = actualDesc->cloneWithNewDims(blobDesc.getLayout() == InferenceEngine::Layout::SCALAR ? InferenceEngine::SizeVector{1} :
|
||||||
|
blobDesc.getDims());
|
||||||
|
}
|
||||||
|
if (!blobHasAnyLayout &&
|
||||||
|
actualDesc->isCompatible(MemoryDescUtils::convertToCpuBlockedMemoryDesc(blobDesc)) &&
|
||||||
|
graph->_normalizePreprocMap.find(name) == graph->_normalizePreprocMap.end() && !graph->getProperty().batchLimit) {
|
||||||
externalPtr[name] = data->buffer();
|
externalPtr[name] = data->buffer();
|
||||||
} else if (externalPtr.find(name) != externalPtr.end()) {
|
} else if (externalPtr.find(name) != externalPtr.end()) {
|
||||||
externalPtr.erase(name);
|
externalPtr.erase(name);
|
||||||
|
@ -254,7 +254,16 @@ std::vector<std::vector<ov::Shape>> staticInputShapes5D2 = {
|
|||||||
std::vector<std::vector<InputShape>> dynamicInputShapes5D2 = {
|
std::vector<std::vector<InputShape>> dynamicInputShapes5D2 = {
|
||||||
{
|
{
|
||||||
{{{-1, -1, -1, -1, -1}, {{48, 4, 3, 3, 3}, {24, 16, 5, 3, 5}, {24, 8, 7, 5, 5}}}},
|
{{{-1, -1, -1, -1, -1}, {{48, 4, 3, 3, 3}, {24, 16, 5, 3, 5}, {24, 8, 7, 5, 5}}}},
|
||||||
{{{24, {8, 16}, {3, 5}, -1, -1}, {{24, 16, 3, 4, 3}, {24, 12, 5, 3, 5}, {24, 8, 4, 5, 5}}}}
|
{{{24, {8, 16}, {3, 5}, -1, -1}, {{24, 16, 3, 4, 3}, {24, 12, 5, 3, 5}, {24, 8, 4, 5, 5}}}},
|
||||||
|
// special case
|
||||||
|
{
|
||||||
|
{{{1, 24}, {1, 16}, {1, 10}, {1, 10}, {1, 10}},
|
||||||
|
{
|
||||||
|
{24, 16, 5, 3, 5},
|
||||||
|
{24, 16, 5, 3, 5},
|
||||||
|
{24, 16, 7, 5, 5}
|
||||||
|
}}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user