-
Notifications
You must be signed in to change notification settings - Fork 70
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
Implementing PUT routine #582
Conversation
Co-authored-by: Bryan Van de Ven <[email protected]>
Co-authored-by: Bryan Van de Ven <[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 modulo the bad copy/merge that needs fixed in array.py
@manopapad : the fix for this use case is blocked on #582 (comment) issue |
@manopapad I think I have addressed all the comments/issues with my latest commits. |
cunumeric/deferred.py
Outdated
rhs = src.base | ||
else: | ||
lhs = self.base | ||
rhs = src._broadcast(lhs.shape) |
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 have added this logic for the case when lhs
has shape ()
and rhs
has shape (1,)
. Otherwise we get an error
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 this still required? I just ran the test suite without this change and everything seems to be working.
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 don't think it is tested. I will add a test
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, I can't really test it on high level. I will revert the change since we are not using it
This is ready to be merged, except for one remaining question above. I am noting here some work we should address in future PRs: (1) We can skip the out-of-bounds checks inside of the task if (2) There are currently two different values in the "wrap" files that are both confusingly referred to as "input"/"in". I would like us to rename all values referring to the target array as "tgt" or "base", to make the code easier to understand. E.g. (3) Raising an exception within an OpenMP block causes that exception to be caught and reported at the end of that block, instead of propagating it to our catch statement https://github.com/nv-legate/legate.core/blob/branch-22.12/src/core/task/task.h#L111. This causes code like the following to report an exception inside C++ instead of propagating that exception to python:
Note that this likely affects |
@magnatelee : thank you, I have created an issue for the remaining improvements/fixes |
Implementing PUT method
The implementation reuses
WRAP
task (with some modifications) to compute points to the source array that need to be updated with the Values.Since Legate Copy operation modifies values asynchronously, we can't guarantee that the output array will be the same as output from numpy.put for the case when there are duplicates in indices. Therefore, I have added the check for duplicate indices and warning message if they are found.