Skip to main content

Module handoff

Module handoff 

Source
Expand description

What one chip hands another when they share a model’s work.

A prompt prefilled on one chip and decoded on another — a GPU’s prefill handed to an RDU’s decode, as SambaNova serves MiniMax, or the reverse — and a model whose layers are split over two chips meet at the same place: the state a decode step carries from one token to the next. Every attention layer’s key and value cache, every gated-delta layer’s memory and conv rings: the tensors the step reads and writes back in place, less those it assembles whole (carried_state).

★ THE CONTRACT IS THE AUTHOR’S. Every backend lowers the one program model::author writes, and that program declares each carried tensor once, by name and shape. The prefill program declares the same tensors the decode program reads, so the hand-off is those tensors’ values, row-major as declared — whatever tiles, pages or arenas a backend lays them out in, it reads and writes this logical order at its edge. contract reads the declarations off the decode step’s layer programs; a bundle’s manifest states it, so a host on either side knows what to send; Contract::check refuses a hand-off that does not match it, by name.

Structs§

Carried
One tensor a decode step carries: its name in the authored programs, the layer it belongs to, and its declared shape.
Contract
The state a model’s decode step carries over a cache of ctx positions, layer by layer.
Handoff
A prompt’s state after position tokens: each carried tensor’s values by name, row-major as declared.

Enums§

HandoffError
Why a hand-off does not meet its contract, or why a model has none.

Functions§

contract
The carried state of spec’s decode step over ctx positions: every layer’s, in layer order and, within a layer, in the order its program first touches it.