-
Notifications
You must be signed in to change notification settings - Fork 30
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
Specialize copy_from_numpy_into_usm_ndarray for contig case #1829
Specialize copy_from_numpy_into_usm_ndarray for contig case #1829
Conversation
Deleted rendered PR docs from intelpython.github.com/dpctl, latest should be updated shortly. 🤞 |
for contiguous case. Tensor implementation module temporarily exports both _copy_numpy_into_usm_ndarray_legacy, and _copy_numpy_into_usm_ndarray functions to performance comparison.
e043932
to
1869f06
Compare
Array API standard conformance tests for dpctl=0.19.0dev0=py310hdf72452_9 ran successfully. |
Array API standard conformance tests for dpctl=0.19.0dev0=py310hdf72452_9 ran successfully. |
…ernel Used unitrace to verify that the contiguous kernel is exercised in both direct call to asarray (for C-contiguous numpy array) with type casting, and when assigning to usm-ndarray from numpy of different data type when both arrays are dense, but strides may be negative.
Array API standard conformance tests for dpctl=0.19.0dev0=py310hdf72452_24 ran successfully. |
Array API standard conformance tests for dpctl=0.19.0dev0=py310hdf72452_25 ran successfully. |
dpctl/tensor/libtensor/source/copy_numpy_ndarray_into_usm_ndarray.cpp
Outdated
Show resolved
Hide resolved
@oleksandr-pavlyk |
Array API standard conformance tests for dpctl=0.19.0dev0=py310hdf72452_27 ran successfully. |
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.
LGTM, this is a nice improvement, thank you @oleksandr-pavlyk
Specialize
_copy_from_numpy_into_usm_ndarray
for contiguous case.Tensor implementation module temporarily exports both
_copy_numpy_into_usm_ndarray_legacy
, and_copy_numpy_into_usm_ndarray
functions to performance comparison.The specialization reuses the same kernel, instantiated with
NoOpIndexer
, reducing the number of kernel arguments.It also eliminates small allocation of USM temporaries needed to pass shape/strides information to the general kernel, and the cost of copying from host to these temporary allocations.