You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CUDA 13.0 makes memory-pool routing location-keyed: pools are addressed by (CUmemLocation, CUmemAllocationType) — covering device pools, host / host-NUMA pools, and
managed pools (CU_MEM_ALLOCATION_TYPE_MANAGED, 13.0) under one surface:
); cuMemGetDefaultMemPool / cuMemSetMemPool are unused.
None of the 13.2 pool attributes are exposed on the memory-resource classes.
CU_MEM_LOCATION_TYPE_NONE (13.0) is used internally and, together with CU_MEM_LOCATION_TYPE_INVISIBLE (13.2), is deliberately unmapped in the public StrEnum
(
Starting point only, not a settled design — review in the cuda.core design meeting.
Read-only properties on DeviceMemoryResource (and the host/managed resources) for the new
pool attributes; max_pool_size may warrant a setter — TBD.
Device.default_memory_resource (and a host-side equivalent) backed by cuMemGetDefaultMemPool, returning the corresponding memory-resource wrapper.
cuMemSetMemPool is a process-global state mutation — either expose it as an explicit,
loudly-documented function, or deliberately keep it unexposed initially.
Open questions for the meeting:
Expose the global setter at all (footgun) vs. get-only in the first pass?
Summary
CUDA 13.0 makes memory-pool routing location-keyed: pools are addressed by
(CUmemLocation, CUmemAllocationType)— covering device pools, host / host-NUMA pools, andmanaged pools (
CU_MEM_ALLOCATION_TYPE_MANAGED, 13.0) under one surface:cuMemGetDefaultMemPool(CUmemoryPool* pool_out, CUmemLocation* location, CUmemAllocationType type)cuMemGetMemPool(CUmemoryPool* pool, CUmemLocation* location, CUmemAllocationType type)(current pool)cuMemSetMemPool(CUmemLocation* location, CUmemAllocationType type, CUmemoryPool pool)CUDA 13.2 adds six
CUmemPool_attributemembers:CU_MEMPOOL_ATTR_ALLOCATION_TYPE,EXPORT_HANDLE_TYPES,HW_DECOMPRESS_ENABLED,LOCATION_ID,LOCATION_TYPE,MAX_POOL_SIZE.Current cuda.core state:
cuMemGetMemPoolis already used internally to obtain non-owning pool handles(
cuda-python/cuda_core/cuda/core/_memory/_memory_pool.pyx
Line 283 in c000331
cuMemGetDefaultMemPool/cuMemSetMemPoolare unused.CU_MEM_LOCATION_TYPE_NONE(13.0) is used internally and, together withCU_MEM_LOCATION_TYPE_INVISIBLE(13.2), is deliberately unmapped in the public StrEnum(
cuda-python/cuda_core/tests/test_enum_coverage.py
Lines 59 to 61 in c000331
— this issue should decide their public fate.
Relates to the memory-resource architecture work (#209, #528, #726) — none of which tracks
these APIs.
Underlying C APIs to cover
cuMemGetDefaultMemPool,cuMemGetMemPool,cuMemSetMemPool;CUmemPool_attributemembersALLOCATION_TYPE,EXPORT_HANDLE_TYPES,HW_DECOMPRESS_ENABLED,LOCATION_ID,LOCATION_TYPE,MAX_POOL_SIZE;CU_MEM_LOCATION_TYPE_{NONE,INVISIBLE}mapping decision.Design sketch (draft — needs design-meeting review)
Important
Starting point only, not a settled design — review in the cuda.core design meeting.
DeviceMemoryResource(and the host/managed resources) for the newpool attributes;
max_pool_sizemay warrant a setter — TBD.Device.default_memory_resource(and a host-side equivalent) backed bycuMemGetDefaultMemPool, returning the corresponding memory-resource wrapper.cuMemSetMemPoolis a process-global state mutation — either expose it as an explicit,loudly-documented function, or deliberately keep it unexposed initially.
Open questions for the meeting:
(location, allocation type)keying maps onto cuda.core'sDevice/Hostlocationobjects (incl. host-NUMA IDs).
HW_DECOMPRESS_ENABLEDbelong here or with a future decompress feature?NONE/INVISIBLElocation types.References
-- Leo's bot