[CPU] Fix crash issue: RuntimeError: Primitive descriptor was not found for… (#16186)
This commit is contained in:
parent
2f3ae4518e
commit
2194552dc5
@ -624,6 +624,7 @@ void MatMul::prepareParams() {
|
|||||||
primitive_desc_iterator itpd = desc.createPrimitiveDescriptorIterator(engine, key.attr);
|
primitive_desc_iterator itpd = desc.createPrimitiveDescriptorIterator(engine, key.attr);
|
||||||
matmul::primitive_desc prim_desc;
|
matmul::primitive_desc prim_desc;
|
||||||
|
|
||||||
|
auto itpd_first = itpd;
|
||||||
while (static_cast<bool>(itpd)) {
|
while (static_cast<bool>(itpd)) {
|
||||||
impl_desc_type impl_type = parse_impl_name(itpd.impl_info_str());
|
impl_desc_type impl_type = parse_impl_name(itpd.impl_info_str());
|
||||||
|
|
||||||
@ -631,8 +632,14 @@ void MatMul::prepareParams() {
|
|||||||
prim_desc = itpd.get();
|
prim_desc = itpd.get();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (!itpd.next_impl())
|
if (!itpd.next_impl()) {
|
||||||
return matmul();
|
// In case of dynamic shapes an implementation type chosen as optimal for a primitive_desc with
|
||||||
|
// undefined input shapes, is not necessarily available for the primitive_desc with defined shape.
|
||||||
|
// Example: brgemm_avx512_amx (Intel Sapphire Rapids Platform) is available for a primitive with
|
||||||
|
// undefined input shapes but not available for primitive_desc with input batch 1.
|
||||||
|
prim_desc = itpd_first.get();
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return matmul(prim_desc);
|
return matmul(prim_desc);
|
||||||
};
|
};
|
||||||
|
@ -1277,6 +1277,13 @@ INSTANTIATE_TEST_SUITE_P(nightly_MM_Brgemm_Amx_Static, MatMulLayerCPUTest, testB
|
|||||||
|
|
||||||
|
|
||||||
const std::vector<ShapeRelatedParams> IS_Brgemm_Dynamic = {
|
const std::vector<ShapeRelatedParams> IS_Brgemm_Dynamic = {
|
||||||
|
{
|
||||||
|
{
|
||||||
|
{{-1, 256}, {{1, 256}}},
|
||||||
|
{{256, 384}, {{256, 384}}}
|
||||||
|
},
|
||||||
|
{false, false}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
{{-1, -1}, {{55, 12}, {33, 7}}},
|
{{-1, -1}, {{55, 12}, {33, 7}}},
|
||||||
|
Loading…
Reference in New Issue
Block a user