Improve queue compatibility testing#900
Merged
oleksandr-pavlyk merged 8 commits intomasterfrom Sep 9, 2022
Merged
Conversation
Usage queues_are_compatible(exec_q, {alloc_q1, alloc_q2, ...}).
Returns true if compatible, false otherwise.
Insteads of invoking 4 copy kernels, it is more expedient to pack them on the host and use single copy kernel to reduce kernel submission overhead.wq
Applied optimization of replacing 3 queue.copy calls to copy shape, src_strides, dst_strides to copy host meta-data into USM allocation for use in copy_and_cast kernel with creating packed vector on the host and using a single queue.copy call of the packed host vector to USM allocation.w
|
View rendered docs @ https://intelpython.github.io/dpctl/pulls/900/index.html |
Collaborator
diptorupd
suggested changes
Sep 7, 2022
Contributor
diptorupd
left a comment
There was a problem hiding this comment.
I am fine in general, but the copy_usm_ndarray_into_usm_ndarray function has become too big. I feel a refactor is required for readability.
… for copy-and-cast operation between two usm_ndarrays
ffb42f9 to
74f0b37
Compare
Contributor
Author
|
Merging. |
|
Deleted rendered PR docs from intelpython.github.com/dpctl, latest should be updated shortly. 🤞 |
|
Array API standard conformance tests failed to run for dpctl=0.14.0dev0=py310h8c27c75_78. |
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This introduces
dpctl::utils::queues_are_compatible(exec_q, {alloc_q1, alloc_q2, ...})and deploys it intensor_py.cpp.The check replaces notion of compatibility from queues have equal contexts to queues are equal, aligning check with the logic in
_compute_follows_data.pyx.Furthermore, this PR implements optimization for transfer of shape/strides from host-allocated metadata to kernels.
Previously, transfer was done with 3 or 4 calls to
exec_q.copy. It is replaced with allocation of host temporary where necessarystd::copycalls are made to populate it, followed by a single call toexec_q.copyto copy data into USM allocation for use in kernel.No other logic has changed.