Skip to content

Remove the legacy backend RNG - #3163

Open
ndgrigorian wants to merge 1 commit into
feature/device-rng-random-statefrom
feature/remove-legacy-rng
Open

ndgrigorian wants to merge 1 commit into
feature/device-rng-random-statefrom
feature/remove-legacy-rng

Conversation

@ndgrigorian

@ndgrigorian ndgrigorian commented Nov 4, 2026 •

Copy link
Copy Markdown
Collaborator

This PR removes the legacy RNG implementation of dpnp.random from dpnp_backend_c, along with the newly-dead code in the backend, as the last part of the series splitting #3147. It is stacked on #3162

Removes

  • The dpnp_algo_random Cython module, the backend RNG kernels, DPNPRandomState, the DPNP_FN_RNG_* function pointers and the mt19937/mcg59 engines of backend_sycl
  • The backend's C++ examples, its GTest suite and the DPNP_BACKEND_TESTS CMake option
  • The NumPy fallback helper call_origin and the other helpers that only the RNG used
  • The onemkl-sycl-rng pin in the conda recipes

dpnp_backend_c itself stays, since dpnp.partition still uses it (#3138 removes that)

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

@github-actions

github-actions Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Array API standard conformance tests for dpnp=0.22.0dev1=np2py314h8d9cdd5_29 ran successfully.
Passed: 1491
Failed: 0
Skipped: 6

@coveralls

coveralls commented Nov 4, 2026 •

Copy link
Copy Markdown
Collaborator

Coverage Status

Coverage is 86.23% — feature/remove-legacy-rng into feature/device-rng-random-state. No base build found for feature/device-rng-random-state.

@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

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

@ndgrigorian
ndgrigorian force-pushed the feature/remove-legacy-rng branch from 71b2060 to 86d7f1b Compare November 6, 2026 17:55
@ndgrigorian
ndgrigorian force-pushed the feature/device-rng-random-state branch from 160719a to 014a132 Compare November 6, 2026 17:55
dpnp.random no longer uses dpnp_backend_c, so drop the dpnp_algo_random
Cython module, the backend RNG kernels, DPNPRandomState, the
DPNP_FN_RNG_* function pointers, the backend engines and their examples
and tests, and the now-unused parts of the backend, including its GTest
suite, the DPNP_BACKEND_TESTS option and call_origin. The conda recipes
no longer pin onemkl-sycl-rng.
@ndgrigorian
ndgrigorian force-pushed the feature/remove-legacy-rng branch from c3083f7 to 5ed41e0 Compare November 8, 2026 21:54
@ndgrigorian
ndgrigorian force-pushed the feature/device-rng-random-state branch from edee62b to 843a343 Compare November 8, 2026 21:54
Comment thread CHANGELOG.md
* Removed the unused `FourZeroOffsets_Indexer`, `FixedDimStridedIndexer` and `ThreeOffsets_FixedDimStridedIndexer` from the libtensor header `utils/offset_utils.hpp` [#3131](https://github.com/IntelPython/dpnp/pull/3131)
* Dropped support for Python 3.10 [#3173](https://github.com/IntelPython/dpnp/pull/3173)
* Removed the legacy backend implementation of `dpnp.random`, which no longer needs `onemkl-sycl-rng` [#3163](https://github.com/IntelPython/dpnp/pull/3163)
* Removed the unused parts of the legacy `dpnp_backend_c` library, including its empty GTest suite, the `DPNP_BACKEND_TESTS` CMake option and the NumPy fallback helper `call_origin` [#3163](https://github.com/IntelPython/dpnp/pull/3163)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

call_origin was the only reader of dpnp.config.__DPNP_RAISE_EXCEPION_ON_NUMPY_FALLBACK__ (env DPNP_RAISE_EXCEPION_ON_NUMPY_FALLBACK). After this PR the setting does nothing, with no warning. Could it go into _DEPRECATED_SETTINGS in dpnp/config.py, as in #3107, with a Deprecated entry? Then the allow_fall_back_on_numpy fixture (33 uses in the CuPy random tests) can go too.

Comment thread conda-recipe-cf/meta.yaml
- {{ pin_compatible('onemkl-sycl-dft', min_pin='x.x', max_pin='x') }}
- {{ pin_compatible('onemkl-sycl-lapack', min_pin='x.x', max_pin='x') }}
- {{ pin_compatible('onemkl-sycl-rng', min_pin='x.x', max_pin='x') }}
- {{ pin_compatible('onemkl-sycl-vm', min_pin='x.x', max_pin='x') }}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The conda-forge mkl-devel-dpcpp in host has a weak run export mkl-dpcpp, and mkl-dpcpp depends on onemkl-sycl-rng. So a package built from this recipe still installs it. rattler_recipe.yaml already lists mkl-dpcpp in ignore_run_exports; could this recipe do the same?

This branch has not been deployed

No deployments
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