Skip to main content

Module memory_management

Module memory_management 

Source
Expand description

Memory management module. Memory pools and the bookkeeping behind a Handle.

The value types a client sees — reports, configuration, the handle itself — are cubecl-runtime’s and re-exported here.

Modules§

drop_queue
Export utilities to keep track of CPU buffers when performing async data copies.

Structs§

ErrorGraph
Every failure the device is still holding, and how many allocations carry each one.
FailureId
The id a tainted allocation carries, naming the failure that left its bytes unwritten.
ManagedMemoryBinding
Binding of a memory handle
ManagedMemoryHandle
Managed Memory handle
ManagedMemoryId
Managed memory unique identifier.
MemoryManagement
Reserves and keeps track of chunks of memory in the storage, and slices upon these chunks.
MemoryManagementOptions
The options for creating a new MemoryManagement instance.
MemoryPoolOptions
Options to create a memory pool.
MemoryPoolReport
A structured snapshot of one memory pool: its shape, its current usage, and the high-water marks a memory plan is derived from.
MemoryRecord
A MemoryReport as the environment records it: a snapshot of one stream’s pools at a moment the caller named, written by Client::record_memory.
MemoryReport
A per-pool report of one MemoryManagement (in cubecl-server) instance — the read side of a measured memory plan.
MemoryUsage
Amount of memory in use by this allocator and statistics on how much memory is reserved and wasted in total.
SharedMemoryBindings
A list of bindings that are shared across multiple streams.
Skipped
One launch a failure stopped: the kernel that did not run, the buffer whose claim stopped it, and what it would have produced.
Taint
The tainted regions of one allocation, refcounted into the device’s ErrorGraph.

Enums§

Claim
Why the bytes of one buffer cannot be trusted, as a read finds it.
InstallMemoryPoolsError
Why installing a dynamic pool layout did not take effect.
MemoryAllocationMode
The mode of allocation used.
MemoryConfiguration
High level configuration of memory management.
MemoryPoolKind
The pool shape a MemoryPoolReport describes, carrying the pool’s effective configuration (after alignment rounding and page-size shrinking).
PoolConfigError
Why a memory.pools config could not be turned into a pool layout.
PoolType
The type of memory pool to use.

Constants§

EXCLUSIVE_MEMORY_ONLY
Whether this build refuses pools that share a page between allocations — the exclusive-memory-only feature, or a wasm target.

Traits§

MemoryHandle
The managed tensor buffer handle that points to some memory segment. It should not contain actual data.

Functions§

optimal_align
Calculates a best-effort heuristic for the alignment of row-aligned tensors. Prefers contiguous alignments for unit dimensions, 16-byte minimum alignment for non-unit, scaling with input size up to buffer_align.