-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add compatibility tables to rendered specification #607
base: main
Are you sure you want to change the base?
Conversation
Thanks @kgryte, good to see this coming to life! Mobile devices: let's not worry about that just yet. Sphinx indeed isn't great in that respect. Regarding the content for an individual API like shown in the screenshot below, it'd be great to link to a page where the methodology is explained. E.g., when is something marked as "partial" or "experimental" exactly? Also, what happens where there are changes from one version to the next? E.g., experimental and partial in release X, experimental and full support in release Y, and finally stable support in release Z. |
Updated the PR to include methodology section. Linking to this section from the compat table section is still TBD and a bit tricky to do elegantly given that compat tables are injected external to the Sphinx build process. Nevertheless, this should be possible to update in a future PR if this is believed necessary. The methodology section describes compat table evolution as the underlying libraries evolve to achieve specification compliance. The section displays static example tables showing what happens during this evolution. Mobile support is left for future work and would likely require a decent amount of engineering time. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The tables and timeline foldouts look pretty polished now - nice work @kgryte!
The data itself still seems incomplete and the presentation across APIs a little inconsistent - enough that I'll start my review with those things only:
- It seems like for PyTorch some things are marked as full support, while for NumPy/CuPy as partial support (e.g., for
asarray
). None have__array_namespace__
as an attribute in their main namespace, so this seems based on an inconsistent criterion. - Conceptually, everything seems marked as "no support" when
__array_namespace__
hasn't been added. Is that the right choice? It is perhaps more useful to track compatibility in main (or dedicated if present) namespaces, and in a single place have a marker for "has adopted via__array_namespace__
". Otherwise we'll be staring at red crosses for a long time. Alternatively, we could add markers for whatarray-api-compat
provides, or a "viaarray-api-compat
symbol". That last one seems particularly attractive. - Is it really useful to have a separate row for each keyword argument? That seems duplicate with the "partial support" marker, and I think I prefer the latter.
@rgommers Thanks for taking a look. In terms of feedback, this can be split into two parts: (1) what this PR achieves (i.e., UI/UX) and (2) compat data as compiled in the upstream repository.
The data should be updated. At the time of the PR build, the compat data was stale. I manually triggered the build, so tables should be updated based on the latest in the array API compat repository. As the data was stale, I would not read much into any perceived "patterns". For NumPy and CuPy which have dedicated
My preference is not to include
IMO, yes, we should have a separate row for each keyword argument. For example, consider By breaking out into separate rows, users can see/investigate exactly where support is lacking. From the table, users can see that, as long as their usage only involves positional arguments, they can safely use Consider also where PyTorch added support for the Hopefully, this helps clarify why having separate rows is useful. And it will be useful, as well, when, e.g., I add "complex number support" as a row to affected APIs. |
For reference, a more birds-eye view of compat data can be found at the following link: https://data-apis.org/array-api-compat-data/. |
This PR:
.gitignore
to cover more types of files, including temp directories and Node.js dirs and files.Notes
make spec
to view the rendered specification locally; however, the rendered specification will not contain compatibility info. If a dev wants to render compat info locally, they can install Node.js and run themake compat
command separately.make spec
may overwrite files containing compat tables and rerunningmake compat
will, atm, append extra compat tables to existing files. If one wants to rerender the entire spec with compat tables, the easiest way to ensure that everything works as desired is to runmake clean
beforemake spec && make compat
. Again, for local development, devs should not have a need to actually render compat tables, so the above discussion is more for completeness.