Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Binary file removed .DS_Store
Binary file not shown.
12 changes: 11 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@

# Generated files
samples/benchmarks/plots/**/*.csv
samples/benchmarks/plots/**/*.pdf

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand All @@ -8,7 +13,8 @@ __pycache__/


# DS STore
*.DS_STORE
.DS_Store
**/.DS_Store

#
.idea
Expand All @@ -33,6 +39,10 @@ share/python-wheels/
*.egg
MANIFEST

# SDK
/tests/csl_runtime/cerebras-sdk/
/tests/csl_runtime/cerebras-sdk.tar.gz

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
Expand Down
1 change: 1 addition & 0 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ BSD 3-Clause License

Copyright (c) 2026, Lawrence Livermore National Security, LLC
Copyright (c) 2026, SPCL, ETH Zurich
Copyright (c) 2026, Noéda AG

All rights reserved.

Expand Down
33 changes: 18 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ For full details, see the paper:
Clone the repository and install the package:

```bash
git clone https://github.com/glukas/spatialstencil.git
cd spatialstencil
git clone https://github.com/glukas/spada.git
cd spada
pip install -e .
```

Expand Down Expand Up @@ -64,7 +64,7 @@ Key options:
To compile a GT4Py stencil file to SPADA IR (`.spst` and `.sptl`):

```bash
python -m spatialstencil.cli.gt4py_to_spatial samples/stencils.py 128,128,80 output/ --function-name laplacian
python -m spada.cli.gt4py_to_spatial samples/stencils.py 128,128,80 output/ --function-name laplacian
```

Arguments in order: `input_file`, `domain_size` (comma-separated `x,y,z`), `output_dir`. Omitting `--function-name` compiles all stencils in the file.
Expand All @@ -76,13 +76,13 @@ The resulting `.sptl` file can then be passed to `sptlc`.
After compiling with `cslc` (invoked automatically by `sptlc` unless `--generate-only` is set), run the kernel via the Cerebras `cs_python` launcher:

```bash
cs_python spatialstencil/runtime/runtime.py output/ in_field.npy
cs_python spada/runtime/runtime.py output/ in_field.npy
```

Alternatively, use the `Program` class directly from Python (must be run with `cs_python`):

```python
from spatialstencil.runtime.runtime import Program
from spada.runtime.runtime import Program
import numpy as np

program = Program("output/")
Expand Down Expand Up @@ -183,23 +183,26 @@ brew install lima qemu lima-additional-guestagents # one-time
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. Other modes:
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`.

Other modes:

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

# Verify the SDK toolchain only
tests/csl_runtime/run-in-lima.sh --sdk-url <url> --check
tests/csl_runtime/run-in-lima.sh --sdk <dir> --check

# Run the Cerebras SDK smoke test
tests/csl_runtime/run-in-lima.sh --sdk-url <url> --smoke /path/to/csl-extras-*
tests/csl_runtime/run-in-lima.sh --sdk <dir> --smoke /path/to/csl-extras-*

# Drop into an interactive shell inside the VM
tests/csl_runtime/run-in-lima.sh --sdk-url <url> --shell
tests/csl_runtime/run-in-lima.sh --sdk <dir> --shell
```

If the SDK tarball is already downloaded or extracted, use `--sdk /path/to/cs_sdk` instead of `--sdk-url`. The repository must reside under `$HOME` (Lima mounts the Mac home directory by default). The Lima configuration is in `tests/csl_runtime/lima-ubuntu-x86_64.yaml`.
The repository must reside under `$HOME` (Lima mounts the Mac home directory by default). The Lima configuration is in `tests/csl_runtime/lima-ubuntu-x86_64.yaml`.

**Cleanup** generated test artifacts:

Expand All @@ -214,7 +217,7 @@ make -C tests/csl_runtime clean-sdk # also remove the downloaded SDK

Questions, discussions, and feedback are welcome via GitHub Issues:

- **Bug reports and feature requests**: [GitHub Issues](https://github.com/glukas/spatialstencil/issues)
- **Bug reports and feature requests**: [GitHub Issues](https://github.com/glukas/spada/issues)

---

Expand All @@ -227,9 +230,9 @@ Contributions are welcome. Please follow these steps:
3. **Write tests** for any new functionality. Tests live in `tests/` and are organized by subsystem (`stencil_ir/`, `spatial_ir/`, `placement/`, `gt4py/`, `csl_runtime/`).
4. **Format** your code with `black` and `isort`, and verify with `flake8`:
```bash
black spatialstencil tests
isort spatialstencil tests
flake8 spatialstencil tests
black spada tests
isort spada tests
flake8 spada tests
```
5. **Run tests**: see the [Testing](#testing) section for Python unit tests and CSL runtime tests.
6. **Open a pull request** against `main` with a clear description of the change and its motivation.
Expand Down
24 changes: 12 additions & 12 deletions irspec/docs/index.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# Welcome to MkDocs
# SPADA — Multi-Level Spatial IR Specification

For full documentation visit [mkdocs.org](https://www.mkdocs.org).
SPADA is a programming language and compiler for spatial dataflow architectures such as the [Cerebras Wafer-Scale Engine](https://www.cerebras.net/). It provides precise control over data placement, communication streams, and asynchronous execution while abstracting architecture-specific routing details.

## Commands
This site documents the three intermediate representations (IRs) used in the SPADA compilation pipeline:

* `mkdocs new [dir-name]` - Create a new project.
* `mkdocs serve` - Start the live-reloading docs server.
* `mkdocs build` - Build the documentation site.
* `mkdocs -h` - Print help message and exit.
| IR | Input | Output |
|---|---|---|
| **Stencil IR** | GT4Py stencil definitions | Spatial IR |
| **Spatial IR** | Stencil IR / hand-written SPADA kernels | Dataflow Task IR |
| **Dataflow Task IR** | Spatial IR | Cerebras CSL |

For full details on the SPADA language, compiler, and hardware results, see:

> Lukas Gianinazzi, Tal Ben-Nun, Torsten Hoefler. *SPADA: A Spatial Dataflow Architecture Programming Language.* arXiv:2511.09447, 2025.

## Project layout

mkdocs.yml # The configuration file.
docs/
index.md # The documentation homepage.
... # Other markdown pages, images and other files.
2 changes: 1 addition & 1 deletion irspec/mkdocs.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
site_name: Multi-Level Spatial IR
site_name: Spatial Dataflow Abstraction (SpaDA)
site_url: http://localhost:8000
theme: material
nav:
Expand Down
2 changes: 1 addition & 1 deletion samples/benchmarks/bench_hardware.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ BLUE='\033[0;34m'
NC='\033[0m'

BENCHMARK_DIR="samples/benchmarks"
RUNTIME="spatialstencil/runtime/runtime.py"
RUNTIME="spada/runtime/runtime.py"
OUTPUT_DIR="benchmark_results"

mkdir $OUTPUT_DIR
Expand Down
Loading
Loading