-
Notifications
You must be signed in to change notification settings - Fork 0
Execution Model
Sulkysubject37 edited this page Jan 21, 2026
·
2 revisions
Purpose: Explains the immutable and static nature of the execution pipeline.
VECTORIA employs a strict Compile-Schedule-Execute lifecycle. Once a graph is compiled, its structure and memory footprint are frozen.
The graph is defined using immutable structures:
-
Graph: A collection of
Nodes andNodeIdoutputs. -
Node: A variant of
InputNode,ParameterNode, orOpNode. -
OpType: A strictly typed enum (e.g.,
MatMul,Add,Relu,Transpose,Concat,Attention).
Once constructed, the Graph object is treated as a read-only specification by the Engine.
During Engine::compile(), the system:
- Validates the topology (checks for cycles and invalid inputs).
-
Linearizes the graph into a fixed execution
schedule_(std::vector<size_t>). - Calculates the exact memory requirement for every tensor.
Memory is managed by a linear Arena allocator.
-
Allocation: All necessary memory is allocated in a single block during
compile(). -
Addressing: Each node is assigned a fixed pointer (
node_buffers_[i]) into this arena. -
Lifecycle: Memory persists for the lifetime of the
Engineand is reset only upon recompilation. This eliminates runtime allocation overhead and fragmentation.
The execute() method simply iterates through the pre-computed schedule_:
[Start] -> [Fetch Node] -> [Resolve Inputs from Arena] -> [Dispatch Kernel] -> [Write Output to Arena] -> [Next Node]
core/include/vectoria/ir.hppcore/src/engine.cppcore/src/memory.cpp