Skip to content

DOC Refactor array API docs page - #34054

Merged
ogrisel merged 6 commits into
scikit-learn:mainfrom
betatim:refactor-array-api-docs-page
Jun 1, 2026
Merged

ogrisel merged 6 commits into
scikit-learn:mainfrom
betatim:refactor-array-api-docs-page

Conversation

@betatim

@betatim betatim commented May 19, 2026 •

Copy link
Copy Markdown
Member

Reference Issues/PRs

Follow up to #34021

What does this implement/fix? Explain your changes.

This moves content around and reduces the amount of duplication in the examples. The content itself isn't changed.

A new table at the top of the page lists the supported array producing libraries.

What do you think @ogrisel @cakedev0 ?

AI usage disclosure

I used AI assistance for:

  • Code generation (e.g., when writing an implementation or fixing a bug)

This moves content around and reduces the amount of duplication in the
examples. The content itself isn't changed. A new table at the top of
the page lists the supported array producing libraries.
Comment thread doc/modules/array_api.rst
- Supported Devices
- Notes
* - `PyTorch <https://pytorch.org/>`_
- `Install <https://pytorch.org/get-started/locally/>`_

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

For XPU, can you add this link? https://docs.pytorch.org/docs/2.12/notes/get_start_xpu.html

(you don't find those instructions in https://pytorch.org/get-started/locally/)

Maybe

Suggested change
- `Install <https://pytorch.org/get-started/locally/>`_
- `Install <https://pytorch.org/get-started/locally/>`_; or [XPU install](https://docs.pytorch.org/docs/2.12/notes/get_start_xpu.html)

@betatim betatim May 20, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I visited the "get started with XPU" page and https://intelpython.github.io/dpnp/quick_start_guide.html (the dpnp install link) where we state "see install link for driver setup" in the notes column. In the XPU case I saw the page and thought "yeah well, duh, you need drivers?!" and in the dpnp case I was not sure what the note was trying to tell me. All this makes me think: should we write a short subsection in the "Notes" section that adds two or three sentences to explain things a bit more and refer to it from the notes column? (We could also include the "XPU needs torch >= 2.12" in that section)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think this is a good idea.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I added a notes section. I realised as I was writing it that I am not sure what to include in it. What do you two think of what is in it now?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, I'm not sure what to include in additions to what you wrote either.

@cakedev0 cakedev0 left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Some minor things, plus some unrelated improvements we could slip in

(and thx, the table is indeed a pretty neat improvement)

Comment thread doc/modules/array_api.rst Resolved
Comment thread doc/modules/array_api.rst Resolved
Comment thread doc/modules/array_api.rst Resolved
Comment thread doc/modules/array_api.rst

Common estimator checks
=======================
Common estimator checks (for developers)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Big 👍

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I was thinking we should start a "For developers" section (similar to the "Notes") one and include the common checks and "everything follows X" sections in it. But then I thought that maybe the "everything follows X" section is useful for users as well. Maybe it would benefit from splitting into a user focussed and a developer focussed one. At which point I decided to leave it as it is for now.

Comment thread doc/modules/array_api.rst Resolved
Comment thread doc/modules/array_api.rst Resolved

@cakedev0 cakedev0 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think we can merge this PR as it is and iterate on a "for dev" section in another one.

Or we can iterate here.

(but I do think a for "dev section" would be nice, to remove noise from other sections)

@ogrisel ogrisel added this to the 1.9 milestone May 20, 2026
@ogrisel

ogrisel commented May 20, 2026

Copy link
Copy Markdown
Member

Since is a doc PR, I think we can backport it to the 1.9.X branch once merged to main.

@ogrisel ogrisel added the To backport PR merged in master that need a backport to a release branch defined based on the milestone. label May 20, 2026

@ogrisel ogrisel left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The doc min CI fails with the following warning:

'/home/circleci/project/doc/modules/array_api.rst:5: WARNING: Duplicate explicit target name: "install".

but I don't understand what particular change in this PR causes this.

EDIT: the rst links with a text that start with "Install" need to be updated to use two trailing underscores to generate anonymous references. Otherwise docutils implicitly generate named references with colliding names:

https://docutils.sourceforge.io/docs/ref/rst/restructuredtext.html#embedded-uris-and-aliases

Comment thread doc/modules/array_api.rst
Comment on lines +49 to +50
- CUDA
-

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

CuPy also provides experimental support for AMD GPUs but no official binary packages. There is an AMD hosted pypi index (https://pypi.amd.com/simple) though. I haven't tested them:

https://docs.cupy.dev/en/stable/install.html#using-cupy-on-amd-gpu-experimental

Suggested change
- CUDA
-
- CUDA
- CuPy also provides experimental AMD GPU support via ROCm but this has not yet been tested with scikit-learn.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I would not link to it until we have done some basic testing or get a user who uses this and gives a 👍 . For me this feels like something that is covered under the "other compliant libraries will also work but we haven't tested them".

Comment thread doc/modules/array_api.rst Resolved
Comment thread doc/modules/array_api.rst Resolved
Comment thread doc/modules/array_api.rst Resolved
Comment thread doc/modules/array_api.rst
- Supported Devices
- Notes
* - `PyTorch <https://pytorch.org/>`_
- `Install <https://pytorch.org/get-started/locally/>`_

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think this is a good idea.

@ogrisel ogrisel left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

To fix then the doc CI.

Comment thread doc/modules/array_api.rst Resolved
Comment thread doc/modules/array_api.rst Resolved
Comment thread doc/modules/array_api.rst Resolved
Comment thread doc/modules/array_api.rst Resolved
@betatim

betatim commented May 27, 2026

Copy link
Copy Markdown
Member Author

I think I'm happy with this if you are.

👍 on backporting

@ogrisel ogrisel left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think it's a net improvement. Let's merge and refine later if needed.

@ogrisel
ogrisel merged commit be2cc93 into scikit-learn:main Jun 1, 2026
33 checks passed
@betatim
betatim deleted the refactor-array-api-docs-page branch June 1, 2026 08:31
@betatim

betatim commented Jun 1, 2026

Copy link
Copy Markdown
Member Author

Being part of the milestone is enough to get this backported or should I do something else?

@jeremiedbb jeremiedbb mentioned this pull request Jun 1, 2026
16 tasks done
jeremiedbb pushed a commit that referenced this pull request Jun 2, 2026
prady0t pushed a commit to prady0t/scikit-learn that referenced this pull request Sep 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Documentation To backport PR merged in master that need a backport to a release branch defined based on the milestone.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants