ArenaRole
PythonLogical role of a memory arena.
ArenaRole()Logical role of a memory arena.
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.
scratch
Pythonscratch = auto()Writable activation/scratch arena (whole-program lifetime shared by ops, slots reused via liveness analysis).
persistent
Pythonpersistent = auto()Whole-program-live writable storage (resource variables and similar).
constant
Pythonconstant = auto()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).