8000 DOC Update array API common checks docs (#31050) · scikit-learn/scikit-learn@e906f0e · GitHub
[go: up one dir, main page]

Skip to content

Commit e906f0e

Browse files
betatimogrisel
andauthored
DOC Update array API common checks docs (#31050)
Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
1 parent 637bb47 commit e906f0e

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

doc/modules/array_api.rst

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -202,17 +202,32 @@ it supports the Array API. This will enable dedicated checks as part of the
202202
common tests to verify that the estimators' results are the same when using
203203
vanilla NumPy and Array API inputs.
204204

205-
To run the full set of checks you need to install both
206-
`PyTorch <https://pytorch.org/>`_ and `CuPy <https://cupy.dev/>`_ and have
205+
To run these checks you need to install
206+
`array-api-strict <https://data-apis.org/array-api-strict/>`_ in your
207+
test environment. This allows you to run checks without having a
208+
GPU. To run the full set of checks you also need to install
209+
`PyTorch <https://pytorch.org/>`_, `CuPy <https://cupy.dev/>`_ and have
207210
a GPU. Checks that can not be executed or have missing dependencies will be
208211
automatically skipped. Therefore it's important to run the tests with the
209212
`-v` flag to see which checks are skipped:
210213

211214
.. prompt:: bash $
212215

213-
pip install ... # selected libraries as needed
216+
pip install array-api-strict # and other libraries as needed
214217
pytest -k "array_api" -v
215218

219+
Running the scikit-learn tests against `array-api-strict` should help reveal
220+
most code problems related to handling multiple device inputs via the use of
221+
simulated non-CPU devices. This allows for fast iterative development and debugging of
222+
array API related code.
223+
224+
However, to ensure full handling of PyTorch or CuPy inputs allocated on actual GPU
225+
devices, it is necessary to run the tests against those libraries and hardware.
226+
This can either be achieved by using
227+
`Google Colab <https://gist.github.com/EdAbati/ff3bdc06bafeb92452b3740686cc8d7c>`_
228+
or leveraging our CI infrastructure on pull requests (manually triggered by maintainers
229+
for cost reasons).
230+
216231
.. _mps_support:
217232

218233
Note on MPS device support

0 commit comments

Comments
 (0)
0