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

Register the experimental kernel target as a fully standalone Numba hardware target #1225

Merged
merged 4 commits into from
Nov 22, 2023

Conversation

diptorupd
Copy link
Contributor

@diptorupd diptorupd commented Nov 21, 2023

  • Have you provided a meaningful PR description?

  • The experimental target is now fully separated from the DpexKernelTarget with a different string identifier and device class.

  • A clone of the DpexKernelTarget's datamodel manager is added that will store all experimental types' data models till they are ready to move into core.

  • Have you added a test, reproducer or referred to an issue with a reproducer?

  • Have you tested your changes locally for CPU and GPU devices?

  • Have you made sure that new changes do not introduce compiler warnings?

  • If this PR is a work in progress, are you filing the PR as a draft?

@diptorupd diptorupd requested a review from ZzEeKkAa November 21, 2023 05:34
@diptorupd
Copy link
Contributor Author

@adarshyoga @ZzEeKkAa I have made most of the changes as far as I can tell to isolate out to the experimental target. Pytest seems to crash after these changes.

I will start fresh tomorrow.

@diptorupd
Copy link
Contributor Author

@adarshyoga @ZzEeKkAa I have made most of the changes as far as I can tell to isolate out to the experimental target. Pytest seems to crash after these changes.

I will start fresh tomorrow.

I messed up ufunc_db somehow. Here is a reproducer. I will fix tomorrow.

import dpctl
import dpnp

import numba_dpex.experimental as nd_exp
from numba_dpex import Range


@nd_exp.kernel
def test_atomic_ref(a, b):
    a[0] = b[0] + b[0]

q = dpctl.SyclQueue()
a = dpnp.ones(10, sycl_queue=q, dtype=dpnp.int64)
b = dpnp.array(0, sycl_queue=q, dtype=dpnp.int64)

nd_exp.call_kernel(test_atomic_ref, Range(10), a, b)
print(b)
print(a)

Diptorup Deb added 3 commits November 21, 2023 16:13
    - Use function qualname as the entry point (key) for
      caching compiled function in the target's _defns dict.
    - KernelCompileResult now extends numba's CompileResult class
      and only stores the spirv bitcode as an extra field.
    - Added a new function to return just the device ir for a
      cached overload.
    - Updates to launcher to accomodate changes to kernel_dispatcher.
@diptorupd diptorupd force-pushed the experimental/use_standalone_datamodel_manager branch from 63c3f22 to 2ab2608 Compare November 21, 2023 22:40
@diptorupd diptorupd changed the title Register the experimental kernel target as a fully separate target. Register the experimental kernel target as a fully standalone Numba hardware target Nov 21, 2023
Copy link
Contributor

@ZzEeKkAa ZzEeKkAa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! LGTM!

@diptorupd
Copy link
Contributor Author

@adarshyoga @ZzEeKkAa I have made most of the changes as far as I can tell to isolate out to the experimental target. Pytest seems to crash after these changes.
I will start fresh tomorrow.

I messed up ufunc_db somehow. Here is a reproducer. I will fix tomorrow.

import dpctl
import dpnp

import numba_dpex.experimental as nd_exp
from numba_dpex import Range


@nd_exp.kernel
def test_atomic_ref(a, b):
    a[0] = b[0] + b[0]

q = dpctl.SyclQueue()
a = dpnp.ones(10, sycl_queue=q, dtype=dpnp.int64)
b = dpnp.array(0, sycl_queue=q, dtype=dpnp.int64)

nd_exp.call_kernel(test_atomic_ref, Range(10), a, b)
print(b)
print(a)

Fixed. The issue was I was passing the number of bytes in the _KernelModule object rather than _kernelModule.kernel_bitcode to the kernel submit call.

@diptorupd diptorupd merged commit 5f23bc5 into main Nov 22, 2023
36 of 42 checks passed
@diptorupd diptorupd deleted the experimental/use_standalone_datamodel_manager branch November 22, 2023 02:51
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

Successfully merging this pull request may close these issues.

2 participants