Skip to content

Conversation

@ndgrigorian
Copy link
Collaborator

The test test_roll_empty amounted to testing if roll is well-behaved on a scalar array. However, this test was designed such that the scalar array came from

np.empty([])

which does not set the dtype of the empty array and is undefined in the value of the scalar. This meant that with the newest NumPy version, the scalar would be on the scale of 1e-322, which is too precise for some devices, and the test would fail

this test uses np.ones([], dtype="f4") now instead, and is renamed to test_roll_scalar which more accurately describes what's being tested

  • 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?
  • Have you added documentation for your changes, if necessary?
  • Have you added your changes to the changelog?
  • If this PR is a work in progress, are you opening the PR as a draft?

this test had been failing on newer numpy versions and contained undefined behavior
@github-actions
Copy link

@github-actions
Copy link

Array API standard conformance tests for dpctl=0.22.0dev0=py310h93fe807_88 ran successfully.
Passed: 1114
Failed: 44
Skipped: 82

@coveralls
Copy link
Collaborator

Coverage Status

coverage: 86.269%. remained the same
when pulling d348b4d on fix-roll-test
into c5c82b4 on master.

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.

Thank you @ndgrigorian, LGTM!
It's helpful to make the tests more stable.

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