Skip to content

Commit

Permalink
currenlty ACLConvert not support UNKNOWN DataLayout to avoid accuracy…
Browse files Browse the repository at this point in the history
… issues
  • Loading branch information
liubo-intel committed Oct 23, 2024
1 parent 93451fb commit ae55235
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 20 deletions.
7 changes: 7 additions & 0 deletions src/plugins/intel_cpu/src/nodes/executors/acl/acl_convert.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,13 @@ bool ACLConvertExecutorBuilder::isSupported(const ConvertParams& convertParams,
DEBUG_LOG("NECopy does not support source precision: ", convertParams.srcPrc.to_string());
return false;
}
// currenlty not support UNKNOWN DataLayout to avoid accuracy issues
auto srcDataLayout = getAclDataLayoutByMemoryDesc(srcDesc);
auto dstDataLayout = getAclDataLayoutByMemoryDesc(dstDesc);
if (srcDataLayout == DataLayout::UNKNOWN || dstDataLayout == DataLayout::UNKNOWN) {
DEBUG_LOG("NECopy does not support source or destination layout");
return false;
}
if ((convertParams.srcPrc == ov::element::i8 && !one_of(convertParams.dstPrc,
ov::element::i16,
ov::element::i32,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,12 +187,12 @@ const std::vector<InputShape>& inShapes_4D_static() {
return inShapes_4D_static;
}

const std::vector<InputShape>& inShapes_7D_static() {
static const std::vector<InputShape> inShapes_7D_static = {
{{1, 2, 3, 4, 5, 6, 7}, {{1, 2, 3, 4, 5, 6, 7}}},
{{1, 1, 1, 1, 1, 1080, 1920}, {{1, 1, 1, 1, 1, 1080, 1920}}},
const std::vector<InputShape>& inShapes_5D_static() {
static const std::vector<InputShape> inShapes_5D_static = {
{{1, 2, 3, 4, 5}, {{1, 2, 3, 4, 5}}},
{{1, 1, 1, 1080, 1920}, {{1, 1, 1, 1080, 1920}}},
};
return inShapes_7D_static;
return inShapes_5D_static;
}

const std::vector<InputShape>& inShapes_4D_dynamic() {
Expand Down Expand Up @@ -221,30 +221,30 @@ const std::vector<InputShape>& inShapes_4D_dynamic() {
return inShapes_4D_dynamic;
}

const std::vector<InputShape>& inShapes_7D_dynamic() {
static const std::vector<InputShape> inShapes_7D_dynamic = {
const std::vector<InputShape>& inShapes_5D_dynamic() {
static const std::vector<InputShape> inShapes_5D_dynamic = {
{
// dynamic
{{-1, -1, -1, -1, -1, -1, -1}},
{{-1, -1, -1, -1, -1}},
// target
{
{2, 4, 4, 4, 3, 3, 1},
{2, 17, 5, 4, 3, 2, 1},
{1, 2, 3, 4, 5, 6, 7}
{2, 4, 4, 4, 3},
{2, 17, 5, 4, 3},
{1, 2, 3, 4, 5}
}
},
{
// dynamic
{{{1, 5}, {2, 22}, {2, 9}, {1, 4}, {1, 4}, {1, 4}, {1, 4}}},
{{{1, 5}, {2, 22}, {2, 9}, {1, 4}, {1, 4}}},
// target
{
{2, 17, 5, 4, 3, 1, 2},
{5, 2, 3, 2, 4, 1, 3},
{1, 10, 4, 1, 4, 2, 3},
{2, 17, 5, 4, 3},
{5, 2, 3, 2, 4},
{1, 10, 4, 1, 4},
}
}
};
return inShapes_7D_dynamic;
return inShapes_5D_dynamic;
}

const std::vector<ov::element::Type>& precisions() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ class ConvertToBooleanCPULayerTest : public ConvertCPULayerTest {
namespace Conversion {
const std::vector<InputShape>& inShapes_4D_static();
const std::vector<InputShape>& inShapes_4D_dynamic();
const std::vector<InputShape>& inShapes_7D_static();
const std::vector<InputShape>& inShapes_7D_dynamic();
const std::vector<InputShape>& inShapes_5D_static();
const std::vector<InputShape>& inShapes_5D_dynamic();
const std::vector<ov::element::Type>& precisions();
} // namespace Conversion
} // namespace test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ namespace Conversion {

INSTANTIATE_TEST_SUITE_P(smoke_ConvertCPULayerTest_7D_Dynamic, ConvertCPULayerTest,
::testing::Combine(
::testing::ValuesIn(inShapes_7D_dynamic()),
::testing::ValuesIn(inShapes_5D_dynamic()),
::testing::ValuesIn(precisions()),
::testing::ValuesIn(precisions()),
::testing::Values(CPUSpecificParams({}, {}, {}, {}))),
ConvertCPULayerTest::getTestCaseName);

INSTANTIATE_TEST_SUITE_P(smoke_ConvertCPULayerTest_7D_Static, ConvertCPULayerTest,
::testing::Combine(
::testing::ValuesIn(inShapes_7D_static()),
::testing::ValuesIn(inShapes_5D_static()),
::testing::ValuesIn(precisions()),
::testing::ValuesIn(precisions()),
::testing::Values(CPUSpecificParams({}, {}, {}, {}))),
Expand Down

0 comments on commit ae55235

Please sign in to comment.