diff --git a/doc/modules/array_api.rst b/doc/modules/array_api.rst index d24ce3573e7b6..e1a499c97506b 100644 --- a/doc/modules/array_api.rst +++ b/doc/modules/array_api.rst @@ -202,17 +202,32 @@ it supports the Array API. This will enable dedicated checks as part of the common tests to verify that the estimators' results are the same when using vanilla NumPy and Array API inputs. -To run the full set of checks you need to install both -`PyTorch `_ and `CuPy `_ and have +To run these checks you need to install +`array-api-strict `_ in your +test environment. This allows you to run checks without having a +GPU. To run the full set of checks you also need to install +`PyTorch `_, `CuPy `_ and have a GPU. Checks that can not be executed or have missing dependencies will be automatically skipped. Therefore it's important to run the tests with the `-v` flag to see which checks are skipped: .. prompt:: bash $ - pip install ... # selected libraries as needed + pip install array-api-strict # and other libraries as needed pytest -k "array_api" -v +Running the scikit-learn tests against `array-api-strict` should help reveal +most code problems related to handling multiple device inputs via the use of +simulated non-CPU devices. This allows for fast iterative development and debugging of +array API related code. + +However, to ensure full handling of PyTorch or CuPy inputs allocated on actual GPU +devices, it is necessary to run the tests against those libraries and hardware. +This can either be achieved by using +`Google Colab `_ +or leveraging our CI infrastructure on pull requests (manually triggered by maintainers +for cost reasons). + .. _mps_support: Note on MPS device support