-
Notifications
You must be signed in to change notification settings - Fork 29
Fix dpctl.tensor.put race condition #1384
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 dpctl.tensor.put race condition #1384
Conversation
Can one of the admins verify this patch? |
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 do not think this is the right change. First, indices can be given as a usm_ndarray
instance and np.unique
won't work. Second, checking for uniqueness is not cheap, and the cost grows with the size of index array(s). I think it is best to leave this checking to the user. He/she can skip it altogether if indices are known to be unique.
The function documentation says they are always Also, I used |
Just something to add to this opinion, I've looked around for the consensus on this matter: There's also no real use for repeating an index value in |
Made the uniqueness checking optional (opt-in). So now if a user doesn't want to check or have a performance impact they can just not use it |
@PiotrekB416 The reason NumPy functions work on
The pattern here is a flurry of offload of large number of light-weight kernels. The time is totally dominated by kernel submission overhead. So while
The projected wall-time for In a near future |
@PiotrekB416 The set functions, such as |
Please install |
I am going to close this PR, since #1653 has been merged. Docstring provides sample code based on your idea provide example of resolving duplicates for 1D input. The approach wont work too easily when higher dimensional array is used and |
As shown in #1360
dpctl.tensor.put
has a race condition ifindices
has non-unique valuesThis PR solves this issue by removing unnecessary indices