Skip to main content

Module program

Module program 

Source
Expand description

A model’s one program. author writes a model’s computation as a LOGOS program, and every backend lowers that program and no other: the CUDA lane compiles its decode step and prefill chunks, the D5005 engine reads its decode step, a spatial chip lowers its embedding, its layers and its head one program each. A backend never grows a model writer of its own, and takes every cut it lowers from this module.

The program a backend lowers is a Cut of it — the decode step over a cache of ctx positions, a prefill chunk of rows tokens, a batch of rows sequences, or one layer, the embedding or the head of any of them — written by Cut::write with the placeholder inputs every backend replaces at run time (each token and position 1, weights named by tensor alone). A cut split over chips is written by written_split. Its Identity is the cut, the chips it is split over, and the SHA-256 of the text author wrote for it; every artifact a backend compiles records it, so an artifact names the exact program it was lowered from, and a program another writer produced cannot pass for this one.

Structs§

Identity
The program an artifact was lowered from: the cut, the chips it is split over (1 when it is not), and the SHA-256 of the LOGOS text author wrote for it.

Enums§

Cut
Which cut of a model’s program a backend lowers.

Functions§

decode_at
Cut::Decode at a run’s own inputs: token tok (from 1) at position pos, its manifest under dir.
prefill_at
Cut::Prefill at a run’s own inputs rather than its placeholders: the chunk of toks (token ids from 1) at positions from pos0, its manifest under dir — the text a run executes. Its identity is the cut’s (written), whose inputs sit at their placeholders.
written
The cut cut of spec’s program, with its identity.
written_in
The cut cut of spec’s program with its weight manifest under dir, and its identity.
written_split
The cut cut of spec’s program split over tp chips with its manifest under dir, and its identity.