-
Notifications
You must be signed in to change notification settings - Fork 315
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
Fix onnx.GatherND and onnx.ScatterND issues with dynamic indices #2550
Fix onnx.GatherND and onnx.ScatterND issues with dynamic indices #2550
Conversation
…ynamic indices. Signed-off-by: Yasushi Negishi <[email protected]>
Signed-off-by: Yasushi Negishi <[email protected]>
Signed-off-by: Yasushi Negishi <[email protected]>
Signed-off-by: Yasushi Negishi <[email protected]>
Signed-off-by: Yasushi Negishi <[email protected]>
Signed-off-by: Yasushi Negishi <[email protected]>
Signed-off-by: Yasushi Negishi <[email protected]>
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.
Is there also a backend test that we could activate to test this feature through execution of an operation?
|
Signed-off-by: Yasushi Negishi <[email protected]>
Signed-off-by: Yasushi Negishi <[email protected]>
…d dynamica cases. Signed-off-by: Yasushi Negishi <[email protected]>
Signed-off-by: Yasushi Negishi <[email protected]>
Signed-off-by: Yasushi Negishi <[email protected]>
Signed-off-by: Yasushi Negishi <[email protected]>
Signed-off-by: Yasushi Negishi <[email protected]>
… indices. Signed-off-by: Yasushi Negishi <[email protected]>
Signed-off-by: Yasushi Negishi <[email protected]>
I added backend tests for onnx.GatherND with dynamic indices cases. Thanks. |
IndexExpr indicesDimsSize = oneIE; | ||
for (int64_t i = 0; i < indicesRank; i++) | ||
indicesDimsSize = indicesDimsSize * indicesDims[i]; | ||
IndexExpr BDS(batchDimsSize), |
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.
Quick question: is this reshape valid even when indicesDimSizes
is not divisible by batchDimSize * indicesLastDim
? Or is it guaranteed? Maybe you can write a comment explaining why this works here in the code.
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.
@AlexandreEichenberger Thanks for the comments.
Alex> Quick question: is this reshape valid even when indicesDimSizes
is not divisible by batchDimSize * indicesLastDim
?
Alex> Or is it guaranteed? Maybe you can write a comment explaining why this works here in the code.
It is guaranteed, because IDS can be calculated by product of a part of the indices dimensions.
I changed the code to calculate IDS by using "product" instead of "floorDiv" to clarify the meaning.
… calculate new dimensions. Signed-off-by: Yasushi Negishi <[email protected]>
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.
LGTM, thanks much clearer without the DIV operation
Jenkins Linux s390x Build #13132 [push] Fix onnx.GatherND and on... started at 00:02 |
Jenkins Linux ppc64le Build #12125 [push] Fix onnx.GatherND and on... started at 00:09 |
Jenkins Linux amd64 Build #13108 [push] Fix onnx.GatherND and on... started at 23:02 |
Jenkins Linux amd64 Build #13108 [push] Fix onnx.GatherND and on... passed after 1 hr 17 min |
Jenkins Linux s390x Build #13132 [push] Fix onnx.GatherND and on... passed after 1 hr 27 min |
Jenkins Linux ppc64le Build #12125 [push] Fix onnx.GatherND and on... passed after 1 hr 36 min |
This PR fixes the following onnx.GatherND and onnx.ScatterND issues with dynamic indices.
With the following two lit tests, latest onnx-mlir causes internal errors while onnx-to-kernel conversion, this PR fixes them.
TODOs
[ X] Enable backend tests