Skip to main content

Module bringup

Module bringup 

Source
Expand description

Model bring-up: a checkpoint’s one program, lowered by every chip that runs it.

A model is written once: crate::model::author writes its computation as a LOGOS program from the checkpoint’s own spec, and crate::model::program names each cut of it. A chip is a Backend: it lowers the cuts it runs, writes its artifacts, and names the cut each artifact was lowered from — or refuses the model by name. Adding a model takes no backend code; adding a chip is one more Backend in backends.

bring_up runs a checkpoint through the backends asked for and reports, for each, the programs it lowered or why it refused, beside the identity of the decode step every one of them is a cut of. run_sequences then runs the model on every backend that brought it up and is on this machine, every Sequence it is given — a CPU tier as one generation program built once: the decode step’s own statements in a loop over positions, the weights read once, each sequence’s state declared afresh — each sequence judged by how many of its tokens lead its reference’s (the model’s f64 reference, or a golden’s continuation). A chip that is not here, or whose run is not built yet, says which.

Structs§

Bringup
A checkpoint brought up: its spec, the identity of its decode step (the program every backend’s cuts are cuts of), its text, and each backend asked for with what it made or why it refused.
Brought
What a backend made of a model: the cut of the one program behind every artifact, and the files it wrote.
C
The CPU through C (crate::compile::compile_to_c): the decode step as one C program; a run builds its generation program once, with no contraction of a product and a sum into one fused multiply-add, whose single rounding the VM’s arithmetic never takes, and runs it.
Cuda
The CUDA lane (crate::codegen_cuda::lane): the decode step and its prefill chunks as one fused CUDA program and the sidecar of computed constants it reads.
D5005
The D5005 decode engine (crate::spatial::decode_engine): the step’s program for the engine’s sequencer, the checkpoint held to what the engine’s units read.
Fabric
The spatial fabric the compiler generates for an FPGA: it does not lower a model the author writes yet, and says so.
Generated
What a chip generated for a run’s sequences: their tokens, a list a sequence in their order (ids from 0); the seconds the runs took, not the building of what ran them; what ran them — the chip itself, or the model of it this machine holds; and the program it ran — the generation program a CPU tier built, or the artifact the chip runs.
Jit
The VM with its native tier: the same bytecode, the loops it runs hot compiled to machine code as it runs.
Ran
A backend’s run of one sequence: the tokens it generated after the prompt (ids from 0), the seconds from the prompt to the last token, and what ran them — the chip itself, or the model of it this machine holds.
Reference
What a run is judged against: the tokens it should generate, and where they come from.
Refused
Why a backend does not run a model, by name.
RiscvQemu
RISC-V through its AOT tier (crate::compile::compile_to_riscv): the decode step as RISC-V assembly; a run links its generation program with its runtime (crate::codegen_riscv::runtime) by riscv64-linux-gnu-gcc once and runs it under qemu-riscv64.
Runs
The runs of a model brought up: the prompt, what they are judged against, and each backend that brought the model up with what it generated or why it did not run here.
Rust
The CPU through Rust (crate::compile::compile_to_rust): the decode step as one Rust program; a run stages one project beside the artifacts (crate::compile::compile_to_dir) and builds its generation program into it in release, only its src/main.rs rewritten when the project is already staged, so the runtime crates build once a project.
Sequence
One sequence a run generates: its prompt (token ids from 0), and the tokens it is judged against — as many as it generates.
SequenceRuns
The runs of several sequences: the sequences, and each backend that brought the model up with what it generated for them or why it did not run here.
Sn50
The SambaNova SN50 (crate::spatial::rdu_chip): the decode deployment as one certified program per layer kind, the embedding and the head, bound layer by layer by a manifest — SDK-gated, its placements MODELED.
Vm
The bytecode VM (crate::vm): the decode step compiled to the bytecode it runs, as largo run --interpret compiles it (vm_listing).
Wasm
WebAssembly (crate::compile::compile_to_wasm): the decode step as a module with the host shim largo build --emit wasm writes beside it (crate::web_host::wasm_host_shim); a run executes its generation program’s module under node.

Traits§

Backend
A chip a model’s one program is lowered to.

Functions§

agreeing
How many of ran’s tokens agree with reference’s before the first that does not.
backends
Every chip a model is brought up on, in the order the command line lists them: the CPU tiers, then the accelerators.
bring_up
Bring the checkpoint at checkpoint — a GGUF file, or a Hugging Face directory (config.json beside its safetensors) — up on the backends named in targets (every one when empty), over caches of ctx positions, each backend’s artifacts under out/<name>/ and the model’s program as out/program.lg: the spec read from the checkpoint’s own metadata (bring_up_spec).
bring_up_spec
bring_up for spec, whose weights the checkpoint at checkpoint holds.
run
Run the model b brought up on every backend that brought it up, prompt first, for as many tokens as reference holds, in the order the backends were asked for: run_sequences of the one sequence.
run_sequences
Run the model b brought up on every backend that brought it up, every one of sequences from an empty state, in the order the backends were asked for.