-
Notifications
You must be signed in to change notification settings - Fork 33
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
get_global_id() indexing order doesn't follow that of SYCL indexing #889
Comments
@chudur-budur I do not understand the issue. In both SYCL and numba-dpex So what is the discrepancy? The concept of iteration order is irrelevant in this case. There is no iteration as we are not executing any loop. You are executing a data parallel kernel where The real issue will be if you are getting different results from seemingly identical kernels written in dpcpp and dpex. Is that what you are seeing? |
Yea, it's not a discrepancy per se, since iteration is not related to any loop, I think we should be fine as long as indices are accessing the correct values in the array. |
While there are more important sources of concern as the moment, couldn't that actually matter in the perspective of optimizing execution ? I wonder if knowing in what order the tasks will be dispatched could be leveraged to have a better cache hit rate in some kernels. In this regard I would expect tasks to be dispatched in a row-major order and could agree that this example might in fact show a concerning behavior from |
Let's say we want to mutliply two matrices (of dimensions
|a| = X*Y
and|b| = Y*Z
, i.e.a x b = c
,|c| = X*Z
) using this SYCL code:What we are essentially doing is parallalizing this loop:
The
parallel_for
gets the two outer-most loop indices throughget_global_id()
in the kernel. Now if we print the indices, we get an expected iteration:Now, if we look at the similar matrix multiplication code in
numba_dpex
:The iteration order is flipped:
Why is that? Given that all the parameter settings in the python code is identical to the c++ code.
The text was updated successfully, but these errors were encountered: