From 785fd3d64bad0bf6d0a8f98f43414faf3d6195b7 Mon Sep 17 00:00:00 2001 From: Som Tripathi Date: Fri, 30 Oct 2026 16:51:06 -0500 Subject: [PATCH 1/2] docs(cuda.core): name numa_id in the modify_allocation config rules modify_allocation rejects a per-call config whose numa_id differs from the resource's, but its docstring named only location_type and handle_type. Add numa_id to the config parameter and to the ValueError entry, as the review of #3149 asked. Signed-off-by: Som Tripathi --- cuda_core/cuda/core/_memory/_virtual_memory_resource.pyi | 8 ++++---- cuda_core/cuda/core/_memory/_virtual_memory_resource.pyx | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/cuda_core/cuda/core/_memory/_virtual_memory_resource.pyi b/cuda_core/cuda/core/_memory/_virtual_memory_resource.pyi index 4716c141b24..10d8dbfabf8 100644 --- a/cuda_core/cuda/core/_memory/_virtual_memory_resource.pyi +++ b/cuda_core/cuda/core/_memory/_virtual_memory_resource.pyi @@ -282,8 +282,8 @@ class VirtualMemoryResource(MemoryResource): Configuration for the new physical memory chunk only. Existing chunks keep the access they were created with, and the resource's own configuration is unchanged. It must name the resource's - ``location_type`` and ``handle_type`` and passes the same checks - as the constructor. + ``location_type``, ``handle_type``, and ``numa_id`` and passes the + same checks as the constructor. When ``buf`` already covers ``new_size`` there is no new chunk, so ``config`` has no effect. This method never changes the access of memory that is already mapped. @@ -300,8 +300,8 @@ class VirtualMemoryResource(MemoryResource): TypeError If ``buf`` did not come from this resource. ValueError - If ``config`` names a different location or handle type than the - resource, or the constructor would reject it. + If ``config`` names a different location type, handle type, or + ``numa_id`` than the resource, or the constructor would reject it. RuntimeError If ``buf`` is closed, or ``config`` requests GPUDirect RDMA on a device without support. diff --git a/cuda_core/cuda/core/_memory/_virtual_memory_resource.pyx b/cuda_core/cuda/core/_memory/_virtual_memory_resource.pyx index 69a04ccc4aa..9982841915f 100644 --- a/cuda_core/cuda/core/_memory/_virtual_memory_resource.pyx +++ b/cuda_core/cuda/core/_memory/_virtual_memory_resource.pyx @@ -728,8 +728,8 @@ cdef class VirtualMemoryResource(MemoryResource): Configuration for the new physical memory chunk only. Existing chunks keep the access they were created with, and the resource's own configuration is unchanged. It must name the resource's - ``location_type`` and ``handle_type`` and passes the same checks - as the constructor. + ``location_type``, ``handle_type``, and ``numa_id`` and passes the + same checks as the constructor. When ``buf`` already covers ``new_size`` there is no new chunk, so ``config`` has no effect. This method never changes the access of memory that is already mapped. @@ -746,8 +746,8 @@ cdef class VirtualMemoryResource(MemoryResource): TypeError If ``buf`` did not come from this resource. ValueError - If ``config`` names a different location or handle type than the - resource, or the constructor would reject it. + If ``config`` names a different location type, handle type, or + ``numa_id`` than the resource, or the constructor would reject it. RuntimeError If ``buf`` is closed, or ``config`` requests GPUDirect RDMA on a device without support. From 36b21cb9206e6779070a07130e0b6ffe962a8e23 Mon Sep 17 00:00:00 2001 From: Som Tripathi Date: Fri, 30 Oct 2026 16:58:57 -0500 Subject: [PATCH 2/2] docs(cuda.core): let "must" govern both verbs in the config entry The config entry said config "must name the resource's location_type, handle_type, and numa_id and passes the same checks as the constructor". Make it "pass", so both parts read as requirements. Signed-off-by: Som Tripathi --- cuda_core/cuda/core/_memory/_virtual_memory_resource.pyi | 2 +- cuda_core/cuda/core/_memory/_virtual_memory_resource.pyx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cuda_core/cuda/core/_memory/_virtual_memory_resource.pyi b/cuda_core/cuda/core/_memory/_virtual_memory_resource.pyi index 10d8dbfabf8..536699eed2e 100644 --- a/cuda_core/cuda/core/_memory/_virtual_memory_resource.pyi +++ b/cuda_core/cuda/core/_memory/_virtual_memory_resource.pyi @@ -282,7 +282,7 @@ class VirtualMemoryResource(MemoryResource): Configuration for the new physical memory chunk only. Existing chunks keep the access they were created with, and the resource's own configuration is unchanged. It must name the resource's - ``location_type``, ``handle_type``, and ``numa_id`` and passes the + ``location_type``, ``handle_type``, and ``numa_id`` and pass the same checks as the constructor. When ``buf`` already covers ``new_size`` there is no new chunk, so ``config`` has no effect. This method never changes the access of diff --git a/cuda_core/cuda/core/_memory/_virtual_memory_resource.pyx b/cuda_core/cuda/core/_memory/_virtual_memory_resource.pyx index 9982841915f..90ac28b1d54 100644 --- a/cuda_core/cuda/core/_memory/_virtual_memory_resource.pyx +++ b/cuda_core/cuda/core/_memory/_virtual_memory_resource.pyx @@ -728,7 +728,7 @@ cdef class VirtualMemoryResource(MemoryResource): Configuration for the new physical memory chunk only. Existing chunks keep the access they were created with, and the resource's own configuration is unchanged. It must name the resource's - ``location_type``, ``handle_type``, and ``numa_id`` and passes the + ``location_type``, ``handle_type``, and ``numa_id`` and pass the same checks as the constructor. When ``buf`` already covers ``new_size`` there is no new chunk, so ``config`` has no effect. This method never changes the access of