Technical report · single-core geometry vs. parallel geometry
Depth, wire-depth & energy under the simplified Dally model — and how they compare to the spatial computer
We analyze the algorithms of Gianinazzi et al.'s spatial computer
paper (broadcast, reduce, scan, rank selection, sorting, cubic and Strassen matrix multiplication — plus FFT
as a bonus) under the simplified
explicit-communication model of the simplified-dally-model repo: a single core, memory in the
upper half-plane, reads priced at Manhattan distance, writes and arithmetic free. For each algorithm we derive
energy, work, depth, and wire-depth, then set the results against the spatial computer's published bounds.
The bounds were derived by four parallel analyses (one per problem group), cross-checked at their overlaps and
against a separate adversarial verification pass; derivation sketches are included so the results can be checked.
§1 · Setup
Two ways to charge for distance
Both models take Bill Dally's position seriously: the dominant cost of computation is moving data,
and movement should be priced by physical (Manhattan) distance. They differ in what the machine looks like.
Model A — simplified Dally model (single core)
One sequential core at the origin. Memory cells indexed 1, 2, 3, … fill the upper
half-plane; cell i sits at Manhattan distance ⌈√i⌉ (the cells at distance
k form a diagonal shell of 2k−1 cells; k² cells lie within
distance k). Programs are three-address code op dest,src1,src2. Reads are
priced at the source cell's distance; writes and arithmetic are free; the core keeps no state between
instructions. The caller chooses where inputs and outputs live and reads each output cell once at the end; this
report adopts the compact prefix 1..n for inputs — any other placement only raises costs.
Model B — spatial computer (Gianinazzi et al., arXiv 2205.04934)
An unbounded 2-D grid of processors, each with constant memory; in each synchronous step a processor may
send one word-sized message to any other processor at energy cost = Manhattan distance. Metrics:
energy E (total distance of all messages), depth D (longest chain of consecutively dependent
messages), wire-depth Dw (largest total distance along a dependency chain). An input of
n words lives on a √n×√n subgrid, one word per processor.
The comparison is fair in a way worth stating: for an input of n words, both machines occupy
Θ(n) silicon area and both charge one unit of energy per word per unit of Manhattan distance. Model A is
"all that area is passive memory, one core computes"; Model B is "every cell of that area is a tiny
processor." The bounds below quantify exactly what that architectural choice buys — and what it doesn't.
Model A's memory geometry
Cell i at Manhattan distance ⌈√i⌉ from the core; shells of 2k−1 cells; the first 16 cells shown (cf. the repo's figure)
§4 · Derivations
Where each bound comes from
A1Broadcast
Dally Θ(n) vs spatial Θ(n) — but for opposite reasons
One copy destj, 1 per destination: n instructions, each paying a single
distance-1 read of cell 1; destinations are written free. E = n exactly (lower bound: three-address
code writes one cell per instruction, and since the core keeps no state, each write of a runtime value
must read some cell holding it, at distance ≥ 1 — immediates like the instruction set's set
can't produce a value known only at run time). All copies are independent:
D = Dw = 1. This is a model artifact: free writes mean fan-out costs nothing and the value
"teleports" — Model A charges the Θ(n3/2) only if the caller later reads the n copies. The spatial
computer charges the movement honestly (Θ(n) energy through a recursive quadrant tree) and its wire-depth
Ω(√n) records the physical fact that the value must travel to the far corner. Dally's actual CACM position
prices all transport; the simplification "writes are free" is what breaks the symmetry here.
Spatial E / D / Dw
Θ(n) / O(log n) / O(√n)
A2Reduce
the cleanest √n separation
Fold is exactly optimal. Keep the accumulator in cell 1; execute add 1,1,i for
i = 2..n at cost 1 + ⌈√i⌉ each: E = S(n) + n − 2. Matching lower bound: every input must be read once from its
resident cell (that's S(n)), and any n-to-1 computation needs ≥ n−1 binary instructions whose remaining n−2
operand reads cost ≥ 1 each. Curiously the balanced tree — optimal in every parallel model — is
worse here: with level-ℓ partials compacted into cells 1..n/2ℓ, its per-level read costs form
the series (2/3)n3/2·Σ2−3ℓ/2, totalling ≈1.03n3/2 ≈ 1.55× fold. The tree's
payoff is latency: D = ⌈log₂n⌉ and Dw ≤ (2+√2)√n ≈ 3.4√n (a geometric distance series along any
leaf-to-root chain), versus fold's chain that passes every read (D = n−1, Dw ≈ (2/3)n3/2).
Spatial computer: Θ(n) energy — the grid sums in place; nothing ever travels farther than its
quadrant. Verdict: turning memory into processors buys a full √n factor of energy on aggregation, the
single strongest separation in this report. Worked instance (n = 16): Dally E = 50+16−2+1 = 65 including the
output read; the spatial reduce on a 4×4 grid spends exactly 24.
Dally D / Dw
⌈log₂n⌉ / ≈3.4√n
Spatial E / D / Dw
Θ(n) / O(log n) / O(√n)
A3Scan (prefix sums)
same story as reduce, plus an output subtlety
Running sum with the accumulator in cell 1, writing prefix i back into the just-freed cell i (dead the
moment it was read): E = S(n) + 2n + O(1) excluding output reads (the O(1) covers preserving prefix₁ before the
accumulator overwrites cell 1) — and the caller's n output reads add exactly one
more S(n), for (4/3)n3/2 total, which a matching two-part lower bound (algorithm reads ≥ S(n);
caller reads n distinct cells ≥ S(n)) shows is tight to leading order. A pitfall our analysis flagged: writing
prefix i directly to cell i inside the add (add i,1,i-style) forces the next
step to re-read the running sum from distance ⌈√i⌉ and doubles the constant. For latency, a Blelloch up/down
sweep with temporaries compacted into shrinking near-core blocks gives D = 2⌈log₂n⌉+O(1) and
Dw = Θ(√n) at a 2–4× energy premium. Spatial: Θ(n) via the Z-order quadrant tree — again the
√n separation, again because partial sums never leave their quadrants.
Dally E (incl. out)
(4/3)n3/2 tight
Dally D / Dw
O(log n) / Θ(√n)
Spatial E / D / Dw
Θ(n) / O(log n) / O(√n)
A4Rank selection (median)
sampling cannot save the single core
In the spatial paper, selection is the marquee result: Θ(n) energy, polynomially below the
Ω(n3/2) sorting floor, because two sampled pivots let most elements be discarded in place —
they are inspected locally but never shipped anywhere. Model A enjoys no such escape: the adversary argument
forces every cell to be read (an unread element could straddle the rank-k answer), so
E ≥ S(n) = (2/3)n3/2. That floor is achievable — a Floyd–Rivest-style algorithm reads a
~n2/3 sample (≤ n7/6 cost), selects two pivots, does one partition pass that compacts the
O(n2/3log n) survivors into the freed near-core cells (free writes!), and recurses — for expected
E = (2/3)n3/2(1+o(1)), touch-optimal including the constant (deterministic median-of-medians stays
Θ(n3/2)). The punchline: the spatial computer's cleverest energy win survives only because its
compute is co-located with its data; move the same idea to a single core and geometry claws back the whole
√n factor. DAG metrics: D = O(log² n) whp, Dw = Θ(√n) whp (geometrically shrinking survivor sets).
Dally D / Dw
O(log²n) / Θ(√n) whp
Spatial E / D / Dw
Θ(n) / O(log²n) / O(√n)
A5Sorting
the tie: Θ(n3/2) in both models
Upper bound, and it is flat. R-way mergesort with R = log²n and one crucial discipline: never recurse on
far-resident data — copy each run into the compact prefix first (that copy is the level's touch pass),
sort there, park the sorted run high (writes free), then R-way merge with a heap kept in the first O(R) cells
(heap reads cost O(√R) = O(log n) each). The recurrence
S(m) = R·S(m/R) + (4√2/3)m3/2 + O(m√R·log R) has level costs decaying like
1/log n per level — summing to (4√2/3)n3/2(1+o(1)) ≈ 1.89n3/2, no log, no log log.
(The 4√2/3 constant is for this particular layout — runs parked in cells m+1..2m; other natural accountings land
between ≈1.2 and ≈2.4·n3/2. The flat-Θ conclusion is layout-independent.)
(Contrast: classic full-pass 2-way mergesort re-touches all n words every pass: Θ(n3/2log n).)
Lower bound: touch, Ω(n3/2); the comparison term 2n·log₂n only matters below n ≈ 850.
Spatial: Θ(n3/2) as well — there it is the permutation bound (elements must
physically cross the grid), matched by 2-D mergesort. So the two models agree on sorting's energy for
genuinely different reasons: Model A pays to see the data, Model B pays to move it. All that
parallelism buys is time: depth O(log³n) versus a serial machine's Θ(n log n) instructions. One more Model A
wrinkle: energy and depth resist joint optimization — bitonic gets D = O(log²n) but re-touches everything each
stage (E = Θ(n3/2log²n)), while the E-optimal mergesort is nearly serial.
Dally D / Dw (bitonic)
O(log²n) / O(√n log²n)
Spatial E / D / Dw
Θ(n3/2) / O(log³n) / O(√n)
A6Matrix multiplication — cubic DAG
a real Θ(log n) penalty for classical matmul
n×n matrices, 2n² input words in cells 1..2n² (so distances reach √2·n and the touch bound is
(4√2/3)n³ ≈ 1.89n³). Upper: cache-oblivious recursive blocking with copy-in — a call on b×b blocks
copies operand sub-blocks into a compact child region (O(b²) reads at distance O(b)), recurses 8-fold,
re-reads partials for the 4 block-additions: M(b) = 8M(b/2) + Θ(b³). Every one of the
log₂n levels costs Θ(n³): M(n) = Θ(n³ log n). (Naive triple loop: Θ(n⁴); one-level √n-blocking:
Θ(n3.5); the full recursion is what removes the polynomial penalty.) Lower, and this is the
technical heart of the report: a Hong–Kung/red–blue argument adapted to free writes — phases of 2S loads;
Loomis–Whitney bounds each phase's multiply-adds by O(S3/2) once free-stored partial sums that are
later reused are charged to the future loads that bring them back (free stores alone would otherwise
let a phase touch unboundedly many C-entries) — yields a loads-only bound Q(S) = Ω(n³/√S) for
S ≤ n²/81, assuming no recomputation of product terms. Setting S = d² (the cells within
distance d) and summing over dyadic d: each of the ~log₂n scales contributes Ω(n³) of read cost, so
E = Ω(n³ log n). The recursion is optimal; the log n gap to the spatial computer's Cannon (Θ(n³),
in-place systolic shifts, no hierarchy to traverse) is real for the cubic DAG (under the standard
no-recomputation assumption of I/O lower bounds).
Dally D / Dw
Θ(log n) / Θ(n)
Spatial (Cannon)
Θ(n³) / Θ(n) / Θ(n)
A7Matrix multiplication — Strassen
the inversion: Strassen wins in Model A, Cannon wins in Model B
Run Strassen with the same copy-in discipline (operands of a size-b call held compactly at distance O(b);
the 7 operand combinations formed one at a time — sequential execution lets scratch be reused, so the
working set stays O(b²)): ST(b) = 7·ST(b/2) + Θ(b³). Because 7 < 8, the level costs
now decay geometrically — (7/8)ℓ — and the top level dominates:
ST(n) = Θ(n³), touch-optimal (any matmul must read its 2n² inputs: Ω(n³)). Two remarkable consequences.
(i) In Model A, Strassen beats classical matmul by a genuine Θ(log n) factor of energy — not by
its exponent. Its n2.807 work advantage shows up in W, but the reads, not the arithmetic, are the
currency. (ii) The ranking inverts between models. Spatial computer: Cannon is energy-optimal
at Θ(n³) and the Strassen-based S3MM pays O(n³√log n) — recursion forces data off the home subgrid, and the
paper buys depth (O(n0.861) vs Θ(n)) with that energy. Model A: the recursion is free
lunch — it matches the geometry of the memory hierarchy — and Strassen is the optimum. Same algorithm, same
distance pricing, opposite verdicts, purely because of where the compute sits.
Dally D / Dw
Θ(log n) / Θ(n)
Spatial (S3MM)
O(n³√log n) / O(n0.861) / O(n√log n)
A8FFT (bonus)
touch-optimal via the four-step schedule
The four-step (Bailey) schedule — view n = m² points as an m×m matrix; column FFTs, twiddles, row FFTs — with
each sub-FFT compacted into a near-core prefix gives
F(n) = 2√n·F(√n) + Θ(n3/2), whose recursive term is only Θ(n5/4):
the top level dominates and F(n) = Θ(n3/2) ≈ 2n3/2 including output reads — no
log log, no log, unlike sorting's near-miss. A Hong–Kung cross-check is satisfying: the FFT I/O bound
Q(S) = Ω(n log n / log S) summed over dyadic distances has its log exactly cancelled by log S at
S ≈ n, confirming Ω(n3/2) with no slack. The spatial paper doesn't treat FFT; its PRAM-simulation
theorem gives O(n3/2log n) generically, and a direct four-step schedule on the grid should give
O(n3/2) energy (transposes are permutations at Θ(n3/2) each, O(1) of them at the top
level) — we flag that as our sketch, not a published bound.
Dally D / Dw
Θ(log n) / ≈3√n