Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
37849a3
Resolve a Cython build warning.
Andy-Jost Oct 28, 2025
ac8a69c
Make memory module into a package.
Andy-Jost Oct 28, 2025
123aa24
Rename cyStream to _cyStream for consistency.
Andy-Jost Oct 29, 2025
fe4b67e
Move defs to memory.pxd header
Andy-Jost Oct 29, 2025
ce77d44
Separate VMM.
Andy-Jost Oct 29, 2025
c5179bc
Weaken dependencies from device to memory module.
Andy-Jost Oct 29, 2025
e192748
Move LegacyPinnedMemoryResource to a submodule.
Andy-Jost Oct 29, 2025
729c900
Move _SynchronousMemoryResource into a submodule.
Andy-Jost Oct 29, 2025
8735455
Partly separates the IPC implementation.
Andy-Jost Oct 29, 2025
b2517f6
Move IPC registry to ipc module.
Andy-Jost Oct 30, 2025
a61317a
Collect and reorder DeviceMemoryResource properties.
Andy-Jost Oct 30, 2025
0e2d1d8
Move more IPC implementation out of DeviceMemoryResource.
Andy-Jost Oct 30, 2025
5387629
Minor refactoring.
Andy-Jost Oct 30, 2025
7fa38ca
Move Buffer IPC implementation.
Andy-Jost Oct 30, 2025
f357abd
Simplify the class hierarchy (remove _cyBuffer and _cyMemoryResource).
Andy-Jost Oct 30, 2025
89057f9
Refactor to shrink Cython interface.
Andy-Jost Oct 30, 2025
00b60eb
Simplify Buffer close.
Andy-Jost Oct 30, 2025
ecc9405
Refactor DeviceMemoryResource.__init__.
Andy-Jost Oct 30, 2025
228936b
Move Buffer into a separate module.
Andy-Jost Oct 31, 2025
9a86bde
Refactors DeviceMemoryResource IPC implementation.
Andy-Jost Oct 31, 2025
c7f6cde
Removes superfluous _uuid member of DeviceMemoryResource.
Andy-Jost Oct 31, 2025
216b4fb
Adds __all__ lists.
Andy-Jost Oct 31, 2025
6a30a39
Prepend underscore to submodules, add a test for package contents.
Andy-Jost Oct 31, 2025
229ddc6
Refactor IPC data of DMR into IPCData class.
Andy-Jost Oct 31, 2025
0fd3ca9
General clean up.
Andy-Jost Oct 31, 2025
076d7b4
Merge branch 'main' of github.com:NVIDIA/cuda-python into memory-refa…
Andy-Jost Oct 31, 2025
44f7587
Touch-ups
Andy-Jost Oct 31, 2025
7c97d22
Merge branch 'main' into memory-refactor
Andy-Jost Nov 3, 2025
0fac800
Cythonize DeviceMemoryResourceAttributes.
Andy-Jost Nov 4, 2025
0d5f08b
Restore previous behavior for DMR.from_allocation_handle when passed …
Andy-Jost Nov 4, 2025
567ea2c
Merge branch 'main' into memory-refactor
Andy-Jost Nov 4, 2025
7315e28
Rename _mr to _memory_resource. Change pointer types from intptr_t to…
Andy-Jost Nov 7, 2025
cf4dc9d
Merge branch 'main' into memory-refactor
Andy-Jost Nov 7, 2025
19e4b8f
Merge branch 'main' into memory-refactor
Andy-Jost Nov 10, 2025
743b8a3
Merge remote-tracking branch 'origin/main' into memory-refactor
Andy-Jost Nov 12, 2025
cce7f6c
Rename files _dmr.* and _vmm.py to avoid abbreviations.
Andy-Jost Nov 12, 2025
ff3820f
Merge branch 'main' into memory-refactor
Andy-Jost Nov 12, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions cuda_core/cuda/core/experimental/_device.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,14 @@ cimport cpython
from libc.stdint cimport uintptr_t

from cuda.bindings cimport cydriver

from cuda.core.experimental._utils.cuda_utils cimport HANDLE_RETURN

import threading
from typing import Union
from typing import Union, TYPE_CHECKING

from cuda.core.experimental._context import Context, ContextOptions
from cuda.core.experimental._event import Event, EventOptions
from cuda.core.experimental._graph import GraphBuilder
from cuda.core.experimental._memory import Buffer, DeviceMemoryResource, MemoryResource, _SynchronousMemoryResource
from cuda.core.experimental._stream import IsStreamT, Stream, StreamOptions
from cuda.core.experimental._utils.clear_error_support import assert_type
from cuda.core.experimental._utils.cuda_utils import (
Expand All @@ -27,7 +25,8 @@ from cuda.core.experimental._utils.cuda_utils import (
)
from cuda.core.experimental._stream cimport default_stream


if TYPE_CHECKING:
from cuda.core.experimental._memory import Buffer, MemoryResource

# TODO: I prefer to type these as "cdef object" and avoid accessing them from within Python,
# but it seems it is very convenient to expose them for testing purposes...
Expand Down Expand Up @@ -996,8 +995,10 @@ class Device:
)
)
if attr == 1:
from cuda.core.experimental._memory import DeviceMemoryResource
device._mr = DeviceMemoryResource(dev_id)
else:
from cuda.core.experimental._memory import _SynchronousMemoryResource
device._mr = _SynchronousMemoryResource(dev_id)

device._has_inited = False
Expand Down Expand Up @@ -1131,6 +1132,7 @@ class Device:

@memory_resource.setter
def memory_resource(self, mr):
from cuda.core.experimental._memory import MemoryResource
assert_type(mr, MemoryResource)
self._mr = mr

Expand Down
5 changes: 2 additions & 3 deletions cuda_core/cuda/core/experimental/_event.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,13 @@ from __future__ import annotations
cimport cpython
from libc.stdint cimport uintptr_t
from libc.string cimport memcpy

from cuda.bindings cimport cydriver

from cuda.core.experimental._utils.cuda_utils cimport (
check_or_create_options,
HANDLE_RETURN
)

import cython
from dataclasses import dataclass
import multiprocessing
from typing import TYPE_CHECKING, Optional
Expand Down Expand Up @@ -287,7 +286,7 @@ cdef class IPCEventDescriptor:
raise RuntimeError("IPCEventDescriptor objects cannot be instantiated directly. Please use Event APIs.")

@classmethod
def _init(cls, reserved: bytes, busy_waited: bint):
def _init(cls, reserved: bytes, busy_waited: cython.bint):
cdef IPCEventDescriptor self = IPCEventDescriptor.__new__(cls)
self._reserved = reserved
self._busy_waited = busy_waited
Expand Down
Loading
Loading