From 12726cd9300ae6420964518ceb3b1eb27a70ab9b Mon Sep 17 00:00:00 2001 From: Leo Fang Date: Fri, 24 Jan 2025 03:05:16 +0000 Subject: [PATCH 1/7] note lifetime --- cuda_bindings/docs/source/index.rst | 1 + cuda_bindings/docs/source/support.rst | 27 +++++++++++++++++++ cuda_bindings/docs/source/tips_and_tricks.rst | 6 +++++ 3 files changed, 34 insertions(+) create mode 100644 cuda_bindings/docs/source/support.rst diff --git a/cuda_bindings/docs/source/index.rst b/cuda_bindings/docs/source/index.rst index a12320019..bfa5a671f 100644 --- a/cuda_bindings/docs/source/index.rst +++ b/cuda_bindings/docs/source/index.rst @@ -12,6 +12,7 @@ environment_variables.md api.rst tips_and_tricks.rst + support.rst Indices and tables diff --git a/cuda_bindings/docs/source/support.rst b/cuda_bindings/docs/source/support.rst new file mode 100644 index 000000000..d052b0d8c --- /dev/null +++ b/cuda_bindings/docs/source/support.rst @@ -0,0 +1,27 @@ +``cuda.bindings`` Support Policy +================================ + +The ``cuda.bindings`` module has the following support policy: +1. The module shares the same ``major.minor`` version with the CUDA Toolkit. The patch version (the + third number in the version string), however, is reserved to reflect Python-only changes and + is out of sync with the Toolkit patch version. +2. The module is actively maintained to support the latest CUDA major version and its prior major + version. For example, as of writing the bindings for CUDA 11 & 12 are maintained. Any fix in the + latest bindings would be backported to the prior major version. +3. The module supports `CUDA minor version compatibility`_, meaning that ``cuda.bindings`` 12.x + supports any Toolkit 12.y. (Whether or not a binding API would actually correctly function + depends on the underlying driver and the Toolkit versions, as described in the compatibility + documentation.) +4. The module supports all Python versions following the `CPython EOL schedule`_. As of writing + Python 3.9 - 3.13 are supported. +5. The module exposes a Cython layer from which types and functions could be ``cimport``'d. While + we strive to keep this layer stable, due to Cython limitations a new *minor* release of this + module could require Cython layer users to rebuild their projects and update their pinning to + this module. + +The NVIDIA CUDA Python team reserves rights to amend the above support policy. Any major changes, +however, will be announced to the users in advance. + + +.. _CUDA minor version compatibility: https://docs.nvidia.com/deploy/cuda-compatibility/#minor-version-compatibility +.. _CPython EOL schedule: https://devguide.python.org/versions/ diff --git a/cuda_bindings/docs/source/tips_and_tricks.rst b/cuda_bindings/docs/source/tips_and_tricks.rst index d979ea859..264396f8e 100644 --- a/cuda_bindings/docs/source/tips_and_tricks.rst +++ b/cuda_bindings/docs/source/tips_and_tricks.rst @@ -7,3 +7,9 @@ Getting the address of underlying C objects from the low-level bindings All CUDA C types are exposed to Python as Python classes. For example, the :class:`~cuda.bindings.driver.CUstream` type is exposed as a class with methods :meth:`~cuda.bindings.driver.CUstream.getPtr()` and :meth:`~cuda.bindings.driver.CUstream.__int__()` implemented. There is an important distinction between the ``getPtr()`` method and the behaviour of ``__int__()``. If you need to get the pointer address *of* the underlying ``CUstream`` C object wrapped in the Python class, you can do so by calling ``int(instance_of_CUstream)``, which returns the address as a Python `int`, while calling ``instance_of_CUstream.getPtr()`` returns the pointer *to* the ``CUstream`` C object (that is, ``&CUstream``) as a Python `int`. + + +Lifetime management of the CUDA objects +======================================= + +All of the Python classes do not manage the lifetime of the underlying CUDA C objects. It is the user's responsibility to use the appropriate APIs to explicitly destruct the objects following the CUDA Programming Guide. From 951e8888982a0c1b3ce445b6f147ca8ecc1e5589 Mon Sep 17 00:00:00 2001 From: Leo Fang Date: Fri, 24 Jan 2025 03:33:30 +0000 Subject: [PATCH 2/7] update release notes --- cuda_bindings/docs/source/index.rst | 8 ++--- cuda_bindings/docs/source/release.md | 31 ------------------- cuda_bindings/docs/source/release.rst | 30 ++++++++++++++++++ .../docs/source/release/11.8.6-notes.md | 28 +++++++++++++++++ .../docs/source/release/12.8.0-notes.md | 30 ++++++++++++++++++ .../docs/source/release/12.x.y-notes.md | 24 -------------- 6 files changed, 92 insertions(+), 59 deletions(-) delete mode 100644 cuda_bindings/docs/source/release.md create mode 100644 cuda_bindings/docs/source/release.rst create mode 100644 cuda_bindings/docs/source/release/11.8.6-notes.md create mode 100644 cuda_bindings/docs/source/release/12.8.0-notes.md delete mode 100644 cuda_bindings/docs/source/release/12.x.y-notes.md diff --git a/cuda_bindings/docs/source/index.rst b/cuda_bindings/docs/source/index.rst index bfa5a671f..e94f0dcc1 100644 --- a/cuda_bindings/docs/source/index.rst +++ b/cuda_bindings/docs/source/index.rst @@ -5,14 +5,14 @@ :maxdepth: 2 :caption: Contents: + release install.md overview.md motivation.md - release.md environment_variables.md - api.rst - tips_and_tricks.rst - support.rst + api + tips_and_tricks + support Indices and tables diff --git a/cuda_bindings/docs/source/release.md b/cuda_bindings/docs/source/release.md deleted file mode 100644 index 2e21561ec..000000000 --- a/cuda_bindings/docs/source/release.md +++ /dev/null @@ -1,31 +0,0 @@ -# Release Notes - -```{toctree} ---- -maxdepth: 3 ---- - - 12.x.y - 12.6.2 - 12.6.1 - 12.6.0 - 12.5.0 - 12.4.0 - 12.3.0 - 12.2.1 - 12.2.0 - 12.1.0 - 12.0.0 - 11.8.5 - 11.8.4 - 11.8.3 - 11.8.2 - 11.8.1 - 11.8.0 - 11.7.1 - 11.7.0 - 11.6.1 - 11.6.0 - 11.5.0 - 11.4.0 -``` diff --git a/cuda_bindings/docs/source/release.rst b/cuda_bindings/docs/source/release.rst new file mode 100644 index 000000000..fc68018a7 --- /dev/null +++ b/cuda_bindings/docs/source/release.rst @@ -0,0 +1,30 @@ +Release Notes +============= + +.. toctree:: + :maxdepth: 3 + + 12.8.0 + 12.6.2 + 12.6.1 + 12.6.0 + 12.5.0 + 12.4.0 + 12.3.0 + 12.2.1 + 12.2.0 + 12.1.0 + 12.0.0 + 11.8.6 + 11.8.5 + 11.8.4 + 11.8.3 + 11.8.2 + 11.8.1 + 11.8.0 + 11.7.1 + 11.7.0 + 11.6.1 + 11.6.0 + 11.5.0 + 11.4.0 diff --git a/cuda_bindings/docs/source/release/11.8.6-notes.md b/cuda_bindings/docs/source/release/11.8.6-notes.md new file mode 100644 index 000000000..3733f48ba --- /dev/null +++ b/cuda_bindings/docs/source/release/11.8.6-notes.md @@ -0,0 +1,28 @@ +# `cuda-bindings` 11.8.6 Release notes + +Released on January 24, 2025. + + +## Highlights + +- Add an optional dependency on the CUDA NVRTC wheel +- Enable discovery and loading of shared libraries from CUDA wheels +- `cuda-python` is now a meta package, currently depending only on `cuda-bindings` ([see RFC](https://github.com/NVIDIA/cuda-python/issues/105)) + + +## Wheels support for optional dependencies + +Optional dependencies are added for packages: + +- nvidia-cuda-nvrtc-cu12 + +Installing these dependencies with `cuda-python` can be done using: +```{code-block} shell +pip install cuda-python[all] +``` +Same applies to `cuda-bindings`. + + +## Discovery and loading of shared library dependencies from wheels + +Shared library search paths for wheel builds are now extended to check site-packages. This allows `cuda-python`/`cuda-bindings` to seamlessly use the aforementioned CUDA Toolkit wheels installed in the user's Python environment. diff --git a/cuda_bindings/docs/source/release/12.8.0-notes.md b/cuda_bindings/docs/source/release/12.8.0-notes.md new file mode 100644 index 000000000..5915725af --- /dev/null +++ b/cuda_bindings/docs/source/release/12.8.0-notes.md @@ -0,0 +1,30 @@ +# `cuda-bindings` 12.8.0 Release notes + +Released on January 24, 2025. + + +## Highlights + +- Add bindings for nvJitLink (requires nvJitLink from CUDA 12.3 or above) +- Add optional dependencies on CUDA NVRTC and nvJitLink wheels +- Enable discovery and loading of shared libraries from CUDA wheels +- `cuda-python` is now a meta package, currently depending only on `cuda-bindings` ([see RFC](https://github.com/NVIDIA/cuda-python/issues/105)) + + +## Wheels support for optional dependencies + +Optional dependencies are added for packages: + +- nvidia-cuda-nvrtc-cu12 +- nvidia-nvjitlink-cu12 + +Installing these dependencies with `cuda-python` can be done using: +```{code-block} shell +pip install cuda-python[all] +``` +Same applies to `cuda-bindings`. + + +## Discovery and loading of shared library dependencies from wheels + +Shared library search paths for wheel builds are now extended to check site-packages. This allows `cuda-python`/`cuda-bindings` to seamlessly use the aforementioned CUDA Toolkit wheels installed in the user's Python environment. diff --git a/cuda_bindings/docs/source/release/12.x.y-notes.md b/cuda_bindings/docs/source/release/12.x.y-notes.md deleted file mode 100644 index 9eff5ac70..000000000 --- a/cuda_bindings/docs/source/release/12.x.y-notes.md +++ /dev/null @@ -1,24 +0,0 @@ -# CUDA Python 12.X.Y Release notes - -Released on MM DD, 20YY. - -## Highlights -- Add bindings for nvJitLink. It requires nvJitLink from CUDA 12.3 or above. -- Add optional dependencies to wheels for NVRTC and nvJitLink -- Enable discovery and loading of shared library dependencies from wheels - -## Wheels support for optional dependencies - -Optional dependencies are added for packages: - -- nvidia-nvjitlink-cuXX -- nvidia-cuda-nvrtc-cuXX - -Installing these dependencies with cuda-python can be done using: -```{code-block} shell -pip install cuda-python[all] -``` - -## Discovery and loading of shared library dependencies from wheels - -Shared library search paths for wheel builds are now extended to check site-packages. This allows users to seamlessly use their wheel installation of the CUDA Toolkit with cuda-python. From 0e1f9ded6aebdefb8ad86e6d30825e81fd8d1bb4 Mon Sep 17 00:00:00 2001 From: Leo Fang Date: Fri, 24 Jan 2025 03:46:23 +0000 Subject: [PATCH 3/7] note about cuda-bindings and -U --- cuda_bindings/docs/source/install.md | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/cuda_bindings/docs/source/install.md b/cuda_bindings/docs/source/install.md index 95420456d..0134eadc1 100644 --- a/cuda_bindings/docs/source/install.md +++ b/cuda_bindings/docs/source/install.md @@ -11,18 +11,33 @@ Only the NVRTC and nvJitLink redistributable components are required from the CUDA Toolkit, which can be obtained via PyPI, Conda, or local installers (as described in the CUDA Toolkit [Windows](https://docs.nvidia.com/cuda/cuda-installation-guide-microsoft-windows/index.html) and [Linux](https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html) Installation Guides). ``` +Starting from v12.8.0, `cuda-python` becomes a meta package which currently depends only on `cuda-bindings`; in the future more sub-packages will be added to `cuda-python`. In the instructions below, we still use `cuda-python` as example to serve existing users, but everything is applicable to `cuda-bindings` as well. + + ## Installing from PyPI ```console -$ pip install cuda-python +$ pip install -U cuda-python ``` +Install all optional dependencies with: +```{code-block} shell +pip install -U cuda-python[all] +``` + +Where the optional dependencies are: + +* nvidia-cuda-nvrtc-cu12 (Provides NVRTC shared library) +* nvidia-nvjitlink-cu12>=12.3 (Provides nvJitLink shared library) + + ## Installing from Conda ```console $ conda install -c conda-forge cuda-python ``` + ## Installing from Source ### Requirements @@ -43,6 +58,7 @@ See [Environment Variables](environment_variables.md) for a description of other Only `cydriver`, `cyruntime` and `cynvrtc` are impacted by the header requirement. ``` + ### Editable Install You can use From cea9c853787db206dbdf41ee3c8ec8e25fbdf91c Mon Sep 17 00:00:00 2001 From: Leo Fang Date: Fri, 24 Jan 2025 18:06:16 +0000 Subject: [PATCH 4/7] bump versions in docs --- cuda_bindings/docs/versions.json | 5 +++-- cuda_python/docs/versions.json | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/cuda_bindings/docs/versions.json b/cuda_bindings/docs/versions.json index de97bb1c7..e8d041576 100644 --- a/cuda_bindings/docs/versions.json +++ b/cuda_bindings/docs/versions.json @@ -1,5 +1,6 @@ { "latest" : "latest", - "12.6.1" : "12.6.1", - "12.6.2" : "12.6.2" + "12.8.0" : "12.8.0", + "12.6.2" : "12.6.2", + "12.6.1" : "12.6.1" } diff --git a/cuda_python/docs/versions.json b/cuda_python/docs/versions.json index de97bb1c7..e8d041576 100644 --- a/cuda_python/docs/versions.json +++ b/cuda_python/docs/versions.json @@ -1,5 +1,6 @@ { "latest" : "latest", - "12.6.1" : "12.6.1", - "12.6.2" : "12.6.2" + "12.8.0" : "12.8.0", + "12.6.2" : "12.6.2", + "12.6.1" : "12.6.1" } From c7b223284bada29f36d26573d4e3c873a9e981fa Mon Sep 17 00:00:00 2001 From: Leo Fang Date: Fri, 24 Jan 2025 18:11:40 +0000 Subject: [PATCH 5/7] add cuda-python 12.8.0 release notes --- cuda_python/docs/source/release.md | 1 + cuda_python/docs/source/release/12.8.0-notes.md | 15 +++++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 cuda_python/docs/source/release/12.8.0-notes.md diff --git a/cuda_python/docs/source/release.md b/cuda_python/docs/source/release.md index 53a647f50..c6c829c6e 100644 --- a/cuda_python/docs/source/release.md +++ b/cuda_python/docs/source/release.md @@ -5,6 +5,7 @@ maxdepth: 3 --- + 12.8.0 12.6.2 12.6.1 ``` diff --git a/cuda_python/docs/source/release/12.8.0-notes.md b/cuda_python/docs/source/release/12.8.0-notes.md new file mode 100644 index 000000000..c4321238c --- /dev/null +++ b/cuda_python/docs/source/release/12.8.0-notes.md @@ -0,0 +1,15 @@ +# CUDA Python 12.8.0 Release notes + +Released on January 24, 2025. + +## Included components + +- [`cuda.bindings` 12.8.0](../cuda-bindings/12.8.0/release/12.8.0-notes.html) + + +## Highlights + +- Add bindings for nvJitLink (requires nvJitLink from CUDA 12.3 or above) +- Add optional dependencies on CUDA NVRTC and nvJitLink wheels +- Enable discovery and loading of shared libraries from CUDA wheels +- `cuda-python` is now a meta package, currently depending only on `cuda-bindings` ([see RFC](https://github.com/NVIDIA/cuda-python/issues/105)) From 44f3c3e774b17c594cb36e1d739f696d17eb1afc Mon Sep 17 00:00:00 2001 From: Leo Fang Date: Fri, 24 Jan 2025 19:40:28 +0000 Subject: [PATCH 6/7] 3 fixes - fix support page rendering - fix relative url - add 11.8.6 cuda-python nodes --- cuda_bindings/docs/source/support.rst | 1 + cuda_python/docs/source/release/11.8.6-notes.md | 14 ++++++++++++++ cuda_python/docs/source/release/12.8.0-notes.md | 2 +- 3 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 cuda_python/docs/source/release/11.8.6-notes.md diff --git a/cuda_bindings/docs/source/support.rst b/cuda_bindings/docs/source/support.rst index d052b0d8c..ea273ac0f 100644 --- a/cuda_bindings/docs/source/support.rst +++ b/cuda_bindings/docs/source/support.rst @@ -2,6 +2,7 @@ ================================ The ``cuda.bindings`` module has the following support policy: + 1. The module shares the same ``major.minor`` version with the CUDA Toolkit. The patch version (the third number in the version string), however, is reserved to reflect Python-only changes and is out of sync with the Toolkit patch version. diff --git a/cuda_python/docs/source/release/11.8.6-notes.md b/cuda_python/docs/source/release/11.8.6-notes.md new file mode 100644 index 000000000..4f20c77b6 --- /dev/null +++ b/cuda_python/docs/source/release/11.8.6-notes.md @@ -0,0 +1,14 @@ +# CUDA Python 11.8.6 Release notes + +Released on January 24, 2025. + +## Included components + +- [`cuda.bindings` 11.8.6](https://nvidia.github.io/cuda-python/cuda-bindings/11.8.6/release/11.8.6-notes.html) + + +## Highlights + +- Add optional dependencies on the CUDA NVRTC wheel +- Enable discovery and loading of shared libraries from CUDA wheels +- `cuda-python` is now a meta package, currently depending only on `cuda-bindings` ([see RFC](https://github.com/NVIDIA/cuda-python/issues/105)) diff --git a/cuda_python/docs/source/release/12.8.0-notes.md b/cuda_python/docs/source/release/12.8.0-notes.md index c4321238c..ca244dad3 100644 --- a/cuda_python/docs/source/release/12.8.0-notes.md +++ b/cuda_python/docs/source/release/12.8.0-notes.md @@ -4,7 +4,7 @@ Released on January 24, 2025. ## Included components -- [`cuda.bindings` 12.8.0](../cuda-bindings/12.8.0/release/12.8.0-notes.html) +- [`cuda.bindings` 12.8.0](https://nvidia.github.io/cuda-python/cuda-bindings/12.8.0/release/12.8.0-notes.html) ## Highlights From 8d9a68045a879137440314d458da6e0fe5051e8b Mon Sep 17 00:00:00 2001 From: Leo Fang Date: Fri, 24 Jan 2025 14:42:14 -0500 Subject: [PATCH 7/7] update toc --- cuda_python/docs/source/release.md | 1 + 1 file changed, 1 insertion(+) diff --git a/cuda_python/docs/source/release.md b/cuda_python/docs/source/release.md index c6c829c6e..9bd6b3a2b 100644 --- a/cuda_python/docs/source/release.md +++ b/cuda_python/docs/source/release.md @@ -8,4 +8,5 @@ maxdepth: 3 12.8.0 12.6.2 12.6.1 + 11.8.6 ```