IntelPython / dpctl

Python SYCL bindings and SYCL-based Python Array API library
https://intelpython.github.io/dpctl/
Apache License 2.0
97 stars 29 forks source link

Improve performance of test_sort_complex_fp_nan #1704

Closed oleksandr-pavlyk closed 4 weeks ago

oleksandr-pavlyk commented 4 weeks ago

This test used to perform numerous operations on very short vectors. The change replaced that with single row-wise operation on matrices.

Now:

(dev_dpctl) opavlyk@opavlyk-mobl:~/repos/dpctl$ SYCL_CACHE_PERSISTENT=1 ONEAPI_DEVICE_SELECTOR=opencl:gpu python -m pytest -v -s ~/repos/dpctl/dpctl/tests/test_usm_ndarray_sorting.py::test_sort_complex_fp_nan
=================================================================================== test session starts ====================================================================================
platform linux -- Python 3.12.3, pytest-8.2.0, pluggy-1.5.0 -- /home/opavlyk/mamba/envs/dev_dpctl/bin/python
cachedir: .pytest_cache
hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase(PosixPath('/home/opavlyk/repos/dpctl/.hypothesis/examples'))
metadata: {'Python': '3.12.3', 'Platform': 'Linux-5.15.146.1-microsoft-standard-WSL2-x86_64-with-glibc2.39', 'Packages': {'pytest': '8.2.0', 'pluggy': '1.5.0'}, 'Plugins': {'json-report': '1.5.0', 'hypothesis': '6.102.4', 'cov': '5.0.0', 'metadata': '3.1.1'}}
rootdir: /home/opavlyk/repos/dpctl
configfile: pyproject.toml
plugins: json-report-1.5.0, hypothesis-6.102.4, cov-5.0.0, metadata-3.1.1
collected 2 items

dpctl/tests/test_usm_ndarray_sorting.py::test_sort_complex_fp_nan[c8] PASSED
dpctl/tests/test_usm_ndarray_sorting.py::test_sort_complex_fp_nan[c16] SKIPPED (Intel(R) Graphics [0x9a49] does not support double precision floating point types)

=============================================================================== 1 passed, 1 skipped in 0.34s ===============================================================================

This single test used to take 3.5 seconds to execute.

github-actions[bot] commented 4 weeks ago

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

github-actions[bot] commented 4 weeks ago

Array API standard conformance tests for dpctl=0.18.0dev0=py310h15de555_32 ran successfully. Passed: 889 Failed: 12 Skipped: 91

coveralls commented 4 weeks ago

Coverage Status

coverage: 87.911%. remained the same when pulling 56f6276d8e9115c90565e6dfb1ec5ab489e41ef6 on improve-test-sort-complex-fp-nan-performance into d6d1526a63ba23227171567bfa902c26cf3f2314 on master.