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

Fix gh 1071 from dlpack #1073

Merged
merged 5 commits into from
Feb 16, 2023
Merged

Fix gh 1071 from dlpack #1073

merged 5 commits into from
Feb 16, 2023

Conversation

oleksandr-pavlyk
Copy link
Collaborator

Fixes gh-1071. Updated DLPack to 0.8 with support for kDLBool elemental tensor data type.

Exception reported #1071 would arise every time array would not start at the beginning of the underlying allocation, i.e. x0 = dpt.arange(6); x1 = x0[::-2]; dpt.from_dlpack(x1) fails, but x0 = dpt.arange(7); x1 = x0[::-2]; dpt.from_dlpack(x1) works.

Test was added to cover such inputs too.

  • 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?
  • If this PR is a work in progress, are you filing the PR as a draft?

Whenever start of array decoded from its dlpack capsule data
did not start from the beginning of the allocation, like with
x0 = dpt.arrange(6); x1 = x0[::-2]; dpt.from_dlpack(x1) which failed,
vs. x0 = dpt.arrange(7); x1 = x0[::-2]; dpt.from_dlpack(x1) which worked.
@github-actions
Copy link

@coveralls
Copy link
Collaborator

Coverage Status

Coverage: 82.269% (+0.0001%) from 82.269% when pulling 84b0232 on fix-gh-1071-from-dlpack into 8e63098 on master.

@github-actions
Copy link

Array API standard conformance tests for dpctl=0.14.1dev2=py310h41425db_14 ran successfully.
Passed: 33
Failed: 801
Skipped: 280

Copy link
Collaborator

@antonwolfy antonwolfy left a comment

Choose a reason for hiding this comment

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

Try to run different examples, no issue observed. LGTM!

@oleksandr-pavlyk oleksandr-pavlyk merged commit 6e58a41 into master Feb 16, 2023
@oleksandr-pavlyk oleksandr-pavlyk deleted the fix-gh-1071-from-dlpack branch February 16, 2023 21:09
@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.1dev2=py310h41425db_14 ran successfully.
Passed: 33
Failed: 801
Skipped: 280

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.

from_dlpack raises unexpected error on strided dpctl.tensor.usm_ndarray input
3 participants