Skip to main content

Module memory_management

Module memory_management 

Source
Expand description

Memory management value types: reports, configuration and the managed handle. The pools behind them are cubecl-server’s.

Structs§

AuxiliaryMemoryReport
A memory a runtime keeps for its own use, and what it holds.
ManagedMemoryBinding
Binding of a memory handle
ManagedMemoryHandle
Managed Memory handle
ManagedMemoryId
Managed memory unique identifier.
MemoryPoolReport
A structured snapshot of one memory pool: its shape, its current usage, and the high-water marks a memory plan is derived from.
MemoryPoolsReport
What a memory holds, pool by pool.
MemoryRecord
A MemoryReport as the environment records it: a snapshot of every stream’s memory on the device at a moment the caller named, written by Client::record_memory.
MemoryReport
Everything the memory of a MemoryScope holds, stream by stream: the single place memory is read from. A caller that wants the totals asks for the usage.
MemoryUsage
Amount of memory in use by this allocator and statistics on how much memory is reserved and wasted in total.
PageGuard
Keeps a page as it is for as long as it lives: nothing new is carved from it, it is never released, and relocation leaves everything on it in place.
SharedMemoryBindings
A list of bindings that are shared across multiple streams.
StreamMemoryReport
What one stream’s memory holds.
WeakMemoryBinding
A ManagedMemoryBinding that does not keep its memory reserved: what a record of an allocation holds when holding the allocation itself would change what the pools may reuse.

Enums§

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).
MemoryScope
Which memory a MemoryReport covers.

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.