-
Notifications
You must be signed in to change notification settings - Fork 171
Update out-of-date (sub)package REAME files and overhaul bindings Cython test instructions #252
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
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
f919baa
Update cython test structure
vzhurba01 c6cac85
Add .bat script for Windows
vzhurba01 9f707e1
Remove side-effect on running cmd
vzhurba01 9b423f7
Tentative README overhaul
vzhurba01 4602778
Update README
vzhurba01 cf8e7b4
Formatting
vzhurba01 fde425a
Spelling
vzhurba01 800aa26
Consistency
vzhurba01 a7bd725
Capitalization
vzhurba01 0fbb9e8
Capitalize
vzhurba01 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,76 +1,39 @@ | ||
# CUDA-Python | ||
|
||
CUDA Python is a standard set of low-level interfaces, providing full coverage of and access to the CUDA host APIs from Python. Checkout the [Overview](https://nvidia.github.io/cuda-python/overview.html) for the workflow and performance results. | ||
CUDA Python is the home for accessing NVIDIA’s CUDA platform from Python. It consists of multiple components: | ||
|
||
## Installing | ||
* [cuda.core](https://nvidia.github.io/cuda-python/cuda-core/latest): Pythonic access to CUDA Runtime and other core functionalities | ||
* [cuda.bindings](https://nvidia.github.io/cuda-python/cuda-bindings/latest): Low-level Python bindings to CUDA C APIs | ||
* [cuda.cooperative](https://nvidia.github.io/cccl/cuda_cooperative/): Pythonic exposure of CUB cooperative algorithms | ||
* [cuda.parallel](https://nvidia.github.io/cccl/cuda_parallel/): Pythonic exposure of Thrust parallel algorithms | ||
|
||
CUDA Python can be installed from: | ||
For access to NVIDIA Math Libraries, please refer to [nvmath-python](https://docs.nvidia.com/cuda/nvmath-python/latest). | ||
|
||
* PYPI | ||
* Conda (nvidia channel) | ||
* Source builds | ||
CUDA Python is currently undergoing an overhaul to improve existing and bring up new components. All of the previously available functionalities from the cuda-python package will continue to be available, please refer to the [cuda.bindings](https://nvidia.github.io/cuda-python/cuda-bindings/latest) documentation for installation guide and further detail. | ||
|
||
There're differences in each of these options that are described further in [Installation](https://nvidia.github.io/cuda-python/install.html) documentation. Each package will guarantee minor version compatibility. | ||
## CUDA-Python as a metapackage | ||
|
||
## Runtime Dependencies | ||
CUDA-Python is structured to become a metapackage that contains a collection of subpackages. Each subpackage is versioned independently, allowing installation of each component as needed. | ||
|
||
CUDA Python is supported on all platforms that CUDA is supported. Specific dependencies are as follows: | ||
### Subpackage: `cuda.core` | ||
|
||
* Driver: Linux (450.80.02 or later) Windows (456.38 or later) | ||
* CUDA Toolkit 12.0 to 12.6 | ||
The `cuda.core` package offers idiomatic, pythonic access to CUDA Runtime and other functionalities. | ||
|
||
Only the NVRTC redistributable component is required from the CUDA Toolkit. [CUDA Toolkit Documentation](https://docs.nvidia.com/cuda/index.html) Installation Guides can be used for guidance. Note that the NVRTC component in the Toolkit can be obtained via PYPI, Conda or Local Installer. | ||
The goals are to | ||
|
||
### Supported Python Versions | ||
1. Provide **idiomatic (“pythonic”)** access to CUDA Driver/Runtime | ||
2. Focus on **developer productivity** by ensuring end-to-end CUDA development can be performed quickly and entirely in Python | ||
3. **Avoid homegrown** Python abstractions for CUDA for new Python GPU libraries starting from scratch | ||
4. **Ease** developer **burden of maintaining** and catching up with latest CUDA features | ||
5. **Flatten the learning curve** for current and future generations of CUDA developers | ||
|
||
CUDA Python follows [NEP 29](https://numpy.org/neps/nep-0029-deprecation_policy.html) for supported Python version guarantee. | ||
### Subpackage: `cuda.bindings` | ||
|
||
Before dropping support, an issue will be raised to look for feedback. | ||
The `cuda.bindings` package is a standard set of low-level interfaces, providing full coverage of and access to the CUDA host APIs from Python. | ||
|
||
Source builds work for multiple Python versions, however pre-build PyPI and Conda packages are only provided for a subset: | ||
The list of available interfaces are: | ||
|
||
* Python 3.9 to 3.12 | ||
|
||
## Testing | ||
|
||
### Requirements | ||
|
||
Latest dependencies can be found in [requirements.txt](https://github.com/NVIDIA/cuda-python/blob/main/requirements.txt). | ||
|
||
### Unit-tests | ||
|
||
You can run the included tests with: | ||
|
||
``` | ||
python -m pytest tests/ | ||
``` | ||
|
||
### Benchmark | ||
|
||
You can run benchmark only tests with: | ||
|
||
``` | ||
python -m pytest --benchmark-only benchmarks/ | ||
``` | ||
|
||
### Samples | ||
|
||
You can run the included tests with: | ||
|
||
``` | ||
python -m pytest examples/ | ||
``` | ||
|
||
## Examples | ||
|
||
CUDA Samples rewriten using CUDA Python are found in `examples`. | ||
|
||
Custom extra included examples: | ||
|
||
- `examples/extra/jit_program_test.py`: Demonstrates the use of the API to compile and | ||
launch a kernel on the device. Includes device memory allocation / | ||
deallocation, transfers between host and device, creation and usage of | ||
streams, and context management. | ||
- `examples/extra/numba_emm_plugin.py`: Implements a Numba External Memory Management | ||
plugin, showing that this CUDA Python Driver API can coexist with other | ||
wrappers of the driver API. | ||
* CUDA Driver | ||
* CUDA Runtime | ||
* NVRTC | ||
* nvJitLink |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
cmd /V /C "set CL=%CL% /I%CUDA_HOME%\\include && cythonize -3 -i test_*.pyx" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/bash | ||
|
||
cd "$(dirname "$0")" | ||
CPLUS_INCLUDE_PATH=$CUDA_HOME/include:$CPLUS_INCLUDE_PATH cythonize -3 -i test_*.pyx |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[pytest] | ||
norecursedirs = cython |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.