Skip to main content

Module rdu_lanes

Module rdu_lanes 

Source
Expand description

The RDU front door’s three lanes — how ANY LOGOS program reaches the SambaNova descriptor.

LOGOS already lowers to RISC-V, C, WASM, CUDA, Tensix, the spatial fabric (the 117-op ISA) and Plasticine. largo emit rdu lowers a program onto the SN40L / SN50 descriptor through ONE of three lanes, chosen by the program’s SHAPE (lane_of) and printed by name:

  • tensor — the program declares a tensor or the tensor recognizer reads a matmul / elementwise / swiglu / fused-row loop nest: the spatial IR front end (pipeline::compile_to_spatial), placed and scheduled on the mesh, the certified neutral placement (lower::rdu).
  • loop (lower_loop_lane) — the first function is a counted range loop with scalar carried state: the Plasticine lane on the RDU mesh descriptor (PlasticineTarget::rdu) — metapipeline II under the Tungsten-calibrated PCU model, checkerboard placement + static routing, the SAT certificate of the routed body, the VM anchor, Spatial source for the public PIR chain.
  • whole-program (lower_whole_program_lane) — everything else the fabric’s decision datapath covers: the first function (if/else, collections on the state plane, structs, enums, helper calls inlined) as a Scalar stage applied lane-wise over an input vector (y[i] = f(x_0[i], …)), or a ## Main of Shows as the tape-select stage (lane i emits Show i) — verified, certified, and handed to RduSpatialBackend as the neutral placement.

What the dataflow lanes REFUSE, by name (never a wrong stage): recursion (the decision front end would otherwise take the first-return path only — a spatial call stack is what it needs; the whole-program call-stack engine runs it ≡VM meanwhile), loops outside the loop lane’s single-stage counted shape, early returns, a Show of Text on the tape, and every op on the fabric frontier (fabric_tile::frontier_reason).

Structs§

LoopLaneArtifact
What the loop lane hands largo emit rdu: the Plasticine artifact of the first function on the RDU mesh descriptor, with its pieces rendered — the placement, the modeled report row, the Spatial source, the certificate summary bound to the certificate by its digest, and the text an engineer reads first.

Enums§

RduLane
Which lane a program takes — a function of its shape, printed by largo emit rdu as lane: <name>.

Constants§

WHOLE_PROGRAM_LANES
The lanes an input vector of the whole-program lane carries: four PCUs’ worth of the unit model’s sixteen SIMD lanes — enough to exercise every path of a decision body at the VM anchor’s sample inputs.

Functions§

anchor_params
The VM anchor’s sample inputs for a function of arity parameters: small, distinct, positive — the same samples compile_to_plasticine anchors on.
first_function
The first function source itself declares — the unit the loop and whole-program lanes lower — as (name, arity); None for a ## Main-only program or one that does not parse. A prelude module spliced in by demand (own_function_names) is never the unit.
has_tensor_sugar
Whether source declares a tensor — Let X be a R by C tensor of …, the tensor sugar’s own opening (the parser’s try_parse_tensor_new), read off the text so the lane is known before any op is recognized.
lane_of
The lane source takes: tensor when it declares a tensor or a tensor op is recognized; loop when its first function is the counted range loop the metapipeline model takes; whole-program otherwise (a source that does not parse falls there too — its lowering reports the parse error typed).
lower_loop_lane
Lower the first function of source — a counted range loop — onto chip’s mesh descriptor through the Plasticine lane, anchored to the VM at anchor_params. A program whose first function is not that loop is refused with the lane’s own reason.
lower_whole_program_lane
Lower source onto chip through the whole-program lane: the first function as a Scalar stage over WHOLE_PROGRAM_LANES-lane input vectors, or a ## Main of Shows as the tape-select stage; the program is run through the pinned passes to Verified (with its choreography certificate and the per-PE certificate where the body is ALU + select). Every shape the dataflow lane cannot carry is refused by name.
recognizes_a_tensor_op
Whether the tensor recognizer reads a matmul / elementwise / swiglu / fused-row loop nest in source (the plain-loop tensor programs the spatial front end lowers without sugar).
sample
Lane i of parameter k’s sample vector: the anchor value on lane 0, then a deterministic spread of small signed integers around it (every path of a decision body sees both signs and a run of magnitudes).
vm_anchor
The lane’s VM anchor for a function unit: fn_name(args) shown by the VM, Main replaced.
whole_program_inputs
The lane’s input vectors for a program the whole-program lane produced, so a caller can run it: for a function unit, anchor_params-seeded samples per parameter; for the tape, the Show indices.