Skip to content
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

Queue inference for numba_dpex kernel args returns incorrect values #1021

Closed
diptorupd opened this issue Apr 26, 2023 · 1 comment
Closed
Assignees

Comments

@diptorupd
Copy link
Collaborator

The following code should raise a ComputeFollowsDataInferenceError, however such an exception is not raised:

import dpnp
import dpctl

import numba_dpex as dpex
from numba_dpex.core.exceptions import ComputeFollowsDataInferenceError


@dpex.kernel
def sum_kernel(a, b, c):
    i = dpex.get_global_id(0)
    c[i] = a[i] + b[i]

q1 = dpctl.SyclQueue()
q2 = dpctl.SyclQueue()

print(q1 == q2)
a = dpnp.ones(1, sycl_queue=q1)
b = dpnp.ones(1, sycl_queue=q2)
c = dpnp.empty_like(a)

sum_kernel[dpex.Range(1)](a, b, c)

Inside dispatcher when the type of the input arguments is inferred I see that all the args are inferred as usm_ndarray type with the same queue.

@diptorupd diptorupd self-assigned this Apr 26, 2023
@diptorupd diptorupd mentioned this issue May 4, 2023
5 tasks
@diptorupd diptorupd mentioned this issue May 15, 2023
5 tasks
@diptorupd
Copy link
Collaborator Author

Got fixed when the key for the USMNdArray type was updated to include the queue. The reproducer now raises an ExecutionQueueInferenceError with following traceback:

Traceback (most recent call last):
  File "/localdisk/work/diptorup/devel/numba-dpex/driver.py", line 23, in <module>
    sum_kernel[dpex.Range(1)](a, b, c)
  File "/localdisk/work/diptorup/devel/numba-dpex/numba_dpex/core/kernel_interface/dispatcher.py", line 412, in __call__
    ty_queue = determine_kernel_launch_queue(
  File "/localdisk/work/diptorup/devel/numba-dpex/numba_dpex/core/kernel_interface/utils.py", line 72, in determine_kernel_launch_queue
    raise ExecutionQueueInferenceError(
numba_dpex.core.exceptions.ExecutionQueueInferenceError: Execution queue for kernel "sum_kernel" could be deduced using compute follows data programming model. The usm_ndarray arguments 0,1,2 were not allocated on the same queue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant