[UR][OpenCL][EnqueueCommandBuffer] use sync points even if command buffer's internal queue is in-order#18147
[UR][OpenCL][EnqueueCommandBuffer] use sync points even if command buffer's internal queue is in-order#18147wenju-he wants to merge 2 commits into
Conversation
…mand buffer is in-order sycl queue is out-of-order by default. We can't use out-of-order queue for EnqueueCommandBuffer when the command buffer is created with with an internal in-order queue in the case graph is in-order.
EwanC
left a comment
There was a problem hiding this comment.
sycl queue is out-of-order by default. When graph is in-order, the
command buffer is created with an internal in-order queue, however,
the out-of-order queue is used for EnqueueCommandBuffer.
Enqueing an OpenCL in-order created opencl command-buffer to an out-of-order command-queue is valid API usage. There is a CTS test for it (test_queue_substitute_out_of_order) added in KhronosGroup/OpenCL-CTS#2230 to verify this. Could you elaborate on why this is causing problems?
I just took a look at RecordOutOfOrderCommandBuffer function in KhronosGroup/OpenCL-CTS#2230 and it has set sync points, so I think that is why it is working fine. However, the scenario is different for sycl test https://github.com/intel/llvm/blob/sycl/sycl/test-e2e/Graph/Inputs/compile_time_local_memory.cpp which has two kernels which should be executed sequentially due to the second kernel depending on the first kernel. This PR adds sync points back so that the dependency is kept. |
That's not my reading,
I'm not following " Then there is no synchronization between the two kernels any more and the two kernels can execute in arbitrary order in the out-of-order queue." When a command-buffer is finalized the command dependencies are set in the command-buffer, whether the command-buffer is then submitted to an in-order or out-of-order queue has no effect on the internal command dependencies. |
is this an update on 0.9.6 or 0.9.7? |
|
Thanks @EwanC we'll fix the issue in the backend. Close this PR. |
This is partial revert of 988c477
sycl queue is out-of-order by default. When graph is in-order, the
command buffer is created with an internal in-order queue, however,
the out-of-order queue is used for EnqueueCommandBuffer.
This PR restores using sync points for this case that out-of-order
queue is used for executing the command buffer.
Currently it seems there is no mechanism to wait for the internal
in-order queue, therefore, we can't use the queue for EnqueueCommandBuffer.