-
Notifications
You must be signed in to change notification settings - Fork 0
Comparing changes
Open a pull request
base repository: leofang/cuda-python
base: master
head repository: NVIDIA/cuda-python
compare: main
- 18 commits
- 133 files changed
- 10 contributors
Commits on Jul 8, 2026
-
Configuration menu - View commit details
-
Copy full SHA for ed4e31e - Browse repository at this point
Copy the full SHA ed4e31eView commit details -
cuda.core.texture: API-style follow-up before v1.1.0 (NVIDIA#2292) (N…
…VIDIA#2307) * cuda.core.texture: rename from_array -> from_opaque_array, element_size -> element_bytes (NVIDIA#2292) Addresses items 5 and 7 of the pre-v1.1.0 texture API-style review. - ResourceDescriptor.from_array -> ResourceDescriptor.from_opaque_array: the Array -> OpaqueArray rename removed "array" ambiguity, so the factory name should follow suit. - OpaqueArray.element_size -> OpaqueArray.element_bytes: the accessor returns a byte count, matching the _bytes convention already used by size_bytes and pitch_bytes. Both are renames of APIs not yet released (first ship in v1.1.0), so no deprecation shim is needed; the new names carry a versionadded:: 1.1.0 note. Call sites in the texture tests and the four texture examples are updated. * cuda.core.texture: move texture enums to cuda.core.typing as StrEnum (NVIDIA#2292) Addresses item 4 of the pre-v1.1.0 texture API-style review. The texture/surface enums were IntEnum subclasses backed by cydriver.CU_* values, defined in the cuda.core.texture root namespace and lacking the Type suffix. Every other cuda.core enum unified pre-1.0 lives in cuda.core.typing as a StrEnum with semantic string values and a Type suffix. Bring the texture enums in line: - ArrayFormat -> cuda.core.typing.ArrayFormatType - AddressMode -> cuda.core.typing.AddressModeType - FilterMode -> cuda.core.typing.FilterModeType - ReadMode -> cuda.core.typing.ReadModeType Internally the driver integer values are still needed, so _array and _texture carry private CU<->StrEnum bridge maps; OpaqueArray/MipmappedArray keep storing the driver int and convert on the .format boundary. Per the enum convention, plain strings are accepted anywhere an enum is expected (via _normalize_enum / _normalize_array_format), and invalid values raise ValueError. TextureDescriptor gains a __post_init__ that normalizes its filter_mode/read_mode/ mipmap_filter_mode fields at construction. Enums are dropped from the cuda.core.texture __all__ and documented under cuda.core.typing. Tests, examples, and docs are updated to the new names; the negative-path tests that previously expected a TypeError at texture creation now expect a ValueError at descriptor construction. * cuda.core.texture: accept NumPy dtypes for array format (NVIDIA#2292) Addresses item 3 of the pre-v1.1.0 texture API-style review. TensorMapDescriptorOptions.data_type already accepts NumPy dtype objects and keeps its enum as a fallback. Apply the same precedent to the texture format argument: OpaqueArray / MipmappedArray creation and ResourceDescriptor.from_linear / from_pitch2d now accept an ArrayFormatType, a plain str, or a NumPy dtype object (anything numpy.dtype() accepts). Each ArrayFormatType value is already spelled as a NumPy dtype name, so the eight formats map 1:1 via a new _NUMPY_DTYPE_TO_ARRAYFORMAT table. All four factories funnel through _validate_format_channels -> _normalize_array_format, so dtype support is added in one place. ml_dtypes is intentionally not imported: every current format is a standard NumPy dtype, and the ml_dtypes path only becomes relevant if/when a bfloat16 format is added. * cuda.core.texture: rename TextureDescriptor -> TextureObjectOptions (NVIDIA#2292) Addresses the rename portion of item 2 of the pre-v1.1.0 texture API-style review. CUDA_TEXTURE_DESC is pure creation input (it cannot be queried back from a texture object), so "descriptor" borrowed the driver naming inappropriately. TextureObjectOptions matches the XxxOptions convention used throughout cuda.core (StreamOptions, EventOptions, TensorMapDescriptorOptions, ...). Pure rename of the dataclass and all references across the implementation, stubs, __init__ __all__, docs, tests, and examples. The from_descriptor texture_descriptor= keyword is left untouched here; the whole creation entry point is replaced by Device.create_texture_object(*, resource, options) in a later commit. * cuda.core.texture: add Device.create_opaque_array / create_mipmapped_array (NVIDIA#2292) Addresses item 1 (array allocation) and item 2 (Options dataclasses) of the pre-v1.1.0 texture API-style review. Every other user-allocatable resource in cuda.core is created via Device.create_* (create_stream, create_event, ...) with an XxxOptions dataclass. The texture arrays used per-type classmethod factories (OpaqueArray.from_descriptor, MipmappedArray.from_descriptor) with loose kwargs instead. Move them in line: - add OpaqueArrayOptions and MipmappedArrayOptions dataclasses (validated in __post_init__, mirroring TensorMapDescriptorOptions); - add Device.create_opaque_array(options) and Device.create_mipmapped_array( options), which gate on _check_context_initialized() and delegate to private module factories that bind to the current device (same pattern as create_event / create_graph_builder); - remove the OpaqueArray.from_descriptor / MipmappedArray.from_descriptor classmethods; the private _from_handle graphics-interop path is retained. New entry points carry versionadded:: 1.1.0. Options are exported from cuda.core.texture and documented in api.rst. Tests and the texture examples are updated to Device().create_*_array(<Options>(...)). * cuda.core.texture: add Device.create_texture_object / create_surface_object (NVIDIA#2292) Addresses item 1 (object creation) and item 6 (drop SurfaceObject.from_array sugar) of the pre-v1.1.0 texture API-style review, completing the move to the Device.create_* allocation shape. - add Device.create_texture_object(*, resource, options) and Device.create_surface_object(*, resource), gating on _check_context_initialized() and delegating to private module factories that bind to the current device (same pattern as create_opaque_array); - remove TextureObject.from_descriptor, SurfaceObject.from_descriptor, and the speculative SurfaceObject.from_array sugar (a surface is now built from an explicit ResourceDescriptor.from_opaque_array(...) like every other backing); - rename the sampling-options argument from texture_descriptor to options on the new entry point, matching the create_* + XxxOptions convention (the queryable TextureObject.texture_descriptor property is unchanged). New entry points carry versionadded:: 1.1.0. Tests, examples, and api.rst are updated; a make_surface() helper mirrors make_texture() in the fluid example. * cuda.core.texture: apply pre-commit (ruff, ruff-format, stubgen) (NVIDIA#2292) Mechanical pre-commit pass over the NVIDIA#2292 texture API series: - ruff: drop now-unused imports in the texture example/test files and remove an unused _normalize_array_format import from _texture.pyx (cython-lint); - ruff-format: reflow the rewritten call sites in the tests and examples; - stubgen-pyx: regenerate the .pyi stubs from the updated .pyx sources. * cuda.core.texture: address API-review follow-ups (NVIDIA#2292) Apply the review findings from the texture API-style follow-up: - Rename TextureObject.texture_descriptor -> options (and the internal _texture_desc slot -> _options) to drop the borrowed "descriptor" naming, matching the TextureObjectOptions rename. - Make options a required argument on create_opaque_array / create_mipmapped_array (shape/format/num_channels have no defaults), so omitting it raises a clear error instead of a raw dataclass TypeError. create_texture_object keeps options=None (all-default sampling state). - Add return and resource/options type annotations to the four Device.create_* texture factories via a TYPE_CHECKING texture import (mirroring the existing GraphBuilder pattern). - Clarify in the create_* docstrings that the resource is created in the current CUDA context (call set_current first), mirroring create_stream / create_event. - Add versionadded:: 1.1.0 to OpaqueArrayOptions, MipmappedArrayOptions, TextureObjectOptions, and the new options property. - Fix a stale negative-path test whose regex no longer matched the shared check_or_create_options message; rename stale from_descriptor test names to create_*; realign the gl_interop_fluid API-MAP comment table after the enum renames. - Regenerate .pyi stubs. * cuda.core.texture: fix stale address_mode entry-rejection test (NVIDIA#2292) The StrEnum migration (item 4 of NVIDIA#2292) makes a plain str acceptable anywhere an AddressModeType is expected. A bad tuple entry like "bad" is therefore a valid *type* but an invalid *value*, so _normalize_enum rejects it with a ValueError (naming the offending position address_mode[1]), not a TypeError. Update the test to assert ValueError and rename it to test_address_mode_rejects_invalid_entry. This is the second of the two CI failures on PR NVIDIA#2307; the first (the stale options-type message) was fixed in the previous commit. * cuda.core.texture: register new StrEnums in enum-coverage test (NVIDIA#2292) test_enum_coverage.py::test_all_str_enums_in_cases requires every StrEnum in cuda.core to be declared either in _CASES (bound to a cuda_binding enum) or in _UNBOUND_STR_ENUMS. The four texture enums moved into cuda.core.typing (item 4 of NVIDIA#2292) were not registered, failing that guard. - AddressModeType / FilterModeType are 1:1 wrappers of CUaddress_mode / CUfilter_mode, so add mapping=None _CASES entries (count-check only; the texture mapping dicts store cydriver-derived ints, not driver.<Enum> members, so the isinstance-based mapping check does not apply). - ArrayFormatType exposes only the 8 NumPy-representable formats out of CUarray_format's ~67 members, so it is a curated subset rather than a 1:1 wrapper -> _UNBOUND_STR_ENUMS. - ReadModeType maps to the CU_TRSF_READ_AS_INTEGER flag bit, not a CUenum -> _UNBOUND_STR_ENUMS. This is the third local test failure; the other two (stale texture negative-path tests) were fixed in the two preceding commits. * cuda.core.texture: add versionadded markers and widen enum str annotations Address review feedback (Ralf): - Add ``.. versionadded:: 1.1.0`` to the four new texture enums in typing.py (ArrayFormatType, AddressModeType, FilterModeType, ReadModeType) and to the texture classes that lacked a class-level marker (ResourceDescriptor, TextureObject, OpaqueArray, MipmappedArray, SurfaceObject). Remove the redundant method-level markers now covered at class level. - Widen the enum-bearing TextureObjectOptions field annotations to include ``str`` (address_mode, filter_mode, read_mode, mipmap_filter_mode), matching the runtime string coercion this PR adds and existing convention elsewhere in cuda.core. Note "Plain strings are accepted" on the affected fields. - Regenerate .pyi stubs.
Configuration menu - View commit details
-
Copy full SHA for 8b20f77 - Browse repository at this point
Copy the full SHA 8b20f77View commit details -
ci: switch to step-security/msvc-dev-cmd fork (Node.js 24) (NVIDIA#2325)
The upstream ilammy/msvc-dev-cmd is unmaintained and still runs on Node.js 20, which GitHub Actions is deprecating (removal on September 16th, 2026). step-security/msvc-dev-cmd@v1.13.1 is a maintained fork upgraded to Node.js 24. coverage.yml also gains SHA pinning; it was previously tag-pinned to @v1.
Configuration menu - View commit details
-
Copy full SHA for a901bba - Browse repository at this point
Copy the full SHA a901bbaView commit details -
Configuration menu - View commit details
-
Copy full SHA for c2ef4ad - Browse repository at this point
Copy the full SHA c2ef4adView commit details -
Fix cuda.core API currentmodule for toolchain docs (NVIDIA#2319)
Co-authored-by: Michael Wang <isVoid@users.noreply.github.com>
Configuration menu - View commit details
-
Copy full SHA for 95907d9 - Browse repository at this point
Copy the full SHA 95907d9View commit details -
[doc-only] docs(core): finalize 1.1.0 release notes (NVIDIA#2315)
* docs(core): finalize 1.1.0 release notes Add a Highlights section, backfill PR/issue links on New features entries, and add Bug fixes entries for the v1.1.0 IPC import hardening (NVIDIA#2219, NVIDIA#2223, NVIDIA#2224), the ManagedBuffer.accessed_by torn-state fix (NVIDIA#2222), and graph node attachment lifetimes (NVIDIA#2280). Highlights (per review): the .pyi type-stub support and the new cuda.core.texture module; NVLink enumeration is covered in New features / Bug fixes rather than as a highlight. Also adds a New features entry for the cuda.core.texture module (NVIDIA#467, NVIDIA#2095, NVIDIA#2307). * Reorder API refs + ensure each section has currentmodule the compilation toolchain is one of the unique selling points of cuda.core, but we are burying it deeply --------- Co-authored-by: Leo Fang <leof@nvidia.com>
Configuration menu - View commit details
-
Copy full SHA for 8eb9dc2 - Browse repository at this point
Copy the full SHA 8eb9dc2View commit details -
[doc-only] cuda_core: add "10 minutes to cuda.core" tutorial to docs (N…
…VIDIA#2289) * cuda_core: add "10 minutes to cuda.core" tutorial to docs Add a beginner-friendly "10 minutes to cuda.core" guide that walks through the core workflow (select a device, compile a kernel, allocate memory, copy, launch, time with events, use multiple streams, capture a CUDA graph, and interoperate with CuPy/PyTorch), then wire it into the cuda.core docs table of contents between the installation and examples sections. Signed-off-by: Sri Koundinyan <skoundinyan@nvidia.com> * cuda_core: address review feedback on 10 minutes to cuda.core Mainly: fix the Device()/thread-local wording for accuracy, simplify the PyTorch stream example (torch supports __cuda_stream__ natively), stop teaching Buffer as a context manager, and tidy up the CUDA graph section. Signed-off-by: Sri Koundinyan <skoundinyan@nvidia.com> --------- Signed-off-by: Sri Koundinyan <skoundinyan@nvidia.com>
Configuration menu - View commit details
-
Copy full SHA for b1c474c - Browse repository at this point
Copy the full SHA b1c474cView commit details -
Add content seals and validation for generated CUDA Bindings files (N…
…VIDIA#2310) * Relicense CUDA Bindings and CUDA Python Signed-off-by: Keith Kraus <keith.j.kraus@gmail.com> * Address relicensing review feedback Signed-off-by: Keith Kraus <keith.j.kraus@gmail.com> * Address copyright and lockfile review feedback Signed-off-by: Keith Kraus <keith.j.kraus@gmail.com> * run_cybind_cython_gen 13.3.0 ../cuda-python * run_cybind_native 13.3.0 ../cuda-python * run_cybind_native 13.3.0 ../cuda-python * run_cybind_cython_gen 13.3.0 ../cuda-python * run_cybind_native 13.3.0 ../cuda-python * Check cybind-generated file seals in pre-commit * Revert "run_cybind_native 13.3.0 ../cuda-python" This reverts commit 0338189. * Revert "run_cybind_cython_gen 13.3.0 ../cuda-python" This reverts commit b8f6a85. * run_cybind_cython_gen 13.3.0 ../cuda-python * run_cybind_native 13.3.0 ../cuda-python * Revert "run_cybind_native 13.3.0 ../cuda-python" This reverts commit 94e42e8. * Revert "run_cybind_cython_gen 13.3.0 ../cuda-python" This reverts commit cc82446. * run_cybind_cython_gen 13.3.0 ../cuda-python * run_cybind_native 13.3.0 ../cuda-python * Use resolved nvcc path for RDC library fixtures * Generalize generated-file seal validation * Address generated-file seal review feedback * Exclude seal checker from generated-file grep * run_cybind_cython_gen 13.3.0 ../cuda-python && run_cybind_native 13.3.0 ../cuda-python Before running cybind: rm $(git grep -l -F CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE) --------- Signed-off-by: Keith Kraus <keith.j.kraus@gmail.com> Co-authored-by: Keith Kraus <keith.j.kraus@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for dcff8e6 - Browse repository at this point
Copy the full SHA dcff8e6View commit details -
Configuration menu - View commit details
-
Copy full SHA for 52e6edd - Browse repository at this point
Copy the full SHA 52e6eddView commit details -
Configuration menu - View commit details
-
Copy full SHA for daf4a3c - Browse repository at this point
Copy the full SHA daf4a3cView commit details
Commits on Jul 9, 2026
-
cuda.core: expose wqConcurrencyLimit on WorkqueueResource (NVIDIA#2329)
* cuda.core: expose wqConcurrencyLimit on WorkqueueResource Add concurrency_limit to WorkqueueResourceOptions so callers can hint the expected maximum stream-ordered concurrency to the driver, and add a read-only WorkqueueResource.concurrency_limit property mirroring the driver-populated value. Also fix the sharing_scope-only early return in configure() so setting concurrency_limit alone isn't silently dropped. * cuda.core: move WorkqueueResourceOptions validation to __post_init__ Fail-fast at construction rather than deferring both `sharing_scope` and `concurrency_limit` validation to `configure()`. This surfaces bad options immediately (and on any build, not just CUDA 13.x) and keeps the invariant colocated with the field it protects. Also add a 1.1.0 release-notes entry for the new field/property. * cuda.core: trim 1.1.0 release notes entry for concurrency_limit * cuda.core tests: configure workqueue in test_with_workqueue_resource Exercise sharing_scope + concurrency_limit end-to-end through green ctx creation and kernel launch, not just the property round-trip. * cuda.core: apply ruff-format + regenerate .pyi stubs * cuda.core: drop WorkqueueResource.concurrency_limit property Keep the surface symmetric with sharing_scope: configure() is the only way to set concurrency_limit, and there is no query-side property. The end-to-end verification lives in test_with_workqueue_resource, which now exercises a configured workqueue through green ctx creation and a kernel launch.
Configuration menu - View commit details
-
Copy full SHA for c08caa8 - Browse repository at this point
Copy the full SHA c08caa8View commit details -
Configuration menu - View commit details
-
Copy full SHA for e1f5d97 - Browse repository at this point
Copy the full SHA e1f5d97View commit details -
cuda.core: expose driver-populated fields on WorkqueueResource (NVIDI…
…A#2330) * cuda.core: expose driver-populated fields on WorkqueueResource Add read-only sharing_scope, concurrency_limit, and device properties on WorkqueueResource so users can inspect the driver-populated config without dropping to raw cydriver. Add WorkqueueSharingScopeType StrEnum in cuda.core.typing to give the sharing scope a typed return; strings matching the enum member values remain accepted for backward compat. Follows section 5(d) "opaque but round-trippable" from the green ctx design doc, which was written into SMResource but not applied to WorkqueueResource. * cuda.core: fill in PR number in release-notes entry * cuda.core: drop TYPE_CHECKING Device import to satisfy cython-lint The lazy import inside WorkqueueResource.device already imports Device at call time; the top-level TYPE_CHECKING import was unused as far as cython-lint could see and blocked pre-commit. * cuda.core: fold NVIDIA#2329 + NVIDIA#2330 release notes; parametrize enum test; add 2-GPU device check - Merge the two 1.1.0 workqueue entries into one bullet crediting both PRs. - Parametrize test_configure_scope_with_enum over both WorkqueueSharingScopeType members. - Add test_device_id_matches_source_multi_gpu verifying WorkqueueResource.device.device_id tracks the source device when the caller switches devices. Uses the established system.get_num_devices() < 2 skip pattern. * cuda.core tests: drop init_cuda from multi-GPU workqueue test * cuda.core tests: drop unnecessary set_current calls in multi-GPU workqueue test cuDeviceGetDevResource doesn't require the device to be current; verified locally that cuCtxGetCurrent returns the same context before and after the test body. * cuda.core tests: extract shared _RESOURCE_UNAVAILABLE_ERRORS tuple with rationale * cuda.core: restore Device TYPE_CHECKING import with noqa mypy needs Device resolvable in the generated .pyi (WorkqueueResource.device returns 'Device' as a string forward reference); noqa: F401 keeps cython-lint from re-flagging it as unused. * cuda.core: simplify noqa to bare form (cython-lint didn't parse the parenthetical) * cuda.core: use bare Device annotation on WorkqueueResource.device cython-lint doesn't count string-quoted forward references as usage of the TYPE_CHECKING import. The bare form works because from __future__ import annotations makes it a string at runtime anyway (matches _stream.pyx pattern). * cuda.core tests: register WorkqueueSharingScopeType in _CASES test_all_str_enums_in_cases enforces that every StrEnum in cuda.core.typing is bound to a driver-side counterpart or explicitly marked unbound. WorkqueueSharingScopeType wraps CUdevWorkqueueConfigScope 1:1 — clean binding-coverage entry. * cuda.core tests: gate WorkqueueSharingScopeType binding entry on CUDA 13+ CUdevWorkqueueConfigScope doesn't exist in CUDA 12.x cuda_bindings, so importing test_enum_coverage crashed with AttributeError. Only register the binding-coverage entry when the driver exposes the enum; otherwise mark the wrapper as unbound so test_all_str_enums_in_cases still passes. Verified both paths locally (real CUDA 13 + delattr-simulated CUDA 12). * cuda.core tests: sharpen CUDA-version boundary in WorkqueueSharingScopeType comment CUdevWorkqueueConfigScope landed in the driver in 13.1, not 13.0. Update the inline comment on the hasattr gate to reflect that the missing-driver-enum path covers cuda-bindings for both CUDA 12.x and CUDA 13.0.x. * cuda.core: apply Mike's suggestion for WorkqueueResourceOptions.sharing_scope docstring * fix typing Co-authored-by: Michael Droettboom <mdboom@gmail.com> * Update _device_resources.pyi * cuda.core: regenerate .pyi to match stubgen-pyx output end-of-file-fixer excludes .pyi (per .pre-commit-config.yaml), so the trailing newline manually added in the previous commit made stubgen-pyx flag the file every run. Reverting to the newline-less form stubgen emits. * Apply suggestions from code review Co-authored-by: Michael Droettboom <mdboom@gmail.com> --------- Co-authored-by: Michael Droettboom <mdboom@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 52043f9 - Browse repository at this point
Copy the full SHA 52043f9View commit details -
Fix tag CI by installing cuda-python metapackage with --no-deps (NVID…
…IA#2334) During cuda-core tag releases, pip install cuda_python*.whl re-resolves cuda-core~=1.0.0 from PyPI and fails or downgrades the artifact wheel. Subpackages are already installed from CI artifacts, so skip dependency resolution in docs build and wheel test installability checks.
Configuration menu - View commit details
-
Copy full SHA for c23833b - Browse repository at this point
Copy the full SHA c23833bView commit details -
Check nvJitLink driver major compatibility (NVIDIA#2320)
* Check nvJitLink driver major compatibility * Narrow nvJitLink driver compatibility fallback * Fix cuLink state storage lifetimes * Isolate nvJitLink-specific cache tests * Use public linker backend query in tests * Use direct backend skips in program cache tests --------- Co-authored-by: Michael Wang <isVoid@users.noreply.github.com>
Configuration menu - View commit details
-
Copy full SHA for e83d434 - Browse repository at this point
Copy the full SHA e83d434View commit details
Commits on Jul 10, 2026
-
Include cuda.core C++ headers in packages (NVIDIA#2236)
Co-authored-by: Michael Droettboom <mdboom@gmail.com> Co-authored-by: Leo Fang <leof@nvidia.com>
Configuration menu - View commit details
-
Copy full SHA for 1af2e22 - Browse repository at this point
Copy the full SHA 1af2e22View commit details -
Build cuda.core RDC test fixtures without Bash (NVIDIA#2335)
* Run nvcc fixture build without Bash * Document narrow nvcc skip detection * Document nvcc test environment requirements
Configuration menu - View commit details
-
Copy full SHA for 30d9c60 - Browse repository at this point
Copy the full SHA 30d9c60View commit details
Commits on Jul 11, 2026
-
[chore] Remove unecessary imports and declarations from some pxd files (
NVIDIA#2338) * [chore] Remove unecessary imports and declarations from some pxd files * Fix deprecated array syntax
Configuration menu - View commit details
-
Copy full SHA for 060578a - Browse repository at this point
Copy the full SHA 060578aView commit details
This comparison is taking too long to generate.
Unfortunately it looks like we can’t render this comparison for you right now. It might be too big, or there might be something weird with your repository.
You can try running this command locally to see the comparison on your machine:
git diff master...main