Expand description
from_tensor_op — a recognized tensor op becomes a TEMPLATE spatial program (phase Template): the
tensors, the four stages, three double-buffered FIFOs, and one work item per output tile. The numerics are
chosen HERE from the target’s matrix engine and the recognized fills, and the exactness claim is derived,
never assumed: an Int source on a float-primary engine rides as bf16 operands with an fp32 accumulator and
is claimed exact only while every partial sum fits fp32’s mantissa.
Structs§
- Elementwise
Names - Names of an elementwise op’s tensors (from the source).
- Fused
RowFills - Fused
RowNames - Matmul
Names - The source-level names of a matmul’s tensors.
- SwiGlu
Names - Template
- A template under construction: tensors, stages, buffers and local hand-off edges, in id order.
Functions§
- choose_
matmul_ numerics - The chosen numerics of a matmul on a target, from each operand’s largest magnitude:
(operand, accumulator, output, claim). An operand bounded byblies in[−b, b](choose_matmul_numerics_ranged). - choose_
matmul_ numerics_ ranged - The chosen numerics of a matmul on a target, from each operand’s range
[lo, hi]:(operand, accumulator, output, claim). An integer operand is the narrowest two’s-complement width that holds both ranges — an int8 activation clamped to[−128, 127]is int8 — and the claim is exact whilekproducts of the operands’ extremes fit the accumulator. - const_
map - A map constant in both axes — a scalar tile, which is what Tensix’s
reduce_tilewants as its scaler operand. - elementwise_
float - The float precision the target’s ELEMENTWISE datapath offers, widest first — the one a composition carries its activations in (bf16 on the RDU’s witnessed envelope).
- elementwise_
int - The integer precision the target’s ELEMENTWISE datapath offers, widest first — the one an integer model’s
tensors are carried in: an
Intis the VM’s 64-bit integer, so the widest the part has is the closest to it. - from_
elementwise C[p] = A[p] ⊕ B[p]over a flat length: integer datapath where the target has one, fp32 otherwise.- from_
elementwise_ with - The same, told whether the operands are float even when neither carries a recognized fill — which is every activation inside a composition. Without it a target that offers an integer elementwise datapath would take it for a pair of tensors that hold bf16 model activations.
- from_
fused_ block - A fused transformer block (matmul → requant → bias → relu) as ONE fused compute chain inside the scalar datapath’s fusion window, intermediates streaming through local hand-offs.
- from_
fused_ row - from_
matmul - Lift a recognized matmul to a template spatial program on
target. - from_
pipe - ★ A RECOGNIZED PRODUCER/CONSUMER PIPE, AS SPATIAL IR — the template that retires
codegen_tt::concurrency_mesh’s hand-written two-core program. - from_
scalar_ body - A decision fabric (an if-converted scalar body) as a
Scalarstage applied element-wise over ann-element input vector:y[i] = f(x[i]). - from_
swiglu - from_
swiglu_ shaped from_swigluover the program’s(rows, cols)— SwiGLU is pointwise, so a matrix is mapped tile by tile in the tiling the matmuls on either side of it use.- from_
systolic - A weight-stationary systolic tile as a spatial program:
O(m×n) = A(m×k)·W(k×n), the weights baked into aParamtensor, the compute stage carrying the weight-stationary policy. - ident_
map - The identity map over a page
widthelements wide: the operand is walked along both axes,[(row, width), (col, 1)]— a row step is a page width because the offset is FLAT. - init_of
- local_
handshake - The same-site hand-off primitive a target offers: a FIFO where it has one, else valid/ready.
The handshake a target provides for a same-site bounded hand-off. A template always says
Fifo(the abstract bounded buffer between a producer and its consumer);synthesize_handshakesretypes those edges to this kind, so the template is the same value on every target and the target enters only through passes. - operand_
bits - Operand bit width for the integer reference (
Nonefor float operands). - page_
width - The page WIDTH in elements a stage’s operand is read through — the row stride of every flat map
over that buffer. A
Genericpage is a strip ofpage_tilestiles, so the width is fixed the moment the buffer is; the passes that re-page (apply_plan) touch matmul chains only. - per_
col_ map - A map that OMITS the row axis — one value per column, constant down the rows (a weight, a bias).
- per_
row_ map - A map that OMITS the column axis — one scalar per row, constant along the row. This is a broadcast, and it is spelled as a missing term rather than as an operator.