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

Update the scope of third party tests with the latest changes #2148

Draft
wants to merge 33 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
a501d3a
Add test_typing.py
antonwolfy Nov 5, 2024
3a73b4c
Update test_type_routines.py
antonwolfy Nov 5, 2024
9f96cc1
Add test_numpy_interop.py
antonwolfy Nov 5, 2024
40c9ba0
Update test_ndim.py
antonwolfy Nov 5, 2024
681f7ae
Add test_init.py
antonwolfy Nov 5, 2024
a4a89f5
Add __init__.py
antonwolfy Nov 5, 2024
46b166a
Update statistics_tests/test_order.py
antonwolfy Nov 5, 2024
24979dc
Update statistics_tests/test_meanvar.py
antonwolfy Nov 5, 2024
aba974a
Update statistics_tests/test_histogram.py
antonwolfy Nov 5, 2024
64e8c85
Update statistics_tests/test_correlation.py
antonwolfy Nov 5, 2024
c2d2815
Add new tests to scope of public CI
antonwolfy Nov 5, 2024
3a8cb9b
Fix issue with fp64 in test_numpy_interop.py::test_asnumpy
antonwolfy Nov 5, 2024
de1c46d
dpnp.exceptions is not implemented
antonwolfy Nov 5, 2024
fb93a76
Merge branch 'master' into align-third-party-tests
antonwolfy Nov 9, 2024
2ac4f94
Merge branch 'master' into align-third-party-tests
antonwolfy Nov 14, 2024
b7b73f7
Enable TestCorrcoef scope
antonwolfy Nov 14, 2024
9c887a9
Update sorting_tests/test_count.py
antonwolfy Nov 14, 2024
4e7b432
Update sorting_tests/test_search.py
antonwolfy Nov 14, 2024
d292956
Update sorting_tests/test_sort.py
antonwolfy Nov 14, 2024
060fdf9
Keep test_count_nonzero unchanged to work on Windows
antonwolfy Nov 14, 2024
abe4224
Merge branch 'master' into align-third-party-tests
antonwolfy Nov 14, 2024
cf4ee15
Exclude random tests from files with skipped tests
antonwolfy Nov 15, 2024
12ca5d7
Update random_tests/test_sample.py
antonwolfy Nov 15, 2024
e405d24
Update random_tests/test_random.py
antonwolfy Nov 15, 2024
243612d
Update random_tests/test_permutations.py
antonwolfy Nov 15, 2024
fa270d3
Merge branch 'master' into align-third-party-tests
antonwolfy Nov 15, 2024
142b4fa
Add random_tests/test_init.py
antonwolfy Nov 15, 2024
17ba4cc
Add common_distributions.py, test_generator_api.py, common_distributi…
antonwolfy Nov 15, 2024
3fb0a8a
Add test_bit_generator.py
antonwolfy Nov 15, 2024
ef68961
Update random_tests/test_distributions.py
antonwolfy Nov 15, 2024
f9387f7
Resolve failure on Windows in hypergeometric distribution
antonwolfy Nov 15, 2024
2c19837
Allow fallback on NumPy in a test for randint
antonwolfy Nov 15, 2024
f9775cd
Make a valid numpy version string
antonwolfy Nov 16, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
214 changes: 0 additions & 214 deletions tests/skipped_tests.tbl

Large diffs are not rendered by default.

215 changes: 0 additions & 215 deletions tests/skipped_tests_gpu.tbl

Large diffs are not rendered by default.

171 changes: 0 additions & 171 deletions tests/skipped_tests_gpu_no_fp64.tbl

Large diffs are not rendered by default.

Empty file.
517 changes: 517 additions & 0 deletions tests/third_party/cupy/random_tests/common_distributions.py

Large diffs are not rendered by default.

80 changes: 80 additions & 0 deletions tests/third_party/cupy/random_tests/test_bit_generator.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
import unittest

import numpy
import pytest

import dpnp as cupy
from dpnp import random
from tests.third_party.cupy import testing

pytest.skip("bit generator is not supported yet", allow_module_level=True)


class BitGeneratorTestCase:

def setUp(self):
self.seed = testing.generate_seed()

def check_seed(self, seed):
bg1 = self.bg(seed)
bg2 = self.bg(seed)
bg3 = self.bg(None)

xs1 = bg1.random_raw(10)
xs2 = bg2.random_raw(10)
xs3 = bg3.random_raw(10)

# Random state must be reproducible
assert cupy.array_equal(xs1, xs2)
# Random state must be initialized randomly with seed=None
assert not cupy.array_equal(xs1, xs3)

@testing.for_int_dtypes(no_bool=True)
def test_seed_not_none(self, dtype):
self.check_seed(dtype(0))

@testing.for_dtypes([numpy.complex128])
def test_seed_invalid_type_complex(self, dtype):
with self.assertRaises(TypeError):
self.bg(dtype(0))

@testing.for_float_dtypes()
def test_seed_invalid_type_float(self, dtype):
with self.assertRaises(TypeError):
self.bg(dtype(0))

def test_array_seed(self):
self.check_seed(numpy.random.randint(0, 2**31, size=10))


@testing.with_requires("numpy>=1.17.0")
@testing.fix_random()
@pytest.mark.skipif(
cupy.cuda.runtime.is_hip, reason="HIP does not support this"
)
class TestBitGeneratorXORWOW(BitGeneratorTestCase, unittest.TestCase):
def setUp(self):
super().setUp()
self.bg = random._bit_generator.XORWOW


@testing.with_requires("numpy>=1.17.0")
@testing.fix_random()
@pytest.mark.skipif(
cupy.cuda.runtime.is_hip, reason="HIP does not support this"
)
class TestBitGeneratorMRG32k3a(BitGeneratorTestCase, unittest.TestCase):
def setUp(self):
super().setUp()
self.bg = random._bit_generator.MRG32k3a


@testing.with_requires("numpy>=1.17.0")
@testing.fix_random()
@pytest.mark.skipif(
cupy.cuda.runtime.is_hip, reason="HIP does not support this"
)
class TestBitGeneratorPhilox4x3210(BitGeneratorTestCase, unittest.TestCase):
def setUp(self):
super().setUp()
self.bg = random._bit_generator.Philox4x3210
Loading