Skip to content

Additional kernels & improved color reuse & multi-hop routing - #68

Open
luxfg wants to merge 64 commits into
mainfrom
lux/additional-kernels
Open

Additional kernels & improved color reuse & multi-hop routing#68
luxfg wants to merge 64 commits into
mainfrom
lux/additional-kernels

Conversation

@luxfg

@luxfg luxfg commented Aug 17, 2026

Copy link
Copy Markdown
Collaborator

Summary

Compiler and sample work to pack more communication onto fewer colors, recycle task IDs across epochs, and run new kernels on WSE-2 and WSE-3.

Routing and color reuse

  • Bundle overlapping 1D interval shifts onto one color: nearest-destination-first send order, local switch-advance at each source, and counter filters at destinations (detect_shift_bundles; documented in irspec/docs/spatial/routing_wse.md).
  • Collapse and emit switch configurations (FilterConfig, standalone routes) instead of a per-hop switch-advance wavelet. WSE-2 local flips use .advance_switch on the last data wavelet; WSE-3 emits SWITCH_ADV.
  • Assign fabric input/output queues by occupancy span so a color keeps its queue across a gap. Two colors share a queue only when their spans do not overlap (WSE-2). WSE-3 binds a queue to its color for the whole kernel and does not remap.
  • On WSE-3, assign microthreads (.ut_id) independently of queues so an input and an output of the same number can run together.
  • Reject statically overlapping compute and dataflow rectangles in one phase at compile time.

Task IDs

  • Recycle local-task IDs when tasks are ordered, and bind data tasks that share a color to one hardware slot with a rebind between epochs.
  • WSE-3: @get_data_task_id takes the fabin input queue, not a color. Program queues are 2–7 (memcpy owns 0 and 1). Local-task allocation skips memcpy-reserved IDs, including WSE-3’s color-21 LOCAL_MEMCPYD2H_DATA hole.
  • Runtime memcpy path supports 16-bit payloads.

Samples

  • Sparse matrix–vector (samples/spatial/blas/spmv.sptl).
  • Batcher odd-even sort, static, bundled, and WSE-3 origin-pooled, generalized to K keys per PE and R independent rows (samples/spatial/sort/).
  • Looped odd-even transposition sort on four static neighbour channels (odd_even_sort_1D_looped.sptl).
  • 2D shearsort on eight static neighbour channels (shearsort_2D_looped.sptl, WSE-3; four inbound colours in one epoch).
  • Shift and exchange bundle microkernels (samples/spatial/simple/).

tbennun and others added 29 commits August 12, 2026 21:46
Establishes the hardware contract the shift-bundle lowering will rely on, after
the per-hop SWITCH_ADV payload turned out to be inert in slots 1-7: senders hand
their router over in descending send order, triggered by a wavelet they emit
themselves, and statically routed receivers use a counter filter to pick out the
block addressed to them.

Also pins the filter arithmetic, which the manual describes ambiguously: a
wavelet reaches the compute element iff counter <= max_counter, counting modulo
limit1 + 1 from init_counter.
Takes the stream-bounds routing and emission layer wholesale. Its RouteConfig /
ColorSwitchPlan model supersedes the private _emit_shift_schedules path this
branch grew, which drove switches with a hop-indexed SWITCH_ADV payload that the
hardware ignores past slot 0.

The shift-bundle detector survives but is unwired for now; the tests that cover
the old emitter fail until it is reconnected to ColorSwitchPlan.
@luxfg luxfg changed the title Additional kernels Additional kernels & improved color reuse & multi-hop routing Aug 18, 2026
@luxfg
luxfg marked this pull request as ready for review August 20, 2026 09:04
@luxfg
luxfg requested a review from tbennun August 25, 2026 20:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants