-
Notifications
You must be signed in to change notification settings - Fork 32
Add support for dpctl.dparray. #50
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
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.
Looks correct at first glance. I didn't look to see why the tests were failing but that would be expected even if this is using the dpctl dparray branch since we removed the section of code there that looks for Numba meminfo objects. Once this is merged then I will add the code here to monkey-patch the meminfo objects with sycl_usm_array_interface.
Co-authored-by: etotmeni <elena.totmenina@intel.com>
* Del dppl dir in tests * Del unused var Co-authored-by: etotmeni <elena.totmenina@intel.com>
This reverts commit 776bf22.
Co-authored-by: etotmeni <elena.totmenina@intel.com> Co-authored-by: Diptorup Deb <diptorup.deb@intel.com>
…Numba-dppy pipeline (#52) * Sum example * Moved from infer_type, lower_builtin to overload * Added two level module name functions * Remove cython generated file * Module name fix for moving to new extension * Incomplete linalg.eig implementation * Updted all dppl to dppy and moved rewrite_numpy_function_pass to it's own file * Import module at correct locations * Added comments * Added test and updated comments * Revert unneeded changes * Update Eigen implementation * Remove eig implementation * Add checking equivalent IR Co-authored-by: reazul.hoque <reazul.hoque@intel.com>
numba_dppy/numpy_usm_shared.py
Outdated
todo_getattr = [] | ||
|
||
# For all Numpy identifiers that have been registered for typing in Numba... | ||
# this registry contains functions, getattrs, setattrs, casts and constants...need to do them all? FIX FIX FIX |
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 convert this comment into a ticket.
Is it relate to some line? |
…ect is a USM MemInfo.
This PR requires IntelPython/dpctl#214. |
…ass and the Numba integration were in the same file. I changed those to explicitly refer to the usmarray module in dpctl.
…n numpy_usm_shared in dpctl.dptensor. This fixes the ndindex issue.
Assertion error in last case:
Fixed. |
* Split tests for usmarray in separate unittest test cases * Remove prints and use unittest assertions * Move functions to tests * Give names to functions * Add expectedFailure for failed tests * Clean code
3 tests failed and marked as expected failure:
|
There are some parts of the USM array attribute class that use bound_function that don't seem to work with the current configuration and I'm not sure why. I say we merge what we currently have while I investigate this issue I described and we can have another PR for that. |
@DrTodd13 import numba
import numpy
import dpctl.dptensor.numpy_usm_shared as usmarray
@numba.njit()
def numba_mul(a, b): # a is usmarray, b is numpy
return a * b
@numba.njit()
def numba_mul_add(a):
return a * 2.0 + 13
assert isinstance(numba_mul(usmarray.ones(10), numpy.ones(10)), usmarray.ndarray) # 1
assert isinstance(numba_mul_add(numpy.ones(10)), numpy.ndarray) # 2
assert isinstance(numba_mul_add(usmarray.ones(10)), usmarray.ndarray) # 3 - error Traceback (most recent call last):
File "./usmarray_and_ndarray.py", line 27, in <module>
assert isinstance(numba_mul_add(usmarray.ones(10)), usmarray.ndarray)
AssertionError If any of |
@DrTodd13 pip install black
black . |
@DrTodd13 is it ready to be merged? How can I help with it? |
Yes. We can merge. There are some known issues to be fixed but let's get the stuff that is working checked in and fix the rest later. |
@diptorupd @DrTodd13 |
Moved code from IntelPython/numba#116.
test_usmarray.py
setup.py