{
  "$schema": "https://ambiqai.github.io/helia-ui/schema/reference-model-1.json",
  "generatedFrom": {
    "sourceCommit": "cf2246a7ad439fa38d57462118e7840e5497a685",
    "tool": "pyref",
    "version": "1.7.3"
  },
  "language": "python",
  "modules": [
    {
      "description": "Memory planning data model.\n\nDescribes what a planner consumes and produces: arena roles and usage, tensor\nbindings, lifetimes and allocations, the placement constraints read from\nconfiguration, and the resulting :class:`MemoryPlan`.",
      "name": "defines",
      "path": "helia_aot.memory.defines",
      "submodules": [],
      "summary": "Memory planning data model.",
      "symbols": [
        {
          "description": "Logical role of a memory arena.\n\nEvery tensor in a :class:`MemoryPlan` lives in an arena tagged\nwith one of these roles. Roles partition the planner output so\nscratch reuse, persistent zero-init, and constant residency can\nbe reasoned about independently.",
          "examples": [],
          "id": "helia_aot.memory.defines.ArenaRole",
          "kind": "class",
          "language": "python",
          "members": [
            {
              "description": "Writable activation/scratch arena (whole-program\nlifetime shared by ops, slots reused via liveness\nanalysis).",
              "examples": [],
              "id": "helia_aot.memory.defines.ArenaRole.scratch",
              "kind": "attribute",
              "language": "python",
              "members": [],
              "name": "scratch",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "scratch = auto()",
              "source": {
                "line": 38,
                "path": "helia_aot/memory/defines.py",
                "url": "https://github.com/AmbiqAI/helia-aot/blob/cf2246a7ad439fa38d57462118e7840e5497a685/helia_aot/memory/defines.py#L38"
              },
              "summary": ""
            },
            {
              "description": "Whole-program-live writable storage (resource\nvariables and similar).",
              "examples": [],
              "id": "helia_aot.memory.defines.ArenaRole.persistent",
              "kind": "attribute",
              "language": "python",
              "members": [],
              "name": "persistent",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "persistent = auto()",
              "source": {
                "line": 39,
                "path": "helia_aot/memory/defines.py",
                "url": "https://github.com/AmbiqAI/helia-aot/blob/cf2246a7ad439fa38d57462118e7840e5497a685/helia_aot/memory/defines.py#L39"
              },
              "summary": ""
            },
            {
              "description": "Read-only weight storage. Can be cold (the arena\nbuffer is the cold-storage blob and kernels read it in\nplace) or staged (the arena buffer is a writable runtime\ncopy hydrated from a separate source blob).",
              "examples": [],
              "id": "helia_aot.memory.defines.ArenaRole.constant",
              "kind": "attribute",
              "language": "python",
              "members": [],
              "name": "constant",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "constant = auto()",
              "source": {
                "line": 40,
                "path": "helia_aot/memory/defines.py",
                "url": "https://github.com/AmbiqAI/helia-aot/blob/cf2246a7ad439fa38d57462118e7840e5497a685/helia_aot/memory/defines.py#L40"
              },
              "summary": ""
            }
          ],
          "name": "ArenaRole",
          "params": [],
          "raises": [],
          "returns": [],
          "signature": "ArenaRole()",
          "source": {
            "line": 18,
            "path": "helia_aot/memory/defines.py",
            "url": "https://github.com/AmbiqAI/helia-aot/blob/cf2246a7ad439fa38d57462118e7840e5497a685/helia_aot/memory/defines.py#L18"
          },
          "summary": "Logical role of a memory arena."
        },
        {
          "description": "Planner's emit intent for a single tensor's storage.\n\nEvery tensor in a :class:`MemoryPlan` is bound to an arena slot at\n``(role, memory, offset)``. There are no per-tensor C symbols\nanymore — scratch, persistent, and constant tensors are all\ndescriptors against arena buffers exposed via\n``arena_buffers[region]``.\n\nConstant arenas come in two shapes, distinguished purely by\nwhether ``source_memory`` matches ``memory``:\n\n- **Cold** (``source_memory == memory``): the arena buffer itself\n  is a ``static const`` blob in cold storage. Kernels read it\n  directly; no hydration is required.\n- **Staged** (``source_memory != memory``): the arena buffer is a\n  writable runtime copy in ``memory``; a separate read-only\n  source blob lives in ``source_memory`` and the caller (or the\n  weak ``<prefix>_hydrate_constants`` helper) copies it in\n  before the first ``model_run``.\n\nScratch and persistent bindings always have\n``source_memory == memory`` (they are writable arenas with no\ncold-storage source).",
          "examples": [],
          "id": "helia_aot.memory.defines.TensorBinding",
          "kind": "class",
          "language": "python",
          "members": [
            {
              "description": "Logical role of the storage region.",
              "examples": [],
              "id": "helia_aot.memory.defines.TensorBinding.role",
              "kind": "attribute",
              "language": "python",
              "members": [],
              "name": "role",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "role: ArenaRole = Field(..., description='Logical role of the storage region.')",
              "source": {
                "line": 80,
                "path": "helia_aot/memory/defines.py",
                "url": "https://github.com/AmbiqAI/helia-aot/blob/cf2246a7ad439fa38d57462118e7840e5497a685/helia_aot/memory/defines.py#L80"
              },
              "summary": ""
            },
            {
              "description": "Runtime (kernel-visible) memory of the\narena slot.",
              "examples": [],
              "id": "helia_aot.memory.defines.TensorBinding.memory",
              "kind": "attribute",
              "language": "python",
              "members": [],
              "name": "memory",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "memory: MemoryType = Field(..., description='Runtime memory of the arena slot.')",
              "source": {
                "line": 81,
                "path": "helia_aot/memory/defines.py",
                "url": "https://github.com/AmbiqAI/helia-aot/blob/cf2246a7ad439fa38d57462118e7840e5497a685/helia_aot/memory/defines.py#L81"
              },
              "summary": ""
            },
            {
              "description": "Cold-storage memory the slot is\nsourced from. Equals ``memory`` for scratch, persistent,\nand cold constants; differs from ``memory`` for staged\nconstants.",
              "examples": [],
              "id": "helia_aot.memory.defines.TensorBinding.source_memory",
              "kind": "attribute",
              "language": "python",
              "members": [],
              "name": "source_memory",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "source_memory: MemoryType = Field(..., description='Cold-storage memory the slot is sourced from.')",
              "source": {
                "line": 82,
                "path": "helia_aot/memory/defines.py",
                "url": "https://github.com/AmbiqAI/helia-aot/blob/cf2246a7ad439fa38d57462118e7840e5497a685/helia_aot/memory/defines.py#L82"
              },
              "summary": ""
            },
            {
              "description": "Byte offset within the arena.",
              "examples": [],
              "id": "helia_aot.memory.defines.TensorBinding.offset",
              "kind": "attribute",
              "language": "python",
              "members": [],
              "name": "offset",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "offset: int = Field(default=0, description='Byte offset within the arena.')",
              "source": {
                "line": 83,
                "path": "helia_aot/memory/defines.py",
                "url": "https://github.com/AmbiqAI/helia-aot/blob/cf2246a7ad439fa38d57462118e7840e5497a685/helia_aot/memory/defines.py#L83"
              },
              "summary": ""
            }
          ],
          "name": "TensorBinding",
          "params": [],
          "raises": [],
          "returns": [],
          "signature": "TensorBinding()",
          "source": {
            "line": 43,
            "path": "helia_aot/memory/defines.py",
            "url": "https://github.com/AmbiqAI/helia-aot/blob/cf2246a7ad439fa38d57462118e7840e5497a685/helia_aot/memory/defines.py#L43"
          },
          "summary": "Planner's emit intent for a single tensor's storage."
        },
        {
          "description": "Tensor operator lifetime.",
          "examples": [],
          "id": "helia_aot.memory.defines.TensorLifetime",
          "kind": "class",
          "language": "python",
          "members": [
            {
              "description": "Unique identifier for the tensor",
              "examples": [],
              "id": "helia_aot.memory.defines.TensorLifetime.tensor_id",
              "kind": "attribute",
              "language": "python",
              "members": [],
              "name": "tensor_id",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "tensor_id: TensorId = Field(..., description='Unique identifier for the tensor')",
              "source": {
                "line": 96,
                "path": "helia_aot/memory/defines.py",
                "url": "https://github.com/AmbiqAI/helia-aot/blob/cf2246a7ad439fa38d57462118e7840e5497a685/helia_aot/memory/defines.py#L96"
              },
              "summary": ""
            },
            {
              "description": "Index of the first operator that uses/defines it",
              "examples": [],
              "id": "helia_aot.memory.defines.TensorLifetime.start_op",
              "kind": "attribute",
              "language": "python",
              "members": [],
              "name": "start_op",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "start_op: int = Field(..., description='Index of the first operator that uses/defines it')",
              "source": {
                "line": 97,
                "path": "helia_aot/memory/defines.py",
                "url": "https://github.com/AmbiqAI/helia-aot/blob/cf2246a7ad439fa38d57462118e7840e5497a685/helia_aot/memory/defines.py#L97"
              },
              "summary": ""
            },
            {
              "description": "Index of the last operator that uses it",
              "examples": [],
              "id": "helia_aot.memory.defines.TensorLifetime.end_op",
              "kind": "attribute",
              "language": "python",
              "members": [],
              "name": "end_op",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "end_op: int = Field(..., description='Index of the last operator that uses it')",
              "source": {
                "line": 98,
                "path": "helia_aot/memory/defines.py",
                "url": "https://github.com/AmbiqAI/helia-aot/blob/cf2246a7ad439fa38d57462118e7840e5497a685/helia_aot/memory/defines.py#L98"
              },
              "summary": ""
            },
            {
              "description": "Add an operator index to the lifetime.",
              "examples": [],
              "id": "helia_aot.memory.defines.TensorLifetime.add_op",
              "kind": "method",
              "language": "python",
              "members": [],
              "name": "add_op",
              "params": [
                {
                  "description": "Operator index to add",
                  "name": "op_idx",
                  "type": "int"
                }
              ],
              "raises": [],
              "returns": [],
              "signature": "add_op(op_idx: int)",
              "source": {
                "line": 100,
                "path": "helia_aot/memory/defines.py",
                "url": "https://github.com/AmbiqAI/helia-aot/blob/cf2246a7ad439fa38d57462118e7840e5497a685/helia_aot/memory/defines.py#L100"
              },
              "summary": "Add an operator index to the lifetime."
            },
            {
              "description": "Merge another lifetime into this one.\n\nThis updates the start and end operators to encompass both lifetimes.\nUseful when tensors have aliases.",
              "examples": [],
              "id": "helia_aot.memory.defines.TensorLifetime.merge",
              "kind": "method",
              "language": "python",
              "members": [],
              "name": "merge",
              "params": [
                {
                  "description": "Another tensor lifetime to merge",
                  "name": "other",
                  "type": "TensorLifetime"
                }
              ],
              "raises": [],
              "returns": [],
              "signature": "merge(other: TensorLifetime)",
              "source": {
                "line": 109,
                "path": "helia_aot/memory/defines.py",
                "url": "https://github.com/AmbiqAI/helia-aot/blob/cf2246a7ad439fa38d57462118e7840e5497a685/helia_aot/memory/defines.py#L109"
              },
              "summary": "Merge another lifetime into this one."
            }
          ],
          "name": "TensorLifetime",
          "params": [],
          "raises": [],
          "returns": [],
          "signature": "TensorLifetime()",
          "source": {
            "line": 86,
            "path": "helia_aot/memory/defines.py",
            "url": "https://github.com/AmbiqAI/helia-aot/blob/cf2246a7ad439fa38d57462118e7840e5497a685/helia_aot/memory/defines.py#L86"
          },
          "summary": "Tensor operator lifetime."
        },
        {
          "description": "Metadata for a tensor allocation.",
          "examples": [],
          "id": "helia_aot.memory.defines.TensorAllocation",
          "kind": "class",
          "language": "python",
          "members": [
            {
              "description": "Unique identifier for the tensor",
              "examples": [],
              "id": "helia_aot.memory.defines.TensorAllocation.tensor_id",
              "kind": "attribute",
              "language": "python",
              "members": [],
              "name": "tensor_id",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "tensor_id: TensorId = Field(..., description='Unique identifier for the tensor')",
              "source": {
                "line": 146,
                "path": "helia_aot/memory/defines.py",
                "url": "https://github.com/AmbiqAI/helia-aot/blob/cf2246a7ad439fa38d57462118e7840e5497a685/helia_aot/memory/defines.py#L146"
              },
              "summary": ""
            },
            {
              "description": "Memory type for the allocation (runtime\n/ kernel-visible memory of the arena slot)",
              "examples": [],
              "id": "helia_aot.memory.defines.TensorAllocation.memory",
              "kind": "attribute",
              "language": "python",
              "members": [],
              "name": "memory",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "memory: MemoryType = Field(..., description='Memory type for the allocation')",
              "source": {
                "line": 147,
                "path": "helia_aot/memory/defines.py",
                "url": "https://github.com/AmbiqAI/helia-aot/blob/cf2246a7ad439fa38d57462118e7840e5497a685/helia_aot/memory/defines.py#L147"
              },
              "summary": ""
            },
            {
              "description": "Offset within the arena",
              "examples": [],
              "id": "helia_aot.memory.defines.TensorAllocation.offset",
              "kind": "attribute",
              "language": "python",
              "members": [],
              "name": "offset",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "offset: int = Field(default=0, description='Offset within the memory arena')",
              "source": {
                "line": 148,
                "path": "helia_aot/memory/defines.py",
                "url": "https://github.com/AmbiqAI/helia-aot/blob/cf2246a7ad439fa38d57462118e7840e5497a685/helia_aot/memory/defines.py#L148"
              },
              "summary": ""
            },
            {
              "description": "Size of the allocation in bytes",
              "examples": [],
              "id": "helia_aot.memory.defines.TensorAllocation.size",
              "kind": "attribute",
              "language": "python",
              "members": [],
              "name": "size",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "size: int = Field(default=0, description='Size of the allocation in bytes')",
              "source": {
                "line": 149,
                "path": "helia_aot/memory/defines.py",
                "url": "https://github.com/AmbiqAI/helia-aot/blob/cf2246a7ad439fa38d57462118e7840e5497a685/helia_aot/memory/defines.py#L149"
              },
              "summary": ""
            },
            {
              "description": "Planner's binding describing\n``(role, memory, offset, source_memory)`` for the slot.\nDefaults to ``None`` for callers that construct\n:class:`TensorAllocation` directly; the bundled\n:class:`GreedyMemoryPlanner` always populates it. Emit\ntemplates dispatch on ``binding.role`` and on the\n``binding.source_memory == binding.memory`` predicate\n(cold vs staged constant).",
              "examples": [],
              "id": "helia_aot.memory.defines.TensorAllocation.binding",
              "kind": "attribute",
              "language": "python",
              "members": [],
              "name": "binding",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "binding: TensorBinding | None = Field(default=None, description=\"Planner-assigned binding describing how this tensor's storage is materialized.\")",
              "source": {
                "line": 150,
                "path": "helia_aot/memory/defines.py",
                "url": "https://github.com/AmbiqAI/helia-aot/blob/cf2246a7ad439fa38d57462118e7840e5497a685/helia_aot/memory/defines.py#L150"
              },
              "summary": ""
            }
          ],
          "name": "TensorAllocation",
          "params": [],
          "raises": [],
          "returns": [],
          "signature": "TensorAllocation()",
          "source": {
            "line": 126,
            "path": "helia_aot/memory/defines.py",
            "url": "https://github.com/AmbiqAI/helia-aot/blob/cf2246a7ad439fa38d57462118e7840e5497a685/helia_aot/memory/defines.py#L126"
          },
          "summary": "Metadata for a tensor allocation."
        },
        {
          "description": "Metadata for a memory arena.",
          "examples": [],
          "id": "helia_aot.memory.defines.ArenaUsage",
          "kind": "class",
          "language": "python",
          "members": [
            {
              "description": "Runtime (kernel-visible) memory of the\narena.",
              "examples": [],
              "id": "helia_aot.memory.defines.ArenaUsage.memory",
              "kind": "attribute",
              "language": "python",
              "members": [],
              "name": "memory",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "memory: MemoryType = Field(..., description='Runtime memory of the arena.')",
              "source": {
                "line": 177,
                "path": "helia_aot/memory/defines.py",
                "url": "https://github.com/AmbiqAI/helia-aot/blob/cf2246a7ad439fa38d57462118e7840e5497a685/helia_aot/memory/defines.py#L177"
              },
              "summary": ""
            },
            {
              "description": "Total bytes in this arena.",
              "examples": [],
              "id": "helia_aot.memory.defines.ArenaUsage.total_size",
              "kind": "attribute",
              "language": "python",
              "members": [],
              "name": "total_size",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "total_size: int = Field(default=0, description='Total bytes in this arena')",
              "source": {
                "line": 178,
                "path": "helia_aot/memory/defines.py",
                "url": "https://github.com/AmbiqAI/helia-aot/blob/cf2246a7ad439fa38d57462118e7840e5497a685/helia_aot/memory/defines.py#L178"
              },
              "summary": ""
            },
            {
              "description": "Bytes actually used. For bump-allocated arenas\n(constant, persistent) this equals ``total_size``.",
              "examples": [],
              "id": "helia_aot.memory.defines.ArenaUsage.used",
              "kind": "attribute",
              "language": "python",
              "members": [],
              "name": "used",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "used: int = Field(default=0, description='Bytes actually used')",
              "source": {
                "line": 179,
                "path": "helia_aot/memory/defines.py",
                "url": "https://github.com/AmbiqAI/helia-aot/blob/cf2246a7ad439fa38d57462118e7840e5497a685/helia_aot/memory/defines.py#L179"
              },
              "summary": ""
            },
            {
              "description": "Logical role of the arena.",
              "examples": [],
              "id": "helia_aot.memory.defines.ArenaUsage.role",
              "kind": "attribute",
              "language": "python",
              "members": [],
              "name": "role",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "role: ArenaRole = Field(default=ArenaRole.scratch, description='Logical role of the arena (scratch | persistent | constant).')",
              "source": {
                "line": 180,
                "path": "helia_aot/memory/defines.py",
                "url": "https://github.com/AmbiqAI/helia-aot/blob/cf2246a7ad439fa38d57462118e7840e5497a685/helia_aot/memory/defines.py#L180"
              },
              "summary": ""
            },
            {
              "description": "The cold-storage memory the\narena's contents are sourced from. For scratch and\npersistent arenas this equals ``memory`` (purely runtime,\nno source blob). For constant arenas it equals ``memory``\nin the cold case (arena buffer is the cold blob in place)\nand differs from ``memory`` in the staged case (arena\nbuffer is a writable runtime copy of a source blob in\n``source_memory``).",
              "examples": [],
              "id": "helia_aot.memory.defines.ArenaUsage.source_memory",
              "kind": "attribute",
              "language": "python",
              "members": [],
              "name": "source_memory",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "source_memory: MemoryType = Field(default=None, description=\"Cold-storage source memory for the arena's contents. Equals ``memory`` for scratch, persistent, and cold constant arenas; differs from ``memory`` for staged constant arenas where bytes are copied at boot from this source memory into the writable runtime arena. Defaults to None for backward compatibility with callers that construct ArenaUsage directly; the bundled GreedyPlanner always populates it.\")",
              "source": {
                "line": 184,
                "path": "helia_aot/memory/defines.py",
                "url": "https://github.com/AmbiqAI/helia-aot/blob/cf2246a7ad439fa38d57462118e7840e5497a685/helia_aot/memory/defines.py#L184"
              },
              "summary": ""
            },
            {
              "description": "",
              "examples": [],
              "id": "helia_aot.memory.defines.ArenaUsage.alignment",
              "kind": "attribute",
              "language": "python",
              "members": [],
              "name": "alignment",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "alignment: int = Field(default=16, description='Resolved alignment of the arena base symbol (and floor for slot offsets within it). Stamped by the planner from max(implementation floor, platform.min_alignment, MemoryConstraint.arena_alignment).')",
              "source": {
                "line": 197,
                "path": "helia_aot/memory/defines.py",
                "url": "https://github.com/AmbiqAI/helia-aot/blob/cf2246a7ad439fa38d57462118e7840e5497a685/helia_aot/memory/defines.py#L197"
              },
              "summary": ""
            },
            {
              "description": "True iff this arena has a distinct cold source memory.\n\nEquivalent to ``source_memory is not None and source_memory !=\nmemory``. Centralizes the cold-vs-staged predicate so\ntemplates and handlers do not duplicate it.\n\nFor scratch and persistent arenas this is always ``False``\n(they have no cold source). For constant arenas it\ndistinguishes the two emit shapes:\n\n- ``False`` (cold): the arena buffer itself is a\n  ``static const`` blob in cold storage.\n- ``True`` (staged): the arena buffer is a writable runtime\n  copy hydrated from a separate source blob in\n  ``source_memory``.",
              "examples": [],
              "id": "helia_aot.memory.defines.ArenaUsage.is_staged",
              "kind": "attribute",
              "language": "python",
              "members": [],
              "name": "is_staged",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "is_staged: bool",
              "source": {
                "line": 216,
                "path": "helia_aot/memory/defines.py",
                "url": "https://github.com/AmbiqAI/helia-aot/blob/cf2246a7ad439fa38d57462118e7840e5497a685/helia_aot/memory/defines.py#L216"
              },
              "summary": "True iff this arena has a distinct cold source memory."
            },
            {
              "description": "Allocate a segment of the arena and return its offset",
              "examples": [],
              "id": "helia_aot.memory.defines.ArenaUsage.allocate",
              "kind": "method",
              "language": "python",
              "members": [],
              "name": "allocate",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "allocate(size: int) -> int",
              "source": {
                "line": 207,
                "path": "helia_aot/memory/defines.py",
                "url": "https://github.com/AmbiqAI/helia-aot/blob/cf2246a7ad439fa38d57462118e7840e5497a685/helia_aot/memory/defines.py#L207"
              },
              "summary": "Allocate a segment of the arena and return its offset"
            }
          ],
          "name": "ArenaUsage",
          "params": [],
          "raises": [],
          "returns": [],
          "signature": "ArenaUsage()",
          "source": {
            "line": 156,
            "path": "helia_aot/memory/defines.py",
            "url": "https://github.com/AmbiqAI/helia-aot/blob/cf2246a7ad439fa38d57462118e7840e5497a685/helia_aot/memory/defines.py#L156"
          },
          "summary": "Metadata for a memory arena."
        },
        {
          "description": "User-defined memory constraint",
          "examples": [],
          "id": "helia_aot.memory.defines.MemoryConstraint",
          "kind": "class",
          "language": "python",
          "members": [
            {
              "description": "Memory type (e.g., DTCM, ITCM)",
              "examples": [],
              "id": "helia_aot.memory.defines.MemoryConstraint.name",
              "kind": "attribute",
              "language": "python",
              "members": [],
              "name": "name",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "name: MemoryType = Field(..., description='Memory type (e.g., DTCM, ITCM)')",
              "source": {
                "line": 259,
                "path": "helia_aot/memory/defines.py",
                "url": "https://github.com/AmbiqAI/helia-aot/blob/cf2246a7ad439fa38d57462118e7840e5497a685/helia_aot/memory/defines.py#L259"
              },
              "summary": ""
            },
            {
              "description": "Maximum size in bytes, or None for no limit",
              "examples": [],
              "id": "helia_aot.memory.defines.MemoryConstraint.max_size",
              "kind": "attribute",
              "language": "python",
              "members": [],
              "name": "max_size",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "max_size: int | None = Field(default=None, description='Maximum size in bytes, or None for no limit')",
              "source": {
                "line": 260,
                "path": "helia_aot/memory/defines.py",
                "url": "https://github.com/AmbiqAI/helia-aot/blob/cf2246a7ad439fa38d57462118e7840e5497a685/helia_aot/memory/defines.py#L260"
              },
              "summary": ""
            },
            {
              "description": "Optional per-arena alignment floor\nin bytes. When set, the planner uses\n``max(arena_alignment, platform.min_alignment)`` for both\nthe arena base symbol and the per-slot offset of every\ntensor packed into it. When ``None`` (the default), only\nthe implementation floor (16 bytes) is applied to the\narena **base** symbol; per-slot alignment continues to use\n``max(platform.min_alignment, dtype_alignment_floor,\ntensor.alignment_hint)`` so dtype-natural and\nkernel-driven alignment are still honored. Bump\n``arena_alignment`` above the default for memories that\nback DMA-driven hydration paths needing stronger\nalignment than the platform's MVE/Helium floor (e.g.\ncacheline-sized PSRAM transfers).",
              "examples": [],
              "id": "helia_aot.memory.defines.MemoryConstraint.arena_alignment",
              "kind": "attribute",
              "language": "python",
              "members": [],
              "name": "arena_alignment",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "arena_alignment: int | None = Field(default=None, description='Optional per-arena alignment floor in bytes. When set, applied to both the arena base symbol and every slot. When None, only the 16-byte implementation floor applies to the base; per-slot alignment is driven by platform / dtype / tensor hints.')",
              "source": {
                "line": 261,
                "path": "helia_aot/memory/defines.py",
                "url": "https://github.com/AmbiqAI/helia-aot/blob/cf2246a7ad439fa38d57462118e7840e5497a685/helia_aot/memory/defines.py#L261"
              },
              "summary": ""
            }
          ],
          "name": "MemoryConstraint",
          "params": [],
          "raises": [],
          "returns": [],
          "signature": "MemoryConstraint()",
          "source": {
            "line": 236,
            "path": "helia_aot/memory/defines.py",
            "url": "https://github.com/AmbiqAI/helia-aot/blob/cf2246a7ad439fa38d57462118e7840e5497a685/helia_aot/memory/defines.py#L236"
          },
          "summary": "User-defined memory constraint"
        },
        {
          "description": "Top-level memory plan for tensors.\n\nEvery tensor allocation is a slot in some arena. Three arena maps\npartition storage by role:\n\n- :attr:`arena_usages` — writable scratch arenas (one per\n  writable memory bank).\n- :attr:`persistent_arenas` — writable persistent arenas (one\n  per writable memory bank that received a persistent tensor).\n  Separate from scratch so the scratch arena stays purely\n  transient and may be aliased across models.\n- :attr:`constant_arenas` — constant arenas. Two shapes share the\n  same map:\n\n    * **Cold**: ``arena.source_memory == arena.memory``. The\n      arena buffer itself is the read-only blob in cold storage;\n      kernels read it directly. No hydration required.\n    * **Staged**: ``arena.source_memory != arena.memory``. The\n      arena buffer is a writable runtime copy; a separate source\n      blob in ``arena.source_memory`` is hydrated into it before\n      the first ``model_run``.",
          "examples": [],
          "id": "helia_aot.memory.defines.MemoryPlan",
          "kind": "class",
          "language": "python",
          "members": [
            {
              "description": "Tensor\nallocations. Each carries a :class:`TensorBinding`\nrecording ``(role, memory, offset, source_memory)``.",
              "examples": [],
              "id": "helia_aot.memory.defines.MemoryPlan.tensor_allocs",
              "kind": "attribute",
              "language": "python",
              "members": [],
              "name": "tensor_allocs",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "tensor_allocs: dict[str, TensorAllocation] = Field(..., default_factory=dict, description='Tensor allocations')",
              "source": {
                "line": 335,
                "path": "helia_aot/memory/defines.py",
                "url": "https://github.com/AmbiqAI/helia-aot/blob/cf2246a7ad439fa38d57462118e7840e5497a685/helia_aot/memory/defines.py#L335"
              },
              "summary": ""
            },
            {
              "description": "Scratch arenas,\nkeyed by ``MemoryType``.",
              "examples": [],
              "id": "helia_aot.memory.defines.MemoryPlan.arena_usages",
              "kind": "attribute",
              "language": "python",
              "members": [],
              "name": "arena_usages",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "arena_usages: dict[MemoryType, ArenaUsage] = Field(..., default_factory=dict, description='Memory arena usages')",
              "source": {
                "line": 336,
                "path": "helia_aot/memory/defines.py",
                "url": "https://github.com/AmbiqAI/helia-aot/blob/cf2246a7ad439fa38d57462118e7840e5497a685/helia_aot/memory/defines.py#L336"
              },
              "summary": ""
            },
            {
              "description": "Constant\narenas, keyed by *runtime* (destination)\n``MemoryType``. Per-arena single-source-memory invariant\nholds (every constant in the same arena has the same\n``source_memory``) so cold arenas and staged arenas are\nboth guaranteed to be a single contiguous source blob.",
              "examples": [],
              "id": "helia_aot.memory.defines.MemoryPlan.constant_arenas",
              "kind": "attribute",
              "language": "python",
              "members": [],
              "name": "constant_arenas",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "constant_arenas: dict[MemoryType, ArenaUsage] = Field(..., default_factory=dict, description='Per-bank constant arenas (one per runtime memory).')",
              "source": {
                "line": 337,
                "path": "helia_aot/memory/defines.py",
                "url": "https://github.com/AmbiqAI/helia-aot/blob/cf2246a7ad439fa38d57462118e7840e5497a685/helia_aot/memory/defines.py#L337"
              },
              "summary": ""
            },
            {
              "description": "Persistent\narenas, keyed by writable ``MemoryType``.",
              "examples": [],
              "id": "helia_aot.memory.defines.MemoryPlan.persistent_arenas",
              "kind": "attribute",
              "language": "python",
              "members": [],
              "name": "persistent_arenas",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "persistent_arenas: dict[MemoryType, ArenaUsage] = Field(..., default_factory=dict, description='Per-bank persistent (resource-variable) arenas.')",
              "source": {
                "line": 342,
                "path": "helia_aot/memory/defines.py",
                "url": "https://github.com/AmbiqAI/helia-aot/blob/cf2246a7ad439fa38d57462118e7840e5497a685/helia_aot/memory/defines.py#L342"
              },
              "summary": ""
            },
            {
              "description": "Tensor\nlifetimes.",
              "examples": [],
              "id": "helia_aot.memory.defines.MemoryPlan.tensor_lifetimes",
              "kind": "attribute",
              "language": "python",
              "members": [],
              "name": "tensor_lifetimes",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "tensor_lifetimes: dict[TensorId, TensorLifetime] = Field(..., default_factory=dict, description='Tensor lifetimes')",
              "source": {
                "line": 347,
                "path": "helia_aot/memory/defines.py",
                "url": "https://github.com/AmbiqAI/helia-aot/blob/cf2246a7ad439fa38d57462118e7840e5497a685/helia_aot/memory/defines.py#L347"
              },
              "summary": ""
            },
            {
              "description": "Get the allocation metadata for a given tensor ID.",
              "examples": [],
              "id": "helia_aot.memory.defines.MemoryPlan.get_allocation",
              "kind": "method",
              "language": "python",
              "members": [],
              "name": "get_allocation",
              "params": [
                {
                  "description": "The tensor ID to look up.",
                  "name": "tensor_id",
                  "type": "str"
                }
              ],
              "raises": [
                {
                  "description": "If the tensor ID is not found in the allocations.",
                  "type": "KeyError"
                }
              ],
              "returns": [
                {
                  "description": "The allocation metadata for the tensor.",
                  "name": "TensorAllocation",
                  "type": "TensorAllocation"
                }
              ],
              "signature": "get_allocation(tensor_id: str) -> TensorAllocation",
              "source": {
                "line": 349,
                "path": "helia_aot/memory/defines.py",
                "url": "https://github.com/AmbiqAI/helia-aot/blob/cf2246a7ad439fa38d57462118e7840e5497a685/helia_aot/memory/defines.py#L349"
              },
              "summary": "Get the allocation metadata for a given tensor ID."
            }
          ],
          "name": "MemoryPlan",
          "params": [],
          "raises": [],
          "returns": [],
          "signature": "MemoryPlan()",
          "source": {
            "line": 293,
            "path": "helia_aot/memory/defines.py",
            "url": "https://github.com/AmbiqAI/helia-aot/blob/cf2246a7ad439fa38d57462118e7840e5497a685/helia_aot/memory/defines.py#L293"
          },
          "summary": "Top-level memory plan for tensors."
        },
        {
          "description": "Memory planner type\n\nSelecting an experimental planner is an explicit act: the default\nlayout of an existing conversion is unchanged until one is opted\ninto.\n\nAll planners honor user-specified memory-region placement: per-tensor\n``memory`` pins and ``constant_destination_memory`` routing from\n``memory.tensors`` rules, and per-memory ``max_size`` budgets from\n``memory.constraints``. The rules are identical; the outcomes are\nnot necessarily. Unpinned scratch spills to the next writable bank\nwhen the current one fills, so a different visit order can move a\ntensor between banks — an access-latency change, not only a\nfootprint one.",
          "examples": [],
          "id": "helia_aot.memory.defines.MemoryPlannerType",
          "kind": "class",
          "language": "python",
          "members": [
            {
              "description": "First-fit planner in lifetime-start order. The\ndefault, and the only non-experimental strategy.",
              "examples": [],
              "id": "helia_aot.memory.defines.MemoryPlannerType.greedy",
              "kind": "attribute",
              "language": "python",
              "members": [],
              "name": "greedy",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "greedy: str = auto()",
              "source": {
                "line": 393,
                "path": "helia_aot/memory/defines.py",
                "url": "https://github.com/AmbiqAI/helia-aot/blob/cf2246a7ad439fa38d57462118e7840e5497a685/helia_aot/memory/defines.py#L393"
              },
              "summary": ""
            },
            {
              "description": "Experimental, opt-in largest-first offset\npacking; typically a lower scratch high-water mark on models\nwith heterogeneous tensor sizes.",
              "examples": [],
              "id": "helia_aot.memory.defines.MemoryPlannerType.greedy_by_size",
              "kind": "attribute",
              "language": "python",
              "members": [],
              "name": "greedy_by_size",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "greedy_by_size: str = auto()",
              "source": {
                "line": 394,
                "path": "helia_aot/memory/defines.py",
                "url": "https://github.com/AmbiqAI/helia-aot/blob/cf2246a7ad439fa38d57462118e7840e5497a685/helia_aot/memory/defines.py#L394"
              },
              "summary": ""
            },
            {
              "description": "Experimental, opt-in local search over\ngreedy-by-size placement orders; its scratch high-water\nmark is never worse than ``greedy_by_size``. Tunable via\n``memory.planner_options`` (``iterations``, ``seed``,\n``max_stall_iterations``).",
              "examples": [],
              "id": "helia_aot.memory.defines.MemoryPlannerType.hill_climb",
              "kind": "attribute",
              "language": "python",
              "members": [],
              "name": "hill_climb",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "hill_climb: str = auto()",
              "source": {
                "line": 395,
                "path": "helia_aot/memory/defines.py",
                "url": "https://github.com/AmbiqAI/helia-aot/blob/cf2246a7ad439fa38d57462118e7840e5497a685/helia_aot/memory/defines.py#L395"
              },
              "summary": ""
            }
          ],
          "name": "MemoryPlannerType",
          "params": [],
          "raises": [],
          "returns": [],
          "signature": "MemoryPlannerType()",
          "source": {
            "line": 364,
            "path": "helia_aot/memory/defines.py",
            "url": "https://github.com/AmbiqAI/helia-aot/blob/cf2246a7ad439fa38d57462118e7840e5497a685/helia_aot/memory/defines.py#L364"
          },
          "summary": "Memory planner type"
        },
        {
          "description": "This class provides the baseline set of tensor attribute rules.",
          "examples": [],
          "id": "helia_aot.memory.defines.TensorAttributes",
          "kind": "class",
          "language": "python",
          "members": [
            {
              "description": "Memory placement for tensors. For\nconstants this is the **source** (cold-storage) memory\nwhere the tensor's bytes live in the image. When\n``constant_destination_memory`` is set and differs from\n``memory``, the runtime arena lives in that destination\nmemory and a hydration copy is required; otherwise the\narena lives in ``memory`` itself and is read-only (cold).",
              "examples": [],
              "id": "helia_aot.memory.defines.TensorAttributes.memory",
              "kind": "attribute",
              "language": "python",
              "members": [],
              "name": "memory",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "memory: MemoryType = Field(default=MemoryType.DTCM, description='Memory placement for tensors')",
              "source": {
                "line": 421,
                "path": "helia_aot/memory/defines.py",
                "url": "https://github.com/AmbiqAI/helia-aot/blob/cf2246a7ad439fa38d57462118e7840e5497a685/helia_aot/memory/defines.py#L421"
              },
              "summary": ""
            },
            {
              "description": "Override the\nruntime (kernel-visible) memory for a constant. Required\nonly when the runtime memory must differ from the source\nmemory (e.g. weights stored in MRAM but read from\nDTCM/SRAM at runtime). When ``None`` (default), the\nruntime memory equals ``memory`` and no hydration step\nis needed. Must reference a writable memory of the\ntarget platform when set.",
              "examples": [],
              "id": "helia_aot.memory.defines.TensorAttributes.constant_destination_memory",
              "kind": "attribute",
              "language": "python",
              "members": [],
              "name": "constant_destination_memory",
              "params": [],
              "raises": [],
              "returns": [],
              "signature": "constant_destination_memory: MemoryType | None = Field(default=None, description='Per-tensor runtime destination memory for constants. When None (default) the constant is read in place from its source memory; when set the constant is hydrated into a writable arena slot in the destination memory.')",
              "source": {
                "line": 422,
                "path": "helia_aot/memory/defines.py",
                "url": "https://github.com/AmbiqAI/helia-aot/blob/cf2246a7ad439fa38d57462118e7840e5497a685/helia_aot/memory/defines.py#L422"
              },
              "summary": ""
            }
          ],
          "name": "TensorAttributes",
          "params": [],
          "raises": [],
          "returns": [],
          "signature": "TensorAttributes()",
          "source": {
            "line": 398,
            "path": "helia_aot/memory/defines.py",
            "url": "https://github.com/AmbiqAI/helia-aot/blob/cf2246a7ad439fa38d57462118e7840e5497a685/helia_aot/memory/defines.py#L398"
          },
          "summary": "This class provides the baseline set of tensor attribute rules."
        }
      ]
    }
  ],
  "name": "helia_aot"
}
