Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
1f560fe
Bounded stream and `stream.close` specification
tbennun Aug 13, 2026
8661271
Language support for `stream.close()`
tbennun Aug 13, 2026
97ac129
Analysis and optimization passes
tbennun Aug 13, 2026
f5e99b0
Implement code generation and switch planning/collapsing
tbennun Aug 13, 2026
8d1326e
Refactor routing into a separate file
tbennun Aug 13, 2026
99a8e7f
Add end-to-end tests
tbennun Aug 13, 2026
586dc94
Type hint fixes
tbennun Aug 13, 2026
49d243d
Fix switch advance for WSE2 and test on simulator
tbennun Aug 14, 2026
505b88f
1D bitonic sorting network sample and inter-phase stream numbering pa…
tbennun Aug 14, 2026
7a13d61
Initial spmv, 1D batcher sort
luxfg Aug 17, 2026
cf6d0a3
Initial draft of bundles optimization
luxfg Aug 17, 2026
554c852
draft switch advances
luxfg Aug 17, 2026
04c05fa
Factor out DSD detection so that streams in loops can be detected
tbennun Aug 17, 2026
a7e7c69
fix spmv example
luxfg Aug 17, 2026
3f29a51
add shift bundle test, fix shift bundling
luxfg Aug 17, 2026
f2d0b1c
Prototype the counted switch in hand-written CSL
luxfg Aug 17, 2026
30a6c49
Merge stream-bounds, dropping the per-hop switch-advance emitter
luxfg Aug 17, 2026
127183e
new bundling draft
luxfg Aug 17, 2026
590b44a
fix data task recycling
luxfg Aug 17, 2026
67de315
implement 16 bit memcpy in runtime
luxfg Aug 18, 2026
1c810c9
update plotting script
luxfg Aug 18, 2026
7fbaa1e
implement data task recycling logic
luxfg Aug 18, 2026
8410a1f
fix batcher sample
luxfg Aug 18, 2026
ea34338
additional csl unit test
luxfg Aug 18, 2026
b51fce7
update routing script
luxfg Aug 18, 2026
1d13afc
Improve batcher sort, extend support to 16 PEs
luxfg Aug 18, 2026
25955f9
support wse3 e2e tests
luxfg Aug 18, 2026
c78fe8b
Generalize sorts to K elems per PE, fix queue assignments
luxfg Aug 18, 2026
b0cefbc
fix data task lowering for wse-3
luxfg Aug 18, 2026
58d49c1
Fix WSE-3 task recycling
luxfg Aug 18, 2026
2bcb9fc
Merge branch 'main' into lux/additional-kernels
luxfg Aug 18, 2026
de357f5
update documentation
luxfg Aug 18, 2026
6a9584d
Add odd even sort (quadratic work)
luxfg Aug 18, 2026
6de1d4a
consolidate sort sample folders
luxfg Aug 18, 2026
39b4fab
fix wse3 bundle lowering
luxfg Aug 18, 2026
7932763
Fix fabric shape analysis
luxfg Aug 19, 2026
e530b54
Add WSE-3 simulations to CI
luxfg Aug 19, 2026
83f9285
Fixes for WSE3
luxfg Aug 19, 2026
d2f852e
Improve queue managament for wse-3
luxfg Aug 19, 2026
8c641e1
Fix handwritten csl tests
luxfg Aug 19, 2026
8f3528d
Fix CI for e2e tests
luxfg Aug 19, 2026
b36abe6
fix tests
luxfg Aug 19, 2026
c269eb0
Skip batcher L=4 case
luxfg Aug 19, 2026
d29176e
Fixes for WSE3: set .ut_id so microthreads can be shared independentl…
luxfg Aug 19, 2026
5364a15
Skip tests marked pending
luxfg Aug 19, 2026
c89685e
Improved WSE-3 sample, improved color allocation, microthread assignment
luxfg Aug 19, 2026
6af96ef
Fix odd even sort -- one sequence
luxfg Aug 19, 2026
11fdb09
adapt odd even sort test
luxfg Aug 19, 2026
9fdd803
Reject statically overlapping compute and dataflow blocks in one phas…
luxfg Aug 19, 2026
1fd930b
Fix odd even sort
luxfg Aug 19, 2026
1ed4e5d
Fix test shift bundles
luxfg Aug 19, 2026
6878461
Fix close implementation for wse-2 to fix bundling
luxfg Aug 19, 2026
42a4f17
Fix spmv, gemv
luxfg Aug 20, 2026
65de5c3
keep .advance_switch wse-2 only
luxfg Aug 20, 2026
dec08a7
deeper testing, remove bitonic sort sample
luxfg Aug 20, 2026
3e66d3c
Multi-row sorts
luxfg Aug 20, 2026
c7755ae
Fix queue remapping logic
luxfg Aug 20, 2026
8d86cec
larger test for wse3 batcher variant
luxfg Aug 20, 2026
252a37b
Add 2D Shearsort sample
luxfg Aug 20, 2026
d03a906
Tune shearsort test size
luxfg Aug 20, 2026
2449cfc
Document WSE-3, shearsort, and looped sort channel splits.
luxfg Aug 20, 2026
7949f88
Update python-app.yml
tbennun Aug 25, 2026
3f7653a
Merge branch 'main' into lux/additional-kernels
luxfg Aug 25, 2026
45b3214
Update routing_wse.md
luxfg Aug 25, 2026
3ccd974
Remove unecessary tests
luxfg Oct 5, 2026
9ac42f4
Merge remote-tracking branch 'origin/main' into lux/additional-kernels
luxfg Oct 5, 2026
e1f191c
Additional cleanup
luxfg Oct 5, 2026
156dd5d
Update spada/syntax/csl/constants.py
luxfg Oct 5, 2026
2662e37
Run pytest for both architectures and fix WSE-3 data tasks.
luxfg Oct 5, 2026
8cc5fd6
Merge branch 'lux/additional-kernels' of github.com-glukas:glukas/spa…
luxfg Oct 5, 2026
0d58bfb
Refactor spatial_ir_to_csl
luxfg Oct 5, 2026
9765b85
Improve documentation and comment style
luxfg Oct 5, 2026
94204a2
Add comment on how to get thesis copy
luxfg Oct 5, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 28 additions & 11 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ permissions:
jobs:
test-pytest:
runs-on: ubuntu-latest
strategy:
matrix:
wse-arch: ["wse2", "wse3"]

