Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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?
[OP][CPU] Fix SliceScatter issues with non-constant slice params #27482
Changes from 5 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
There are no files selected for viewing
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.
The same logic could be implemented without duplication of the
!execPtr
check.As the comment is related to the
SliceScatter
op, shouldn't theattrs.isSliceScatterOp
be checked as well?Also is there a chance that the
prepareParams
will not initialize theexecPtr
and it will be still anullptr
after?Is it a final solution or temp fix for the issue described in the comment?
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.
Checking for isSliceScatter op may not be needed, instead it would make more sense to check for const inputs. for start/stop/step.
For other slice ops prepareParams is called in 2 ways:
In SliceScatter there is a problem with option 2 because output shape doesn't depend on data. So this would be an workaround for case where all inputs would have static shapes (node is static so no updateDynamicParams) and start/stop/step would be non-constant (prepareParams cannot be called during createPrimitive due to depending on const value).
As for final solution, I guess it may benefit from some changes to StridedSliceCommonExecutor since with static shapes, some calculations could be prepared in createPrimitive stage.
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.
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?
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.
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
execute
method implementation). So apparently the SL tests should be extended to cover such a use case: the values on the variable inputs actually changes each inference. To this end even a dedicated test class may be introduced, when necessary.