Skip to main content

emit_forward

Function emit_forward 

Source
pub fn emit_forward(
    graph: &TensorGraph,
    inits: &HashMap<String, Vec<(usize, InitVal)>>,
    weights: &HashMap<String, (String, usize)>,
    q8: &HashMap<String, Q8Ref>,
    moe: &HashMap<String, MoeWeights>,
    kind: Q8MatKind,
    interner: &Interner,
) -> Result<String, ForwardError>
Expand description

Emit the composed CUDA program for a forward’s graph (forward_graph): one uniquely-named kernel per stage plus a host driver that allocates a buffer per variable, fills the inputs v[p] = (p % 7) - 3 (float chains scale by 0.5), launches each stage in order, and prints every element of the final stage’s output. Deterministic, self-contained, nvcc-compilable; its output is checked against a clean-room reference of the same graph.