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 issues for numpy 2.1.0 #1804

Merged
merged 11 commits into from
Aug 21, 2024
Merged

Conversation

oleksandr-pavlyk
Copy link
Collaborator

Fixed test_full_gh_1230 to work with NumPy 2.1.0.

Fixed dpt.from_dlpack by handling ValueError possibly raised by ndarray.__dlpack__ when its dl_device
keyword argument is unsupported.


  • 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?

Copy link

github-actions bot commented Aug 19, 2024

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

Copy link

Array API standard conformance tests for dpctl=0.18.0dev0=py310hdf72452_329 ran successfully.
Passed: 894
Failed: 1
Skipped: 119

@coveralls
Copy link
Collaborator

coveralls commented Aug 19, 2024

Coverage Status

coverage: 87.901% (-0.009%) from 87.91%
when pulling 5e6271d on fix-issues-for-numpy-2.1.0
into 1e52918 on master.

Copy link

Array API standard conformance tests for dpctl=0.18.0dev0=py310hdf72452_331 ran successfully.
Passed: 894
Failed: 1
Skipped: 119

@ndgrigorian
Copy link
Collaborator

@oleksandr-pavlyk
Unfortunately, it seems that changing _to_scalar has exposed some other, subtle overflows in other tests.

Copy link

Array API standard conformance tests for dpctl=0.18.0dev0=py310hdf72452_333 ran successfully.
Passed: 894
Failed: 1
Skipped: 119

Copy link

Array API standard conformance tests for dpctl=0.18.0dev0=py310hdf72452_334 ran successfully.
Passed: 894
Failed: 1
Skipped: 119

Copy link

Array API standard conformance tests for dpctl=0.18.0dev0=py310hdf72452_336 ran successfully.
Passed: 894
Failed: 1
Skipped: 119

Copy link

Array API standard conformance tests for dpctl=0.18.0dev0=py310hdf72452_338 ran successfully.
Passed: 894
Failed: 1
Skipped: 119

Copy link

Array API standard conformance tests for dpctl=0.18.0dev0=py310hdf72452_337 ran successfully.
Passed: 894
Failed: 1
Skipped: 119

NumPy 2.1.0 now raises exception when fill_value is not in
bounds for the array data type.

Rework the logic of the test to accomodate that. The test
continue to work with NumPy 2.0.1
NumPy 2.1.0 supports DLPack 1.0 now, and raises ValueError
if __dlpack__ method gets unsupport dl_device value.

Function from_dlpack now handles ValueError, the same way
as it handles BufferError
This relies on NumPy to raise OverflowError if the object can not
be represented by requested data type.
…ral fill values

It should raise OverflowError, like NumPy 2 does.
For 2.0.0 and later, it is to raise OverflowError, otherwise it is expected
to wrap up the out-of-bounds integral fill-in values given as Python scalars.
Restrict the input size to allow math the test relies on to work without
using out-of-bounds Python scalar inputs to tensor.arange
Change the test so that input matrices that get multiplied only have
blocks of ones no larger than the max integer for the type, rest is
populated with zeros. This change applies to integral types only.
Use Python 3.12, install recent NumPy (instead of 1.25),
update gtest from 1.13 to 1.15.2
Copy link

Array API standard conformance tests for dpctl=0.18.0dev0=py310hdf72452_339 ran successfully.
Passed: 894
Failed: 1
Skipped: 119

Copy link

Array API standard conformance tests for dpctl=0.18.0dev0=py310hdf72452_340 ran successfully.
Passed: 894
Failed: 1
Skipped: 119

Copy link
Collaborator

@ndgrigorian ndgrigorian left a comment

Choose a reason for hiding this comment

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

Tests are back to passing, LGTM!

@oleksandr-pavlyk oleksandr-pavlyk merged commit 4297fef into master Aug 21, 2024
46 of 53 checks passed
@oleksandr-pavlyk oleksandr-pavlyk deleted the fix-issues-for-numpy-2.1.0 branch August 21, 2024 00:48
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