-
Notifications
You must be signed in to change notification settings - Fork 87
Improves implementation of aten_index_put #2641
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
base: main
Are you sure you want to change the base?
Conversation
… xadupre/input_put
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2641 +/- ##
==========================================
- Coverage 70.46% 70.42% -0.04%
==========================================
Files 224 224
Lines 26572 26678 +106
Branches 2637 2658 +21
==========================================
+ Hits 18723 18789 +66
- Misses 6928 6956 +28
- Partials 921 933 +12 ☔ View full report in Codecov by Sentry. |
| isinstance(index, torch.onnx._internal.exporter._tensors.SymbolicTensor) # pylint: disable=protected-access | ||
| for index in indices | ||
| ) | ||
| and len(values.shape) == 1 |
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.
What is this condition for? I am just trying to understand the assumptions/conditions for this special case.
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.
ONNX does not have similar operator than index_put. So the goal was to convert different cases in different ways. Finding a generic way to convert all the cases may end up with inefficient conversions. So I chose to filter out some cases where I know a simple conversion. At the end of the function, you still have an implementation working for everything left. About this condition, I don't know when SymbolicTensor appears, I just know it appears in some models (Qwen) and in that case, the conversion I implemented works. If the generic case is difficult to implement, let's go through the list of all cases we face. That's the logic I followed.
|
Adding some pointers/info for my own clarification: |
From #2606.