-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[OP][CPU] Fix SliceScatter issues with non-constant slice params #27482
base: master
Are you sure you want to change the base?
Changes from 10 commits
774582c
4f9abba
e1cf06f
8999701
f86bd87
a74d9ae
5170814
a4bcad3
e355673
26f0a65
e82524f
cf599f0
58bfb56
27e625e
26b47f0
aaeedc8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -83,7 +83,13 @@ class SliceScatterLayerCPUTest : public testing::WithParamInterface<SliceScatter | |
in_data); | ||
} else { | ||
// Fill the slice input2~input5 with specified data. | ||
tensor = ov::Tensor{ov::element::i64, targetInputStaticShapes[i], inputValues[i - 2]}; | ||
auto inputValue = inputValues[i - 2]; | ||
if (!inputValue) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you please elaborate on the reason behind introducing this check? It looks like the current test configuration doesn't provide null pointers. But if it does, an input tensor is created but not initialized with valid values. So what is the expectation of using such an input? |
||
const auto param = ov::as_type_ptr<const ov::op::v0::Parameter>(funcInput.get_node_shared_ptr()); | ||
mmikolajcz marked this conversation as resolved.
Show resolved
Hide resolved
|
||
tensor = ov::Tensor{ov::element::i64, targetInputStaticShapes[i]}; | ||
} else { | ||
tensor = ov::Tensor{ov::element::i64, targetInputStaticShapes[i], inputValue}; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually this is the reason why the tests don't cover the main issue, as is being resolved in this PR. The thing is that the SL tests in the static shapes configuration perform only one inference, thus the values on the variable inputs don't really change from infer to infer and SL tests don't spot the issue. But if we had had such tests, they would have revealed the design flaw of the current solution solution (please see the comment regarding |
||
} | ||
} | ||
inputs.insert({funcInput.get_node_shared_ptr(), tensor}); | ||
} | ||
|
@@ -228,7 +234,7 @@ INSTANTIATE_TEST_SUITE_P(smoke_CompareWithRefs_Plain_Static_2D, | |
SliceScatterLayerCPUTest, | ||
::testing::Combine(::testing::Values(static_shapes_to_test_representation({{32, 16}})), | ||
::testing::ValuesIn(paramsPlain2D), | ||
::testing::Values(ov::test::utils::InputLayerType::CONSTANT), | ||
::testing::ValuesIn(inputLayerTypes), | ||
::testing::ValuesIn(inputPrecisions), | ||
::testing::Values(emptyCPUSpec)), | ||
SliceScatterLayerCPUTest::getTestCaseName); | ||
|
@@ -319,7 +325,7 @@ INSTANTIATE_TEST_SUITE_P( | |
SliceScatterLayerCPUTest, | ||
::testing::Combine(::testing::ValuesIn(static_shapes_to_test_representation(inputShapesStatic4D)), | ||
::testing::ValuesIn(testCasesCommon4D), | ||
::testing::Values(ov::test::utils::InputLayerType::CONSTANT), | ||
::testing::ValuesIn(inputLayerTypes), | ||
::testing::ValuesIn(inputPrecisions), | ||
::testing::ValuesIn(CPUParamsCommon4D)), | ||
SliceScatterLayerCPUTest::getTestCaseName); | ||
|
@@ -407,7 +413,7 @@ INSTANTIATE_TEST_SUITE_P( | |
SliceScatterLayerCPUTest, | ||
::testing::Combine(::testing::ValuesIn(static_shapes_to_test_representation(inputShapesStatic5D)), | ||
::testing::ValuesIn(testCasesCommon5D), | ||
::testing::Values(ov::test::utils::InputLayerType::CONSTANT), | ||
::testing::ValuesIn(inputLayerTypes), | ||
::testing::ValuesIn(inputPrecisions), | ||
::testing::ValuesIn(CPUParamsCommon5D)), | ||
SliceScatterLayerCPUTest::getTestCaseName); | ||
|
@@ -441,7 +447,7 @@ INSTANTIATE_TEST_SUITE_P(smoke_CompareWithRefs_Common_Full_Slice_5D, | |
SliceScatterLayerCPUTest, | ||
::testing::Combine(::testing::ValuesIn(inputShapesFullSlice5D), | ||
::testing::ValuesIn(testCasesFullSlice5D), | ||
::testing::Values(ov::test::utils::InputLayerType::CONSTANT), | ||
::testing::ValuesIn(inputLayerTypes), | ||
::testing::ValuesIn(inputPrecisions), | ||
::testing::ValuesIn(CPUParamsCommon5D)), | ||
SliceScatterLayerCPUTest::getTestCaseName); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the data on the corresponding inputs are not constant, it means that the executor must be reinitialized every inference call, as the data in variables may be updated each inference. If the tests pass, that means that either the test converge is still not sufficient, or there is no real data dependency and the executor may be created at the compilation stage.