Skip to content

Various documentation improvements #547

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

Merged
merged 9 commits into from
Apr 7, 2025
Merged

Various documentation improvements #547

merged 9 commits into from
Apr 7, 2025

Conversation

leofang
Copy link
Member

@leofang leofang commented Apr 5, 2025

@leofang leofang self-assigned this Apr 5, 2025
Copy link
Contributor

copy-pr-bot bot commented Apr 5, 2025

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@leofang leofang added this to the cuda-python 12.9.0 & 11.8.7 milestone Apr 5, 2025
@leofang leofang added documentation Improvements or additions to documentation P1 Medium priority - Should do cuda.bindings Everything related to the cuda.bindings module labels Apr 5, 2025
@leofang leofang changed the title WIP: Various documentation improvements Various documentation improvements Apr 5, 2025
@leofang leofang requested review from vzhurba01 and kkraus14 April 5, 2025 00:54
@leofang leofang marked this pull request as ready for review April 5, 2025 00:54
@leofang
Copy link
Member Author

leofang commented Apr 5, 2025

/ok to test

This comment has been minimized.

@leofang
Copy link
Member Author

leofang commented Apr 6, 2025

/ok to test

1 similar comment
@leofang
Copy link
Member Author

leofang commented Apr 6, 2025

/ok to test

@leofang leofang marked this pull request as draft April 6, 2025 21:10
@leofang
Copy link
Member Author

leofang commented Apr 7, 2025

/ok to test

@leofang
Copy link
Member Author

leofang commented Apr 7, 2025

/ok to test

@leofang leofang marked this pull request as ready for review April 7, 2025 01:36
"python": ("https://docs.python.org/3/", None),
"numpy": ("https://numpy.org/doc/stable/", None),
"nvvm": ("https://docs.nvidia.com/cuda/libnvvm-api/", None),
"nvjitlink": ("https://docs.nvidia.com/cuda/nvjitlink/", None),
Copy link
Collaborator

Choose a reason for hiding this comment

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

Any reason to add nvrtc or the CUDA runtime / driver APIs here?

Copy link
Member Author

@leofang leofang Apr 7, 2025

Choose a reason for hiding this comment

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

Currently the two codegens set different expectations regarding API doc generation. The codegen used by driver/runtime/nvrtc regenerates the entire C API references in the docs (with signatures adjusted to match Python), whereas the codegen used by nvvm/nvjitlink generates basic docs with a see also link to the corresponding C API. The addition of these links here contain proper objects.inv that allows cross-linking, e.g.
https://nvidia.github.io/cuda-python/pr-preview/pr-547/cuda-bindings/latest/module/nvjitlink.html#cuda.bindings.nvjitlink.create
The see also link works.

Copy link
Member Author

Choose a reason for hiding this comment

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

(FWIW regarding objects.inv, it's a binary that is generated by Sphinx and can be introspected by the intersphinx plugin.)

Comment on lines 58 to +59
$ export CUDA_HOME=/usr/local/cuda
$ export LIBRARY_PATH=$CUDA_HOME/lib64:$LIBRARY_PATH
Copy link
Collaborator

Choose a reason for hiding this comment

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

Note for the future: we really shouldn't need to set these when things are installed in standard locations.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, at some point we should revisit the build-time search behavior. Currently we limit to full explicitness at build time (no implicit auto-discovery behind users' back), while the ongoing path finder project (#451) focuses on run-time use cases. Once the path finder is mature we can consider using it at build time too (cc @rwgk for vis).

FWIW though, right now it is not as bad as it seems. If CUDA is installed via Linux system pkg mgr or conda, we need at most $CUDA_HOME defined. The system or conda compiler knows where the static library is. So this is required really only for CUDA installed to non-default locations.

BTW, Python projects can be built against CUDA wheels, as long as they don't contain device code that needs to be compiled by nvcc. I've enabled this for cuquantum-python/nvmath-python, and it's quite handy actually. It's only a matter of time that we also propagate this capability to cuda-bindings. The only downside is that if the C libraries are not yet public, building against public C wheels does not work for obvious reasons and we need a fallback (i.e. the current behavior).

@leofang
Copy link
Member Author

leofang commented Apr 7, 2025

/ok to test

@leofang leofang enabled auto-merge April 7, 2025 17:22
Copy link
Collaborator

@rwgk rwgk left a comment

Choose a reason for hiding this comment

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

Nice!

The only super tiny thing that stood out to me: maybe keep nvJitLink, NVRTC, NVVM in lexicographical order? — It doesn't matter much for just three items, but might be helpful if we add more.

@leofang leofang merged commit 899ccee into NVIDIA:main Apr 7, 2025
73 checks passed
Copy link

github-actions bot commented Apr 7, 2025

Doc Preview CI
Preview removed because the pull request was closed or merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cuda.bindings Everything related to the cuda.bindings module documentation Improvements or additions to documentation P1 Medium priority - Should do
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add numba-cuda to the list of CUDA Python projects Document static library source build requirement
4 participants