Skip to main content

Module graph

Module graph 

Source
Expand description

The step graph: an authored step (a decode step, a prefill chunk) as the ops it runs and the tensors they touch, each tensor given the role a compiled lane needs to place it.

The graph is the step lifted into the one IR (TensorGraph::lift): every top-level tensor statement is one op, and a statement the front end cannot lift — or a write it cannot account for — is refused by name. A tensor’s role is the IR’s, from how the program uses it:

• a parameter is a tensor the program declares and reads as a position or as row indices (the token, a chunk’s tokens, the position): a compiled step takes it at run time; • state is a declared tensor an op writes in place (a KV cache by Set row, a convolution ring, a delta-rule memory), carried from one step to the next; • a constant is any other declared tensor (weights, norm vectors, rotary tables), which the lane’s binding fills; • an activation is what an op computes.

Re-exports§

pub use crate::tensor_graph::graph::GraphError;
pub use crate::tensor_graph::graph::Role;

Structs§

Op
One op of the step, its operands and result by name.
StepGraph
An authored step as a graph: its tensors in their roles, its ops, and the step as the one IR holds it, which the shared optimizer reads.
Tensor
One tensor of the step: its shape as the program gives it (rows × cols), and its role.