Skip to content

Fixed tests from_dlpack and _from_dlpack_strided for USM-host allocations #1338

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

Merged
merged 1 commit into from
Aug 15, 2023

Conversation

oleksandr-pavlyk
Copy link
Contributor

@oleksandr-pavlyk oleksandr-pavlyk commented Aug 11, 2023

Since USM-host allocation, unlike USM-device and USM-shared allocations, is not associated with any particular device, only with the host, it is unreasonable to expect that sycl::get_pointer_device(ptr, ctx) will return the same device that is stored in the sycl_queue attribute of dpctl.tensor.usm_ndarray instance.

The tests are adjusted to bypass that check for USM-host allocations.

  • Have you provided a meaningful PR description?
  • 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?
  • Have you checked performance impact of proposed changes?
  • If this PR is a work in progress, are you opening the PR as a draft?

…cations

Since USM-host allocation, unlike USM-device and USM-shared allocations,
is not associated with any particular device, only with the host, it is
unreasonable to expect that sycl::get_pointer_device(ptr, ctx) will return
the same device that is stored in the sycl_queue associated with the
dpctl.tensor.usm_ndarray.

The tests are adjusted to bypass that check for USM-host allocations.
@coveralls
Copy link
Collaborator

Coverage Status

coverage: 84.95%. remained the same when pulling f02862b on fix-dlpack-tests into 074ec3a on master.

@github-actions
Copy link

@github-actions
Copy link

Array API standard conformance tests for dpctl=0.14.6dev2=py310h7bf5fec_2 ran successfully.
Passed: 913
Failed: 87
Skipped: 119

@oleksandr-pavlyk
Copy link
Contributor Author

SYCL spec for sycl::malloc_host can be found here.

The sycl::get_pointer_device(const void *ptr, const sycl::context &syclContext) is explicitly documented so: "If ptr points within a host USM allocation for the context syclContext, returns the first device in syclContext."

@oleksandr-pavlyk oleksandr-pavlyk merged commit aea6f7f into master Aug 15, 2023
@oleksandr-pavlyk oleksandr-pavlyk deleted the fix-dlpack-tests branch August 15, 2023 19:03
@github-actions
Copy link

Deleted rendered PR docs from intelpython.github.com/dpctl, latest should be updated shortly. 🤞

@github-actions
Copy link

Array API standard conformance tests for dpctl=0.14.6dev2=py310h7bf5fec_6 ran successfully.
Passed: 913
Failed: 87
Skipped: 119

@oleksandr-pavlyk oleksandr-pavlyk mentioned this pull request Aug 15, 2023
6 tasks
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.

3 participants