cuda-python / cuda_bindings
AGENTS.md3.4k starsChanged 4 months agoApache-2.0View on GitHub
This file describes cuda_bindings, the low-level CUDA host API bindings subpackage in the cuda-python monorepo. - Role: provide low-level, close-to-CUDA interfaces under cuda.bindings.* with broad API coverage. - Style: prioritize correctness and API compatibility over convenience wrappers. High-level ergonomics belong in cuda_core, not here. - Cross-platform: preserve Linux and Windows behavior unless a change is intentionally platform-specific. - Public module layer: Cython modules under cuda/bindings/ expose user APIs (driver, runtime, nvrtc, nvjitlink, nvvm, cufile, etc.). - Internal binding layer: cuda/bindings/_bindings/…
Trending
More talk lately.thin dataabout the whole repository
Who's talking about NVIDIA/cuda-python
- rapidsai/rmm“Replace use of custom CUDA bindings with CUDA-Python”GitHub · Dec 3, 2021 · 12 reactions
- jungwoo-ha/WeeklyArxivTalk“[20210815] Weekly AI ArXiv 만담”GitHub · Aug 14, 2021 · 12 reactions
- A Hacker News story“CUDA Python Low-Level Bindings”Hacker News · Aug 21, 2021 · 4 points
- pytorch/pytorch“RFC: The State of Custom CUDA extensions in PyTorch”GitHub · Apr 23, 2025 · 3 reactions
- apache/arrow“POC: [Python] try out stubgen-pyx for auto-generated typing stubs”GitHub · Oct 1, 2026 · 2 reactions
The biggest 5 of 12 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 12
Talked about on GitHub, Hacker News and Bluesky (12 times).
On GitHub · 10
- Dec 3, 2021Replace use of custom CUDA bindings with CUDA-Python — rapidsai/rmm12 reactions · 16 comments
- Aug 14, 2021[20210815] Weekly AI ArXiv 만담 — jungwoo-ha/WeeklyArxivTalk12 reactions · 3 comments
- Apr 23, 2025RFC: The State of Custom CUDA extensions in PyTorch — pytorch/pytorch3 reactions · 29 comments
- Oct 1, 2026POC: [Python] try out stubgen-pyx for auto-generated typing stubs — apache/arrow2 reactions · 4 comments
- Apr 11, 2026Allow getting `AtenTensorHandle` from the tensor object via AOTI stable C API — pytorch/pytorch2 reactions · 6 comments
5 more on GitHub
- Oct 5, 2026deps: bump the python-minor group with 8 updates — pcalnon/juniper-cascor1 reaction · 1 comment
- Jul 19, 2026chore(deps): bump cuda-bindings from 13.2.0 to 13.3.1 — grisuno/LazyOwn1 reaction · 1 comment
- Mar 2, 2026CuPy fails to auto-detect CUDA when CUDA_PATH is unset in containers (RawKernel / JIT compile) — cupy/cupy1 reaction · 1 comment
- Feb 10, 2026[FEA] Migrate RAPIDS to CCCL `cuda::stream_ref` / `cuda::stream` in C++ and `cuda.core` streams in Python — rapidsai/rmm1 reaction · 1 comment
- Sep 19, 2025RFC: Support CUDA Stream Protocol — rapidsai/rmm1 reaction · 6 comments
On Hacker News · 1
- Aug 21, 2021CUDA Python Low-Level Bindings4 points
On Bluesky · 1
- Apr 9, 2025📦 NVIDIA / cuda-python ⭐ 1,537 (+50) 🗒 Python CUDA Python: Performance meets Productivity — @github-trending.bsky.social2 likes and reposts
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.
Of the AGENTS.md files we read, the 11,773 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository13 other files it gives its agents.
- AGENTS.mdAGENTS.md
- benchmarks/cuda_bindings/AGENTS.mdAGENTS.md
- benchmarks/cuda_core/AGENTS.mdAGENTS.md
- cuda_core/AGENTS.mdAGENTS.md
- cuda_core/tests/AGENTS.mdAGENTS.md
- cuda_pathfinder/AGENTS.mdAGENTS.md
- cuda_python/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- cuda_bindings/CLAUDE.mdCLAUDE.md
- cuda_core/CLAUDE.mdCLAUDE.md
- cuda_pathfinder/CLAUDE.mdCLAUDE.md
- cuda_python/CLAUDE.mdCLAUDE.md
- create-cuda-python-pull-requestSkill
The file
We split this AGENTS.md into the rules it gives an agent
5 rules. About 0 are common, 2 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 33
Platform split files: keep _linux.pyx and _windows.pyx variants aligned when behavior should be equivalent.
- Very specific: line 43
Benchmarks: run with pytest --benchmark-only benchmarks/ when needed.
- Distinctive: line 65
Keep CUDA return/error semantics explicit and avoid broad fallback behavior.
- Very specific: line 68
If you add or change exported APIs, update relevant docs under docs/source/module/ and tests in tests/.
- Distinctive: line 70
Prefer changes that are easy to regenerate/rebuild rather than patching generated output directly.
≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
This file describes cuda_bindings, the low-level CUDA host API bindings
subpackage in the cuda-python monorepo.
Scope and principles
- Role: provide low-level, close-to-CUDA interfaces under
cuda.bindings.*with broad API coverage. - Style: prioritize correctness and API compatibility over convenience
wrappers. High-level ergonomics belong in
cuda_core, not here. - Cross-platform: preserve Linux and Windows behavior unless a change is intentionally platform-specific.
Package architecture
- Public module layer: Cython modules under
cuda/bindings/expose user APIs (driver,runtime,nvrtc,nvjitlink,nvvm,cufile, etc.). - Internal binding layer:
cuda/bindings/_bindings/provides lower-level glue and loader helpers used by public modules. - Platform internals:
cuda/bindings/_internal/contains platform-specific implementation files and support code. - Build backend:
build_hooks.pydrives extension configuration and Cythonization.
Generated-source workflow
- Do not hand-edit generated binding files: many files under
cuda/bindings/(including*.pyxand*.pxd) are generated artifacts. - Generated files are synchronized from another repository: changes to these files in this repo are expected to be overwritten by the next sync.
- If generated output must change: make the change at the generation source and sync the updated artifacts back here, rather than patching generated files directly in this repo.
- Platform split files: keep
_linux.pyxand_windows.pyxvariants aligned when behavior should be equivalent.
Testing expectations
- Primary tests:
pytest tests/ - Cython tests:
- build:
tests/cython/build_tests.sh(or platform equivalent) - run:
pytest tests/cython/
- build:
- Examples: example coverage is pytest-based under
examples/. - Benchmarks: run with
pytest --benchmark-only benchmarks/when needed.
The legacy_tests subdirectory tests the old pre-v2 APIs of driver, runtime
and nvrtc. These test files should not be added to, only updated when
necessary to fix test failures. The canonical set of tests are those outside of
the legacy_tests subdirectory.
Build and environment notes
CUDA_HOMEorCUDA_PATHmust point to a valid CUDA Toolkit for source builds.- The toolkit's
cuda.hmust have the same major.minor as the generated sources,CUDA_VERSIONincuda/bindings/cydriver.pxd.build_hooks.pychecks this before cythonize and fails with a message that names both versions. CUDA_PYTHON_PARALLEL_LEVELcontrols build parallelism.- Runtime behavior is affected by
CUDA_PYTHON_CUDA_PER_THREAD_DEFAULT_STREAMandCUDA_PYTHON_DISABLE_MAJOR_VERSION_WARNING.
Editing guidance
- Keep CUDA return/error semantics explicit and avoid broad fallback behavior.
- Reuse existing helper layers (
_bindings,_internal,_lib) before adding new one-off utilities. - If you add or change exported APIs, update relevant docs under
docs/source/module/and tests intests/. - Prefer changes that are easy to regenerate/rebuild rather than patching generated output directly.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

