-
Notifications
You must be signed in to change notification settings - Fork 319
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
Forward input dims in Reshape ShapeHelper #2828
Forward input dims in Reshape ShapeHelper #2828
Conversation
Signed-off-by: Tung D. Le <[email protected]>
@AlexandreEichenberger if you know how to modify |
Signed-off-by: Tung D. Le <[email protected]>
outputDims[i] = outputDims[i].selectOrSelf( | ||
outputDims[i] == -1, numOfElements.floorDiv(numOfElementsFromShape)); | ||
dimShape == -1, numOfElements.floorDiv(numOfElementsFromShape)); |
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.
I changed this to make the compare expression literal.
It looks like I found the way to change |
@tungld is there still a case to look into? |
I changed |
@AlexandreEichenberger It's ready for review. |
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, make sense. Not 100% sure why I added a deepCopy
at that time, it makes sense not to generate a new question mark when we have questions marks.
Jenkins Linux amd64 Build #14969 [push] Forward input dims in Re... started at 10:54 |
Jenkins Linux s390x Build #14974 [push] Forward input dims in Re... started at 11:54 |
Jenkins Linux ppc64le Build #13999 [push] Forward input dims in Re... started at 12:03 |
Jenkins Linux amd64 Build #14969 [push] Forward input dims in Re... passed after 1 hr 7 min |
Jenkins Linux s390x Build #14974 [push] Forward input dims in Re... passed after 1 hr 31 min |
Jenkins Linux ppc64le Build #13999 [push] Forward input dims in Re... passed after 1 hr 59 min |
In this reshape op in a quantized bert model, the first two dimensions of the output are the same as the ones in the input, so we would like to forward IndexExprs of these dimensions from the input to the output so that DimAnalysis works. But it failed because of using
IndexExpr.selectOrSelf
.This patch updates
selectOrSelf
to forward the input QuestionMark when the condition is literal.