Skip to main content

decode_batch

Function decode_batch 

Source
pub fn decode_batch(
    spec: &ModelSpec,
    dir: &str,
    ctx: usize,
    seqs: &[(usize, usize)],
) -> Authored
Expand description

B DECODE STEPS AT ONCE: sequence b brings token tok_b at position pos_b (1-based) and its own carried state, and every sequence emits its own next token. The hidden states are stacked into a B × d matrix and everything that reads a weight runs on the stack; what depends on one sequence’s position or state runs per sequence, on that sequence’s row, exactly as the single step writes it.