ArenaRole
PythonLogical role of a memory arena.
ArenaRole()Logical role of a memory arena.
Provisional: importable, but outside the compatibility promise; a minor release can change or remove it.
Every tensor in a :class:MemoryPlan lives in an arena tagged
with one of these roles. Roles partition the planner output so
scratch reuse, persistent zero-init, and constant residency can
be reasoned about independently.
Each member also answers to its lowercase name (ArenaRole.scratch),
an alias of the same member; the value is the spelling reports use.
SCRATCH
PythonSCRATCH = auto()scratch. Writable activation/scratch arena
(whole-program lifetime shared by ops, slots reused via liveness
analysis).
PERSISTENT
PythonPERSISTENT = auto()persistent. Whole-program-live writable storage
(resource variables and similar).
CONSTANT
PythonCONSTANT = auto()constant. Read-only weight storage. Can be cold (the
arena buffer is the cold-storage blob and kernels read it in
place) or staged (the arena buffer is a writable runtime copy
hydrated from a separate source blob).
scratch
Pythonscratch = SCRATCHpersistent
Pythonpersistent = PERSISTENTconstant
Pythonconstant = CONSTANT