steps:
- uses: actions/checkout@v4
Expand All @@ -32,11 +35,19 @@ jobs:
pip install -e ".[dev]"

- name: Test with pytest
env:
WSE_ARCH: ${{ matrix.wse-arch }}
run: |
pytest

# WSE-2 and WSE-3 share one runner so Singularity and the SDK are installed
# once.
test-csl:
runs-on: ubuntu-latest
timeout-minutes: 180
strategy:
matrix:
wse-arch: ["wse2", "wse3"]

steps:
- uses: actions/checkout@v4
Expand All @@ -54,29 +65,35 @@ jobs:
pip install -e ".[dev]"

- name: Install CSL dependencies
env:
DEBIAN_FRONTEND: noninteractive
run: |
set -euxo pipefail
. /etc/os-release
echo "Using Ubuntu version $UBUNTU_CODENAME"

# Make dependency setup faster
# Avoid man-db postinst work during package installs.
echo 'set man-db/auto-update false' | sudo debconf-communicate >/dev/null
sudo dpkg-reconfigure man-db

sudo apt-get update
sudo apt-get install -y build-essential libssl-dev uuid-dev libgpgme11-dev squashfs-tools
wget -q -O singularity.deb https://github.com/sylabs/singularity/releases/download/v4.2.1/singularity-ce_4.2.1-${UBUNTU_CODENAME}_amd64.deb
sudo apt install ./singularity.deb
sudo apt-get update -y -o Acquire::Retries=3
sudo apt-get install -y --no-install-recommends \
build-essential libssl-dev uuid-dev libgpgme11-dev squashfs-tools

wget -q -O singularity.deb \
"https://github.com/sylabs/singularity/releases/download/v4.2.1/singularity-ce_4.2.1-${UBUNTU_CODENAME}_amd64.deb"
# Must pass -y: bare "apt install ./singularity.deb" waits for confirmation and hangs CI.
sudo apt-get install -y --no-install-recommends ./singularity.deb
singularity --version

- name: Cache dependencies
id: cache-deps
- name: Cache Cerebras SDK
id: cache-sdk
uses: actions/cache@v4
with:
path: cerebras-sdk
key: ${{ runner.os }}-deps
key: ${{ runner.os }}-cerebras-sdk-1.4.0

