Skip to content

Commit 1268d11

Browse files
committed
Merge remote-tracking branch 'origin/main' into refactor-mempool-hierarchy
2 parents fd5728a + 730a3e2 commit 1268d11

File tree

70 files changed

+2792
-1569
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+2792
-1569
lines changed

.github/actions/fetch_ctk/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ inputs:
1414
cuda-components:
1515
description: "A list of the CTK components to install as a comma-separated list. e.g. 'cuda_nvcc,cuda_nvrtc,cuda_cudart'"
1616
required: false
17-
default: "cuda_nvcc,cuda_cudart,cuda_crt,libnvvm,cuda_nvrtc,cuda_profiler_api,cuda_cccl,libnvjitlink,libcufile,libnvfatbin"
17+
default: "cuda_nvcc,cuda_cudart,cuda_crt,libnvvm,cuda_nvrtc,cuda_profiler_api,cuda_cccl,cuda_cupti,libnvjitlink,libcufile,libnvfatbin"
1818
cuda-path:
1919
description: "where the CTK components will be installed to, relative to $PWD"
2020
required: false

.github/workflows/bandit.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,6 @@ jobs:
4242
with:
4343
args: "check --select S --ignore ${{ steps.ignore-codes.outputs.codes }} --output-format sarif --output-file results.sarif"
4444
- name: Upload SARIF file
45-
uses: github/codeql-action/upload-sarif@v4.32.4
45+
uses: github/codeql-action/upload-sarif@v4.32.5
4646
with:
4747
sarif_file: results.sarif

.github/workflows/build-wheel.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ jobs:
369369
370370
OLD_BRANCH=$(yq '.backport_branch' ci/versions.yml)
371371
OLD_BASENAME="cuda-bindings-python${PYTHON_VERSION_FORMATTED}-cuda*-${{ inputs.host-platform }}*"
372-
LATEST_PRIOR_RUN_ID=$(gh run list -b ${OLD_BRANCH} -L 1 -w "ci.yml" -s completed -R NVIDIA/cuda-python --json databaseId | jq '.[]| .databaseId')
372+
LATEST_PRIOR_RUN_ID=$(gh run list -b ${OLD_BRANCH} -L 1 -w "ci.yml" -s success -R NVIDIA/cuda-python --json databaseId | jq '.[]| .databaseId')
373373
if [[ "$LATEST_PRIOR_RUN_ID" == "" ]]; then
374374
echo "LATEST_PRIOR_RUN_ID not found!"
375375
exit 1

.github/workflows/codeql.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@ jobs:
3131
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
3232

3333
- name: Initialize CodeQL
34-
uses: github/codeql-action/init@0ec47d036c68ae0cf94c629009b1029407111281 # v3.31.8
34+
uses: github/codeql-action/init@40f0fa95c41fede7b43f035cb47aac899ee0ba0a # v3.31.8
3535
with:
3636
languages: ${{ matrix.language }}
3737
build-mode: ${{ matrix.build-mode }}
3838
queries: security-extended
3939

4040
- name: Perform CodeQL Analysis
41-
uses: github/codeql-action/analyze@0ec47d036c68ae0cf94c629009b1029407111281 # v3.31.8
41+
uses: github/codeql-action/analyze@40f0fa95c41fede7b43f035cb47aac899ee0ba0a # v3.31.8
4242
with:
4343
category: "/language:${{matrix.language}}"

.github/workflows/coverage.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,8 @@ jobs:
9898
9999
- name: Build cuda-pathfinder
100100
run: |
101-
.venv/bin/pip install -v ./cuda_pathfinder --group test
101+
cd cuda_pathfinder
102+
../.venv/bin/pip install -v . --group test
102103
103104
- name: Build cuda-bindings
104105
run: |

.github/workflows/test-wheel-linux.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ jobs:
151151
152152
OLD_BRANCH=${{ needs.compute-matrix.outputs.OLD_BRANCH }}
153153
OLD_BASENAME="cuda-bindings-python${PYTHON_VERSION_FORMATTED}-cuda*-${{ inputs.host-platform }}*"
154-
LATEST_PRIOR_RUN_ID=$(gh run list -b ${OLD_BRANCH} -L 1 -w "ci.yml" -s completed -R NVIDIA/cuda-python --json databaseId | jq '.[]| .databaseId')
154+
LATEST_PRIOR_RUN_ID=$(gh run list -b ${OLD_BRANCH} -L 1 -w "ci.yml" -s success -R NVIDIA/cuda-python --json databaseId | jq '.[]| .databaseId')
155155
if [[ "$LATEST_PRIOR_RUN_ID" == "" ]]; then
156156
echo "LATEST_PRIOR_RUN_ID not found!"
157157
exit 1

