TensorBinding
PythonPlanner's emit intent for a single tensor's storage.
TensorBinding()Planner’s emit intent for a single tensor’s storage.
Provisional: importable, but outside the compatibility promise; a minor release can change or remove it.
Every tensor in a :class:MemoryPlan is bound to an arena slot at
(role, memory, offset). There are no per-tensor C symbols
anymore — scratch, persistent, and constant tensors are all
descriptors against arena buffers exposed via
arena_buffers[region].
Constant arenas come in two shapes, distinguished purely by
whether source_memory matches memory:
- Cold (
source_memory == memory): the arena buffer itself is astatic constblob in cold storage. Kernels read it directly; no hydration is required. - Staged (
source_memory != memory): the arena buffer is a writable runtime copy inmemory; a separate read-only source blob lives insource_memoryand the caller (or the weak<prefix>_hydrate_constantshelper) copies it in before the firstmodel_run.
Scratch and persistent bindings always have
source_memory == memory (they are writable arenas with no
cold-storage source).
role
Pythonrole: ArenaRole = Field(..., description='Logical role of the storage region.')Logical role of the storage region.
memory
Pythonmemory: MemoryType = Field(..., description='Runtime memory of the arena slot.')Runtime (kernel-visible) memory of the arena slot.
source_memory
Pythonsource_memory: MemoryType = Field(..., description='Cold-storage memory the slot is sourced from.')Cold-storage memory the slot is
sourced from. Equals memory for scratch, persistent,
and cold constants; differs from memory for staged
constants.
offset
Pythonoffset: int = Field(default=0, description='Byte offset within the arena.')Byte offset within the arena.