Skip to content

Catch-up bindings - #3473

Open
mdboom wants to merge 2 commits into
NVIDIA:mainfrom
mdboom:catchup-bindings
Open

mdboom wants to merge 2 commits into
NVIDIA:mainfrom
mdboom:catchup-bindings

Conversation

@mdboom

@mdboom mdboom commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

Adds generator fixes !617 and !606.

@mdboom mdboom self-assigned this Nov 16, 2026
@github-actions github-actions Bot added the cuda.bindings Everything related to the cuda.bindings module label Nov 16, 2026
@mdboom mdboom added the enhancement Any code-related improvements label Nov 16, 2026
@mdboom mdboom added this to the cuda.bindings next milestone Nov 16, 2026
@coderabbitai

coderabbitai Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • New Features
    • Array properties now accept integer handles as well as CUDA array objects.
  • Bug Fixes
    • Improved reliability when preparing CUDA structure metadata. Allocation failures are reported clearly, and temporary storage is released safely.
  • Improvements
    • Existing metadata layouts and array length validation behavior remain unchanged.

CUDA 12 and CUDA 13 bindings update struct dtype-offset calculations to use zeroed heap allocations with allocation-failure handling and cleanup. Selected setter annotations now accept integers. The changes also update imports, generated-file hashes, and documentation.

Changes: CUDA binding updates

Layer / File(s) Summary
CUDA 12 dtype offset helpers
cuda_bindings_12/cuda/bindings/cufile.pyx, cuda_bindings_12/cuda/bindings/nvml.pyx
The CuFile and NVML dtype helpers calculate offsets from allocated zeroed structs. They raise MemoryError if allocation fails and release temporary storage after dtype construction. NVML docstrings are also reflowed.
CUDA 13 dtype offset helpers
cuda_bindings_13/cuda/bindings/_v2/driver.pyx, cuda_bindings_13/cuda/bindings/_v2/nvrtc.pyx, cuda_bindings_13/cuda/bindings/cudla.pyx, cuda_bindings_13/cuda/bindings/cufile.pyx, cuda_bindings_13/cuda/bindings/nvml.pyx
The dtype helpers use the same allocation, failure-handling, and cleanup pattern. Their dtype layouts remain unchanged.
Annotations, imports, and documentation
cuda_bindings_12/cuda/bindings/driver.pyx, cuda_bindings_12/cuda/bindings/runtime.pyx, cuda_bindings_12/cuda/bindings/nvvm.pyx, cuda_bindings_12/cuda/bindings/nvml.pyx, cuda_bindings_13/cuda/bindings/_internal/_fast_enum.py, cuda_bindings_13/cuda/bindings/driver.pyx, cuda_bindings_13/cuda/bindings/nvml.pyx, cuda_bindings_13/cuda/bindings/nvvm.pyx, cuda_bindings_13/cuda/bindings/runtime.pyx
Selected array setters accept integer values in their annotations. _fast_enum.py imports Iterator from collections.abc. Docstrings are reflowed. Generated-file hashes are updated.

Suggested reviewers: rwgk

Change: Bug fix

Merge Risk: Minimal · up to 91e8d

This catch-up regenerates the CUDA 12 and 13 bindings. It makes dtype offset calculation use checked heap allocations, widens a few type hints, and reflows docs. No behavior-affecting problems were identified, so merge risk is minimal.

Architecture risk: Low · up to 91e8d

The change affects 2 systems.

Changed systems: cuda_bindings_13, cuda_bindings_12

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — cuda_bindings_13 (service) was modified; 9 changed files map to changed impact.
  • observed — cuda_bindings_12 (service) was modified; 5 changed files map to changed impact.

Before / after behavior

  • observed — Modified behavior in cuda_bindings_12/cuda/bindings/cufile.pyx: The generated-file content hash changed.
  • observed — Modified behavior in cuda_bindings_12/cuda/bindings/cufile.pyx: The _py_anon_pod1 dtype helper now obtains field offsets from a zeroed heap-allocated struct, raises MemoryError on allocation failure, and frees the temporary allocation in finally; previously it calculated offsets from a local struct.
  • observed — Modified behavior in cuda_bindings_12/cuda/bindings/cufile.pyx: The _py_anon_pod3 dtype helper now derives offsets from a zeroed heap-allocated struct, handles allocation failure with MemoryError, and frees the allocation in finally, replacing offsets based on a local struct.
  • observed — Modified behavior in cuda_bindings_12/cuda/bindings/cufile.pyx: The CUfileIOEvents_t dtype helper now allocates a zeroed struct to determine field offsets, raises MemoryError if allocation fails, and releases the allocation in finally instead of using a local struct.
- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 1112940 and 91e8ddf.

Files selected for processing: 4

  • cuda_bindings_12/cuda/bindings/nvml.pyx
  • cuda_bindings_13/cuda/bindings/_internal/_fast_enum.py
  • cuda_bindings_13/cuda/bindings/_v2/driver.pyx
  • cuda_bindings_13/cuda/bindings/nvml.pyx

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 11 remain after this review.

@rwgk
rwgk enabled auto-merge (squash) November 17, 2026 18:42
@github-actions

Copy link
Copy Markdown
Contributor

This branch has not been deployed

No deployments
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 enhancement Any code-related improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants