Skip to content

Conversation

vlad-perevezentsev
Copy link
Contributor

@vlad-perevezentsev vlad-perevezentsev commented Jan 8, 2025

This PR suggests using assert_allclose instead of assert_equal with a resolution-based tolerance in TestSpacing::test_zeros to fix test failures on CUDA caused by excessive precision for float32.

Mismatched elements: 2 / 2 (100%)
E           Max absolute difference among violations: 1.1754942e-38
E           Max relative difference among violations: 8388607.
E            ACTUAL: array([ 1.175494e-38, -1.175494e-38], dtype=float32)
E            DESIRED: array([ 1.e-45, -1.e-45], dtype=float32)
$ ONEAPI_DEVICE_SELECTOR=cuda pytest dpnp/tests/test_mathematical.py::TestSpacing::test_zeros
==============================2 passed in 1.18s =================================

And updates TestTensordot::test_axes and TestTensordot::test_linalg to increase a factor parameter in assert_dtype_allclose for scaling tolerance

E           Mismatched elements: 1 / 144 (0.694%)
E           Max absolute difference among violations: 1.28230759e-14
E           Max relative difference among violations: 2.90345891e-14
E            ACTUAL: array([[[[ 7.000190e+01,  1.559230e+01, -6.848580e+01],
E                    [ 5.029798e+01,  2.133680e+02, -5.294881e+01],
E                    [-6.261007e+01, -5.260484e+00,  9.316735e+00],...
E            DESIRED: array([[[[ 7.000190e+01,  1.559230e+01, -6.848580e+01],
E                    [ 5.029798e+01,  2.133680e+02, -5.294881e+01],
E                    [-6.261007e+01, -5.260484e+00,  9.316735e+00],...

FAILED dpnp/tests/test_product.py::TestTensordot::test_axes[axes1-float64] - AssertionError:
FAILED dpnp/tests/test_product.py::TestTensordot::test_axes[axes1-None] - AssertionError:
FAILED dpnp/tests/test_product.py::TestTensordot::test_linalg[axes1] - AssertionError:
  • Have you provided a meaningful PR description?
  • Have you added a test, reproducer or referred to 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 filing the PR as a draft?

Copy link
Contributor

github-actions bot commented Jan 8, 2025

View rendered docs @ https://intelpython.github.io/dpnp/pull/2251/index.html

@coveralls
Copy link
Collaborator

coveralls commented Jan 8, 2025

Coverage Status

coverage: 65.08%. remained the same
when pulling fac6342 on update_test_spacing_cuda
into 1bed3bd on master.

@vlad-perevezentsev vlad-perevezentsev changed the title Update TestSpacing::test_zeros Update TestSpacing and TestTensordot Jan 9, 2025
@vlad-perevezentsev vlad-perevezentsev merged commit e8c088c into master Jan 10, 2025
57 of 58 checks passed
@vlad-perevezentsev vlad-perevezentsev deleted the update_test_spacing_cuda branch January 10, 2025 13:02
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