Expand description
compose — N verified sections become ONE SpatialProgram: the persistent-decoder form.
★ THE UNIT OF LOWERING IS A SECTION; THE UNIT OF DEPLOYMENT IS A PROGRAM. Each section arrives here
already tiled, placed, sized, scheduled and verified on its own — which is what makes each one
checkable — and this pass joins them without re-deriving any of it: ids are offset, tensors are
unified BY NAME, engine programs are concatenated per (site, engine) in section order, and every
boundary gets a rendezvous every engine passes through. What was Output in one section and Input
in a later one becomes an Activation; what the front end named as carried becomes State.
★ WHAT THE BARRIER BUYS, AND WHY NOTHING CHEAPER WORKS. Concatenating per engine already orders a
section against the next ON THAT ENGINE. It says nothing across engines: the movement engine that
loads section k+1’s operand runs concurrently with the one that stores section k’s result, and
without a rendezvous it will read the tensor before it is written. For an activation that is a
ReadOutOfRange — loud. For carried state it is last token’s value — silent, and plausible. So the
barrier is not an optimization knob; it is the thing that makes the composition mean anything.
★ THE RENDEZVOUS IS A GATHER AND A RELEASE. Every one of the P participating programs posts one
arrival at the root (the first participant in site order); the root waits for all P, posts one
release at each of the S participating sites, and every program waits for its own site’s release.
That is 2P + S + 1 ops and P + S marked-graph places per boundary, where posting every arrival at
every site would be P·S of each — the difference between a real-width layer’s certificate being
its sections’ size and being ten times it. spatial_rendezvous_lock pins the shape and breaks each
of its ops to show the IR refuses the result.
Enums§
- Compose
Reject - Where the composer refuses — always by name, never by dropping a section.
- Section
Placement - How the sections are spread over the mesh.
Functions§
- compose
- Join verified sections into one program.
- compose_
phased composewith the barriers named:barrier_after[k]closes sectionkwith a rendezvous, and a section left open runs CONCURRENTLY with the one after it — sections on disjoint chips with no data between them, a phase of a tensor-parallel step.Nonecloses every section but the last.- separate_
phase_ memory - ★ A PHASE’S SECTIONS RUN AT ONCE, SO THEY DO NOT SHARE A BYTE. Each section lays its buffers out over its sites’ local memory from the same base; sections a barrier separates reuse those bytes, sections of one phase may not. A section of a phase that shares a site with an earlier one of the phase has its buffers there moved past the earlier ones’ (per memory space) — sections on disjoint sites keep their layout. Returns the highest byte any site now uses, for the caller to hold against the site’s memory.