Struct anira_plan_slot#
-
struct anira_plan_slot#
One tensor slot of one plan: the edge the plan takes for it, its class, the class an allocate_* handle would have gotten, how a completion on that edge is waited for, why the edge is what it is and who moves the bytes, and the role of the tensor, which decides the entries that take the slot. Tier 2, struct_size first; enumerated by anira_plan_report_slots at the caller’s stride (a caller whose header ends before a tail field gets its rows without it). In this pre-release every slot is in host memory: ANIRA_DOMAIN_HOST on both sides, recipe “host”; the edge is ANIRA_EDGE_ZERO_COPY, moved by nobody, where the plan’s engine binds the slot’s buffer in place on a provider that runs over host memory (the CPU path, XNNPACK, ONNX Runtime’s CPU-side execution providers); ANIRA_EDGE_COPY with the reason where the slot is copied inside host memory, by the engine’s adapter (ANIRA_MOVER_ANIRA: LibTorch’s outputs, a memory-planned ExecuTorch output) or by the runtime’s own API (ANIRA_MOVER_ENGINE: a memory-planned ExecuTorch input); and, moved by the engine (ANIRA_MOVER_ENGINE), where a device provider’s runtime moves the slot’s host memory to its device and reads the results back itself (a GPU execution provider, a LiteRT accelerator), the class the memory kind of its device gives (anira_plan_info.memory_kind: ANIRA_EDGE_UNIFIED_TRANSFER on unified memory, ANIRA_EDGE_DEDICATED_TRANSFER on dedicated memory, ANIRA_EDGE_UNKNOWN on unknown memory, the reason saying which, what the probe saw and the slot’s move: an input’s upload, an output’s readback), the class, mover and reason the capability row of the slot’s direction gives that edge.
Public Members
-
uint32_t struct_size#
sizeof(anira_plan_slot) of the caller’s header.
-
uint32_t slot#
The slot: the tensor’s position in the model config’s input list (is_input) or output list. One row per tensor of each list, whatever its role.
-
uint32_t is_input#
1 for an input slot, 0 for an output slot.
-
uint32_t from_domain#
anira_domain: where the data enters the edge, its from end as anira_edge_info names it (the host’s side for an input, the backend’s for an output).
-
uint32_t to_domain#
anira_domain: where the data leaves the edge, its to end (the backend’s side for an input, the host’s for an output).
-
uint32_t edge_class#
anira_edge_class: where the edge taken moves the slot’s bytes.
-
uint32_t allocate_class#
anira_edge_class: the class a handle from anira’s own allocator would get for this slot; equal to edge_class on a slot in host memory, every slot of this pre-release.
-
uint32_t wait_strategy#
anira_wait_strategy: how a completion on this edge is waited for; on a host edge the strategy the core runs, which is the first context’s or session’s (see the file comment of anira/abi/context.h), not necessarily this handler’s context’s request.
-
const char *recipe#
The chain of domains the edge crosses, “host” for a slot in host memory; static storage of the library, valid while the report is.
-
const char *reason#
Why the edge is what it is (who moves the bytes is moved_by), or NULL when there is nothing to say; valid while the report is.
-
uint32_t role#
anira_role of the slot’s spec: what the tensor is to the handler and which entries take the slot. ANIRA_ROLE_STREAMED: the block calls (process, push_data, pop_data, their _multi and _wait forms); ANIRA_ROLE_STATIC: anira_handler_set_static_input / anira_handler_get_static_output or an element of a _multi form; ANIRA_ROLE_STATE: no Hard entry (its position in a _multi array is the empty tensor); ANIRA_ROLE_BUFFER never appears under a Hard contract, which refuses the spec at prepare. The same in every plan of the report: the role is the model config’s, not the plan’s.
-
uint32_t binding#
anira_binding: how this plan bound the slot to the engine’s tensor, by name where the engine’s side has names (the entry’s tensors record, else the canonical name) and by position otherwise, checked against the spec’s shape and dtype at prepare either way; ANIRA_BINDING_ENGINE for a custom engine, which received the names in its load record and bound itself. A tail field: a caller whose header ends before it gets its rows without it.
-
anira_dtype dtype#
The slot’s spec’s dtype: the model tensor’s, what the engine binds and the chunk stores. A tail field: a caller whose header ends before it gets its rows without it.
-
anira_dtype ring_dtype#
The dtype the slot’s ring holds, the host end of a Streamed tensor: the spec’s unless the contract names another (anira_contract_hard_set_ring_dtype), which a converting processor goes with; 0 for a slot without a ring (Static, State). A host tensor of another dtype is refused per call. A tail field: a caller whose header ends before it gets its rows without it.
-
uint32_t moved_by#
anira_mover_flags bits: who executes the slot’s moves, an OR of ANIRA_MOVER_ANIRA where anira’s own code copies the slot (an engine adapter’s copy, what anira counts) and ANIRA_MOVER_ENGINE where the runtime moves it (a copy its own API makes, a device provider’s upload and readback, a registered engine’s code); ANIRA_MOVER_NONE on a zero-copy edge. A tail field: a caller whose header ends before it gets its rows without it.
-
uint32_t window_derived#
1 where the slot’s window was derived, its Streamed spec declaring none (anira_tensor_spec_set_window never called or given (0, 0), a model file without “window”): from a fixed Time extent the window of that extent, from a dynamic one a flexible window pinned to the anchor hop; 0 for a declared window and for a slot without a window. The same in every plan of the report. A tail field: a caller whose header ends before it gets its rows without it.
-
int64_t window#
The window the slot runs at, in elements along its Time axis per inference: a fixed window as it is, a flexible one pinned to the anchor hop from the contract’s host blocks, declared or derived alike (window_derived); 0 for a slot without a window (Static, State). The same in every plan of the report. A tail field: a caller whose header ends before it gets its rows without it.
-
int64_t hop#
The elements along the Time axis the slot advances per inference: its window less the overlap; 0 for a slot without a window. The same in every plan of the report. A tail field: a caller whose header ends before it gets its rows without it.
-
uint32_t struct_size#