-
Notifications
You must be signed in to change notification settings - Fork 33
Feature/async kernel submition #1219
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
Conversation
c0cfee5 to
5c1a60d
Compare
914dcd5 to
c7b22d1
Compare
036e301 to
1ebbe2e
Compare
numba_dpex/experimental/launcher.py
Outdated
| index_space, | ||
| kernel_args, | ||
| ) | ||
| device_event.wait() # pylint: disable=E1101 |
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.
For this case, how will the device_event object get cleaned up? Previosuly, we had sycl.dpctl_event_delete(self._builder, eref).
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.
wrap_event_reference allocates meminfo and sycl event object becomes smart pointer. Destructor of meminfo will call DPCTLEvent_Delete which is the same function called by dpctl_event_delete https://github.com/IntelPython/numba-dpex/blob/main/numba_dpex/core/runtime/_eventstruct.c#L19
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.
Here is the log of async call:
DPEXRT-DEBUG: In DPEXRT_sycl_usm_ndarray_from_python at /home/yevhenii/Projects/numba-dpex/numba_dpex/core/runtime/_dpexrt_python.c, line 805
DPEXRT-DEBUG: usm type = 1 at /home/yevhenii/Projects/numba-dpex/numba_dpex/core/runtime/_dpexrt_python.c, line 282.
DPEXRT-DEBUG: NRT_MemInfo_init mi=0x561537ebfc00 external_allocator=0x561537e91fb0 at /home/yevhenii/Projects/numba-dpex/numba_dpex/core/runtime/_dpexrt_python.c, line 476
DPEXRT-DEBUG: Done with unboxing call to DPEXRT_sycl_usm_ndarray_from_python at /home/yevhenii/Projects/numba-dpex/numba_dpex/core/runtime/_dpexrt_python.c, line 885
DPEXRT-DEBUG: In DPEXRT_sycl_usm_ndarray_from_python at /home/yevhenii/Projects/numba-dpex/numba_dpex/core/runtime/_dpexrt_python.c, line 805
DPEXRT-DEBUG: usm type = 1 at /home/yevhenii/Projects/numba-dpex/numba_dpex/core/runtime/_dpexrt_python.c, line 282.
DPEXRT-DEBUG: NRT_MemInfo_init mi=0x561537b7c1c0 external_allocator=0x561537df11b0 at /home/yevhenii/Projects/numba-dpex/numba_dpex/core/runtime/_dpexrt_python.c, line 476
DPEXRT-DEBUG: Done with unboxing call to DPEXRT_sycl_usm_ndarray_from_python at /home/yevhenii/Projects/numba-dpex/numba_dpex/core/runtime/_dpexrt_python.c, line 885
DPEXRT-DEBUG: In DPEXRT_sycl_usm_ndarray_from_python at /home/yevhenii/Projects/numba-dpex/numba_dpex/core/runtime/_dpexrt_python.c, line 805
DPEXRT-DEBUG: usm type = 1 at /home/yevhenii/Projects/numba-dpex/numba_dpex/core/runtime/_dpexrt_python.c, line 282.
DPEXRT-DEBUG: NRT_MemInfo_init mi=0x561537b49c50 external_allocator=0x561537fb8120 at /home/yevhenii/Projects/numba-dpex/numba_dpex/core/runtime/_dpexrt_python.c, line 476
DPEXRT-DEBUG: Done with unboxing call to DPEXRT_sycl_usm_ndarray_from_python at /home/yevhenii/Projects/numba-dpex/numba_dpex/core/runtime/_dpexrt_python.c, line 885
DPEXRT-DEBUG: creating new dpctl event meminfo.
DPEXRT-DEBUG: scheduling nrt meminfo release.
DPEXRT-DEBUG: acquired meminfo.
DPEXRT-DEBUG: creating new dpctl event meminfo.
DPEXRT-DEBUG: creating new event object.
DPEXRT-DEBUG: released meminfo from host_task.
DPEXRT-DEBUG: deleting dpctl event reference.
DPEXRT-DEBUG: creating new event object.
DPEXRT-DEBUG: deleting dpctl event reference.
DPEXRT-DEBUG: released meminfo from host_task.
DPEXRT-DEBUG: released meminfo from host_task.
both dpctl event reference getting deleted.
And for call_kernel:
DPEXRT-DEBUG: In DPEXRT_sycl_usm_ndarray_from_python at /home/yevhenii/Projects/numba-dpex/numba_dpex/core/runtime/_dpexrt_python.c, line 805
DPEXRT-DEBUG: usm type = 1 at /home/yevhenii/Projects/numba-dpex/numba_dpex/core/runtime/_dpexrt_python.c, line 282.
DPEXRT-DEBUG: NRT_MemInfo_init mi=0x55f94f0452d0 external_allocator=0x55f94f4a6260 at /home/yevhenii/Projects/numba-dpex/numba_dpex/core/runtime/_dpexrt_python.c, line 476
DPEXRT-DEBUG: Done with unboxing call to DPEXRT_sycl_usm_ndarray_from_python at /home/yevhenii/Projects/numba-dpex/numba_dpex/core/runtime/_dpexrt_python.c, line 885
DPEXRT-DEBUG: In DPEXRT_sycl_usm_ndarray_from_python at /home/yevhenii/Projects/numba-dpex/numba_dpex/core/runtime/_dpexrt_python.c, line 805
DPEXRT-DEBUG: usm type = 1 at /home/yevhenii/Projects/numba-dpex/numba_dpex/core/runtime/_dpexrt_python.c, line 282.
DPEXRT-DEBUG: NRT_MemInfo_init mi=0x55f94f3f3470 external_allocator=0x55f94f403860 at /home/yevhenii/Projects/numba-dpex/numba_dpex/core/runtime/_dpexrt_python.c, line 476
DPEXRT-DEBUG: Done with unboxing call to DPEXRT_sycl_usm_ndarray_from_python at /home/yevhenii/Projects/numba-dpex/numba_dpex/core/runtime/_dpexrt_python.c, line 885
DPEXRT-DEBUG: In DPEXRT_sycl_usm_ndarray_from_python at /home/yevhenii/Projects/numba-dpex/numba_dpex/core/runtime/_dpexrt_python.c, line 805
DPEXRT-DEBUG: usm type = 1 at /home/yevhenii/Projects/numba-dpex/numba_dpex/core/runtime/_dpexrt_python.c, line 282.
DPEXRT-DEBUG: NRT_MemInfo_init mi=0x55f94f044c40 external_allocator=0x55f94f0e5b30 at /home/yevhenii/Projects/numba-dpex/numba_dpex/core/runtime/_dpexrt_python.c, line 476
DPEXRT-DEBUG: Done with unboxing call to DPEXRT_sycl_usm_ndarray_from_python at /home/yevhenii/Projects/numba-dpex/numba_dpex/core/runtime/_dpexrt_python.c, line 885
DPEXRT-DEBUG: creating new dpctl event meminfo.
DPEXRT-DEBUG: deleting dpctl event reference.
As you can see - it is getting deleted.
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.
Ok. But, we need not add the overhead of NRT_MemInfo allocation when we know it is not going to be used. We should just keep the direct call to sycl.dpctl_event_delete for the call_kernel scenario.
31b1122 to
425dabb
Compare
425dabb to
cb53e93
Compare
0ca5372 to
d704dd1
Compare
diptorupd
left a comment
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.
Please merge after adding the last two docstrings.
d704dd1 to
707412b
Compare
Add new
call_kenel_asynfunction toexperimentalpackage to submit kernel without waiting till it's done execution.