Expand description
Spatial source emission for a VERIFIED SpatialProgram — the RDU’s own front-door language (Spatial,
Koeplinger et al. PLDI 2018; the Plasticine/RDU lineage; the public Spatial → PIR → plastiroute → Tungsten
chain built by scripts/plasticine/). The SpatialProgram twin of codegen_sva::spatial_emit,
which prints a LoopFabric.
Every construct printed is the image of one IR object:
- a tensor is a
DRAM[T], filled on the host from its recorded fill; - a buffer is an
SRAM[T]sized by the page its producer fills (Spatial N-buffers a memory written in one controller and read in the next, so the IR’s depth is recorded beside the declaration rather than spelled), or aFIFO[T]when its edge is aFifohandshake; - a stage is one controller: a Load is a
load(DRAM → SRAM), a Store astore, aMatmulTilesthe row/columnForeachnest around a lane-parallelReducedot product — inside aMemReduceover the K blocks when the IR spills partials through anIntermbuffer — and aGenerican element-wiseForeachwhose reduce axis is aReduce, its operands read through their access maps with an absent axis reading coordinate 0 (the broadcast), exactly asspatial::evalreads them; - the host checks the output’s CHECKSUM against the gold: the spatial oracle’s answer
(
eval_choreographyover the recorded fills) unless the caller hands over the VM’s. The handshake ops (Reserve/Push/Wait/Pop, the accumulator acquire/release, the barriers) have no spelling of their own: Spatial’s compiler derives the buffering and the pipeline from the controller nest, which is why a depth is a comment and not a construct.
What is not spelled is refused BY NAME (SpatialLowerError::Unsupported): multicast groups and Recv
stages, Scalar bodies, the fabric’s fused epilogues, external or vendor-random fills, weight-stationary
dataflow, cross-site handshakes, non-rectangular tile blocks, aliased buffers, sites carrying several
work items. A multi-site program prints as a Parallel of per-site Pipes — spelled, not yet gated
through the chain (the gate runs the single-site RDU GEMM).
Structs§
- Spatial
Check - A slice of a tensor the app checks, element by element, after the accelerator has run:
goldholds the values the caller vouches for (the VM’s) for the row-major elementsoffset..offset + gold.len(). An integer tensor must match exactly; a float one withinrel_tol · max|gold|.
Enums§
- Spatial
Flavor - Which half of the public chain an app is printed for — the two differ only in how a fold is spelled.
Functions§
- emit_
spatial_ program - Emit the Spatial regression app (
@spatial class Logos_<name> extends SpatialTest) for a verified spatial program: every tensor aDRAM[T]filled from its recorded fill, every buffer anSRAM[T]/FIFO[T], every stage one controller, and the host checking the output tensor’s checksum againstgold— the VM’s answer when the caller has it (Show checksumof the output), the spatial oracle’s (eval_choreography) otherwise.targetis the descriptor the program was compiled for (its name is recorded in the header). The harness’sPASS: true (Logos_<name>)line is what the toolchain ledger parses. - emit_
spatial_ program_ checked emit_spatial_programwith the host checking every slice ofchecks— the output, and any activation or carried state the caller holds a gold for — rather than one checksum of the output.- emit_
spatial_ segment - A run of consecutive sections of a composed program, printed as ITS OWN app — the unit PIR can map, since PIR
writes an accelerator as one JVM class and a whole composed program is past what the JVM allows one. The app
holds the tensors the segment’s stages touch, each filled with its value at the segment’s ENTRY; runs the
sections in order; and checks every tensor they store against its value at the segment’s EXIT — exactly for an
integer tensor, within
rel_tol · max|value|for a float one.