{
  "$schema": "https://ambiqai.github.io/helia-ui/schema/reference-model-1.json",
  "generatedFrom": {
    "sourceCommit": "aee921f9f6ddb72ad858bd66859e225a41d53074",
    "tool": "pyref",
    "version": "1.7.3"
  },
  "language": "python",
  "modules": [
    {
      "description": "",
      "name": "MemoryPlan",
      "path": "helia_aot.memory.defines.MemoryPlan",
      "submodules": [],
      "summary": "",
      "symbols": [
        {
          "description": "Top-level memory plan for tensors.\n\nProvisional: importable, but outside the compatibility promise; a minor release can change or remove it.\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": 419,
                "path": "helia_aot/memory/defines.py",
                "url": "https://github.com/AmbiqAI/helia-aot/blob/aee921f9f6ddb72ad858bd66859e225a41d53074/helia_aot/memory/defines.py#L419"
              },
              "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": 420,
                "path": "helia_aot/memory/defines.py",
                "url": "https://github.com/AmbiqAI/helia-aot/blob/aee921f9f6ddb72ad858bd66859e225a41d53074/helia_aot/memory/defines.py#L420"
              },
              "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": 421,
                "path": "helia_aot/memory/defines.py",
                "url": "https://github.com/AmbiqAI/helia-aot/blob/aee921f9f6ddb72ad858bd66859e225a41d53074/helia_aot/memory/defines.py#L421"
              },
              "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": 426,
                "path": "helia_aot/memory/defines.py",
                "url": "https://github.com/AmbiqAI/helia-aot/blob/aee921f9f6ddb72ad858bd66859e225a41d53074/helia_aot/memory/defines.py#L426"
              },
              "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": 431,
                "path": "helia_aot/memory/defines.py",
                "url": "https://github.com/AmbiqAI/helia-aot/blob/aee921f9f6ddb72ad858bd66859e225a41d53074/helia_aot/memory/defines.py#L431"
              },
              "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": 433,
                "path": "helia_aot/memory/defines.py",
                "url": "https://github.com/AmbiqAI/helia-aot/blob/aee921f9f6ddb72ad858bd66859e225a41d53074/helia_aot/memory/defines.py#L433"
              },
              "summary": "Get the allocation metadata for a given tensor ID."
            }
          ],
          "name": "MemoryPlan",
          "params": [],
          "raises": [],
          "returns": [],
          "signature": "MemoryPlan()",
          "source": {
            "line": 377,
            "path": "helia_aot/memory/defines.py",
            "url": "https://github.com/AmbiqAI/helia-aot/blob/aee921f9f6ddb72ad858bd66859e225a41d53074/helia_aot/memory/defines.py#L377"
          },
          "summary": "Top-level memory plan for tensors."
        }
      ]
    }
  ],
  "name": "helia_aot"
}