.github/workflows/test-wheel-windows.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ jobs:
137137
run: |
138138
$OLD_BRANCH = yq '.backport_branch' ci/versions.yml
139139
$OLD_BASENAME = "cuda-bindings-python${env:PYTHON_VERSION_FORMATTED}-cuda*-${{ inputs.host-platform }}*"
140-
$runData = gh run list -b $OLD_BRANCH -L 1 -w "ci.yml" -s completed -R NVIDIA/cuda-python --json databaseId | ConvertFrom-Json
140+
$runData = gh run list -b $OLD_BRANCH -L 1 -w "ci.yml" -s success -R NVIDIA/cuda-python --json databaseId | ConvertFrom-Json
141141
if (-not $runData -or $runData.Length -eq 0 -or -not $runData[0].databaseId -or [string]::IsNullOrEmpty($runData[0].databaseId)) {
142142
Write-Host "LATEST_PRIOR_RUN_ID not found!"
143143
exit 1

AGENTS.md

Lines changed: 263 additions & 77 deletions
Large diffs are not rendered by default.

CLAUDE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
AGENTS.md

cuda_bindings/AGENTS.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
This file describes `cuda_bindings`, the low-level CUDA host API bindings
2+
subpackage in the `cuda-python` monorepo.
3+
4+
## Scope and principles
5+
6+
- **Role**: provide low-level, close-to-CUDA interfaces under
7+
`cuda.bindings.*` with broad API coverage.
8+
- **Style**: prioritize correctness and API compatibility over convenience
9+
wrappers. High-level ergonomics belong in `cuda_core`, not here.
10+
- **Cross-platform**: preserve Linux and Windows behavior unless a change is
11+
intentionally platform-specific.
12+
13+
## Package architecture
14+
15+
- **Public module layer**: Cython modules under `cuda/bindings/` expose user
16+
APIs (`driver`, `runtime`, `nvrtc`, `nvjitlink`, `nvvm`, `cufile`, etc.).
17+
- **Internal binding layer**: `cuda/bindings/_bindings/` provides lower-level
18+
glue and loader helpers used by public modules.
19+
- **Platform internals**: `cuda/bindings/_internal/` contains
20+
platform-specific implementation files and support code.
21+
- **Build/codegen backend**: `build_hooks.py` drives header parsing, template
22+
expansion, extension configuration, and Cythonization.
23+
24+
## Generated-source workflow
25+
26+
- **Do not hand-edit generated binding files**: many files under
27+
`cuda/bindings/` (including `*.pyx`, `*.pxd`, `*.pyx.in`, and `*.pxd.in`)
28+
are generated artifacts.
29+
- **Generated files are synchronized from another repository**: changes to these
30+
files in this repo are expected to be overwritten by the next sync.
31+
- **If generated output must change**: make the change at the generation source
32+
and sync the updated artifacts back here, rather than patching generated files
33+
directly in this repo.
34+
- **Header-driven generation**: parser behavior and required CUDA headers are
35+
defined in `build_hooks.py`; update those rules when introducing new symbols.
36+
- **Platform split files**: keep `_linux.pyx` and `_windows.pyx` variants
37+
aligned when behavior should be equivalent.
38+
39+
## Testing expectations
40+
41+
- **Primary tests**: `pytest tests/`
42+
- **Cython tests**:
43+
- build: `tests/cython/build_tests.sh` (or platform equivalent)
44+
- run: `pytest tests/cython/`
45+
- **Examples**: example coverage is pytest-based under `examples/`.
46+
- **Benchmarks**: run with `pytest --benchmark-only benchmarks/` when needed.
47+
- **Orchestrated run**: from repo root, `scripts/run_tests.sh bindings`.
48+
49+
## Build and environment notes
50+
51+
- `CUDA_HOME` or `CUDA_PATH` must point to a valid CUDA Toolkit for source
52+
builds that parse headers.
53+
- `CUDA_PYTHON_PARALLEL_LEVEL` controls build parallelism.
54+
- `CUDA_PYTHON_PARSER_CACHING` controls parser-cache behavior during generation.
55+
- Runtime behavior is affected by
56+
`CUDA_PYTHON_CUDA_PER_THREAD_DEFAULT_STREAM` and
57+
`CUDA_PYTHON_DISABLE_MAJOR_VERSION_WARNING`.
58+
59+
## Editing guidance
60+
61+
- Keep CUDA return/error semantics explicit and avoid broad fallback behavior.
62+
- Reuse existing helper layers (`_bindings`, `_internal`, `_lib`) before adding
63+
new one-off utilities.
64+
- If you add or change exported APIs, update relevant docs under
65+
`docs/source/module/` and tests in `tests/`.
66+
- Prefer changes that are easy to regenerate/rebuild rather than patching
67+
generated output directly.

0 commit comments

Comments
 (0)