- name: Install Cerebras SDK v1.4.0
if: steps.cache-deps.outputs.cache-hit != 'true'
if: steps.cache-sdk.outputs.cache-hit != 'true'
run: |
mkdir cerebras-sdk
cd cerebras-sdk
Expand All @@ -92,7 +109,7 @@ jobs:
- name: Test CSL with simulator
run: |
export PATH=$PATH:`pwd`/cerebras-sdk
./tests/csl_runtime/run_tests.sh
WSE_ARCH=${{ matrix.wse-arch }} ./tests/csl_runtime/run_tests.sh

build-package:
runs-on: ubuntu-latest
Expand Down
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,17 +106,18 @@ Sample SpaDA programs are in `samples/`:
| `samples/stencils.py` | GT4Py stencil definitions (Laplacian, vertical advection, UVBKE, …) |
| `samples/advanced_stencils.py` | GT4Py definitions for horizontal diffusion kernels |
| `samples/benchmarks/` | Pre-compiled `.spst`/`.sptl` pairs for five kernels at five domain sizes |
| `samples/spatial/simple/` | Basic single-PE and streaming operations: `add`, `copy`, `forward_sum`, `backward_sum`, `mult_scalar`, `streaming_copy` |
| `samples/spatial/blas/` | Dense linear algebra: `axpy`, `matvec`, `gemv`, `gemv_twophase` |
| `samples/spatial/simple/` | Basic single-PE and streaming operations: `add`, `copy`, `forward_sum`, `backward_sum`, `mult_scalar`, `streaming_copy`, and `exchange_bundle_1D` |
| `samples/spatial/blas/` | Linear algebra: `axpy`, `matvec`, `gemv`, `gemv_twophase`, `spmv` |
| `samples/spatial/collectives/` | Reductions (`scalar`, `chain`, `tree`, `twophase` in 1D/2D) and broadcasts (`broadcast_1D`, `broadcast_2D`, and multicast variants) |
| `samples/spatial/sort/` | Sorting networks over `R` independent rows of `2^L` PEs holding `K` keys each: `batcher_oddeven_wse3_1D` (Batcher odd-even mergesort), `odd_even_sort_1D_looped` (1D looped odd-even transposition sort), and `shearsort_2D` (2D snake-order shearsort on WSE-3) |
| `samples/spatial/stencils/` | Stencil examples: `laplacian` (high-level) and `laplacian_routed` (explicit routing) |
| `samples/spst/` | Stencil IR examples |

---

## SDK Version and WSE compatibility

The code has been tested for CSL SDK 1.4 and WSE-2.
The code has been tested with CSL SDK 1.4 on WSE-2 and WSE-3. The target architecture is selected via `WSE_ARCH` (`wse2`, the default, or `wse3`). CI runs simulator tests for both architectures. Kernels targeting features unique to WSE-3 (such as `shearsort_2D`, which requires four concurrent inbound queues per PE, and `batcher_oddeven_wse3_1D`) automatically skip during WSE-2 test runs.

## Testing

Expand Down Expand Up @@ -159,6 +160,7 @@ make -C tests/csl_runtime check-sdk

```bash
make -C tests/csl_runtime test
make -C tests/csl_runtime test WSE_ARCH=wse3
```

**Run a single test:**
Expand Down Expand Up @@ -189,13 +191,14 @@ tests/csl_runtime/run-in-lima.sh --sdk-url <url>
```

This creates the Lima VM on first use (~5–10 min), downloads and extracts the SDK to `tests/csl_runtime/cerebras-sdk/`, installs Python dependencies inside the VM, and runs the full test suite.
If the SDK tarball is already downloaded or extracted, use `--sdk /path/to/cs_sdk` instead of `--sdk-url`.
If the SDK tarball is already downloaded or extracted, use `--sdk /path/to/cs_sdk` instead of `--sdk-url`. Pass `--arch wse3` to compile and simulate for WSE-3.

Other modes:

```bash
# Run a single test
tests/csl_runtime/run-in-lima.sh --sdk <dir> --test test_add.sh
tests/csl_runtime/run-in-lima.sh --sdk <dir> --arch wse3 --test test_shearsort_2d_looped.sh

# Verify the SDK toolchain only
tests/csl_runtime/run-in-lima.sh --sdk <dir> --check
Expand Down
5 changes: 5 additions & 0 deletions irspec/docs/spatial/routing.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,3 +192,8 @@ to receive.
If multicasting is used, the correctness conditions must be adapted accordingly,
especially when considering multiple phases.


## Lowering to Cerebras WSE

How epochs, switch positions, control wavelets, shift bundling, and counter filters are realized on
the Cerebras Wafer-Scale Engine is described in [Routing Semantics on Cerebras WSE](routing_wse.md).
Loading
Loading