-
Notifications
You must be signed in to change notification settings - Fork 518
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
Wrap indices to be within max range for as_strided + index_select #3902
base: main
Are you sure you want to change the base?
Conversation
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.
TOSA path looks ok. Please check for and address any XPASSes on all TOSA targets since they are not run by CI.
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.
@sahas3 Please rebase your PR, so that the CI can be run.
Rebased PR and CI is clean. Thanks! |
Value index = | ||
wrapIndicesAroundMax(b, loc, args[0], input, dimInt); |
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.
Hi @sahas3, is this a valid thing to do? Can you please share any such reference from the PyTorch 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.
Hi @vivekkhandelwal1, this is based on the behavior I observed -- for the index values being produced, wrapping around the max index value produces correct results for the new e2e test added in the PR. I haven't found any PyTorch implementation to support this behavior though.
Found these issues when trying to lower the ExportedProgram generated from decomposing
nn.GRU
op in torch.as_strided
to reproduce the issue. It requires the other ops in the repro to hit the issue.--config=onnx
,index_select
op was generated instead ofas_strided
which had the same issue as well.notify : @justin-ngo-arm as you were the original author for the Tosa conversions of these ops.