-
Notifications
You must be signed in to change notification settings - Fork 32
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
Update/dpctl memcpy async #529
Update/dpctl memcpy async #529
Conversation
conda-recipe/meta.yaml
Outdated
@@ -19,13 +19,13 @@ requirements: | |||
- setuptools | |||
- cython | |||
- numba 0.54* | |||
- dpctl >=0.9* | |||
- dpctl >=0.9.1.dev* |
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.
This will presently make it break, since no such package is yet available on the channels.
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.
@oleksandr-pavlyk
If API changed then dpctl version should be 0.10.0 (dev0).
0.9.1 is a patch version.
Right?
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.
To play nice with multi-versioning on Linux - yes.
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.
- dpctl >=0.9.1.dev* | |
- dpctl >=0.10.0* |
@@ -31,15 +31,21 @@ def common_impl(a, b, out, dpnp_func, PRINT_DEBUG): | |||
sycl_queue = dpctl_functions.get_current_queue() | |||
|
|||
b_usm = dpctl_functions.malloc_shared(b.size * b.itemsize, sycl_queue) | |||
dpctl_functions.queue_memcpy(sycl_queue, b_usm, b.ctypes, b.size * b.itemsize) | |||
event = dpctl_functions.queue_memcpy( |
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.
Wouldn't it be better to create a function:
def synchronous_memcpy(q, dst, src, size):
event = dpctl_functions.queue_memcpy(q, dst, src, size)
dpctl_functions.event_wait(event)
dpctl_functions.event_delete(event)
and use it throughout, perhaps even in dpctl_functions
module?
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.
Opinions?
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.
About dpctl API I would like to propose to try to avoid breaking changes:
def queue_memcpy(..., wait=True):
...
if (wait):
dpctl_functions.event_wait(event)
dpctl_functions.event_delete(event)
return None
return event
def queue_memcpy_async(...):
return queue_memcpy(..., wait=False)
conda-recipe/meta.yaml
Outdated
- dpnp >=0.7* # [linux] | ||
- wheel | ||
run: | ||
- python | ||
- numba 0.54* | ||
- dpctl >=0.9* | ||
- dpctl >=0.9.1.dev* |
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.
@reazulhoque It is not necessary to use dev
here. Just >=0.9.1*
- dpctl >=0.9.1.dev* | |
- dpctl >=0.9.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.
- dpctl >=0.9.1.dev* | |
- dpctl >=0.10.0* |
Waiting for dpctl 0.10.0dev0 upload to channels. |
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 think we can merge it.
This updates API changes in dpctl for memcpy. IntelPython/dpctl#557