Unstructured Hydrodynamics on Spatial Dataflow Architectures: A Joint Code and Data Decomposition Approach

Piotr Luczynski, Tal Ben-Nun, Leighton Wilson, Brian Van EssenarXiv 2026

TL;DR

The authors present a systematic, model-driven framework to map complex, unstructured grid physics simulations onto spatial dataflow hardware like the Cerebras Wafer-Scale Engine (WSE). By jointly optimizing how code and data are split across the WSE's massive 2D grid of processing elements, their automated compiler pipeline achieves up to a 4.8× speedup over an NVIDIA A100 GPU for a standard hydrodynamics proxy application.

What Problem Does This Paper Address?

Spatial Dataflow Architectures (SDAs), such as the Cerebras WSE, offer massive parallelism by co-locating compute and memory across hundreds of thousands of processing elements (PEs) connected in a 2D mesh. While SDAs excel at structured 2D grids (like deep learning workloads or simple stencils), they struggle with real-world multiphysics simulations that rely on unstructured grids.

Unstructured grids introduce irregular, high-dimensional communication patterns and indirect memory accesses. Compounding this challenge, each PE has a tiny, fixed memory footprint (only 48 KB of SRAM on the CS-2 chip, as shown in Overview of a single PE), which must hold both the simulation data and the program instructions. Large, complex scientific codes simply cannot fit entirely onto a single PE alongside their data, creating a massive optimization puzzle.

Fig. 2. Overview of a single PE on a CS-2 chip.

Methods

The authors tackle this challenge with a joint code and data decomposition framework guided by analytical performance models (an overview is depicted in Overview of the approach).

Fig. 1. Overview of our approach.
  • Automated Analysis via SDFGs: They ingest the application code using Stateful Dataflow Multigraphs (SDFGs), a graph-based intermediate representation that explicitly exposes data movement and parallel regions.
  • Dataflow Transformations: To maximize the hardware's SIMD capabilities, they implement graph transformations—including Horizontal Map Merging, Array Merging, and Tasklet Stacking—to combine independent operations into single Data Structure Descriptor (DSD) instructions.
  • Code Partitioning Strategies: Since the code exceeds the 48 KB memory limit, they evaluate and model different mitigation strategies (visualized in Mapping code costs), ultimately utilizing "Subprogram PEs"—breaking the program into disjoint parts and streaming data sequentially through a ring of PEs.
  • 3D-to-2D Mapping: They develop a custom communication library that uses snake-shaped space-filling curves to map 3D mesh physics onto the physical 2D grid of PEs, minimizing communication latency between distant neighbors.
Mapping code costs

Datasets

The framework was evaluated using LULESH (Livermore Unstructured Lagrangian Explicit Shock Hydrodynamics), a widely accepted proxy application that represents typical hydrodynamics workloads. They specifically utilized PyLULESH to interface with their compiler pipeline.

Key Insights and Ideas

  • The Memory-Instruction Trade-off: On fixed-memory SDAs, code size directly competes with data storage. The optimal mapping strategy changes drastically based on the local domain size; for small domains, distributing subprograms across multiple PEs beats out runtime code swapping.
  • Hardware-Aligned IR: Representing scientific code as an SDFG makes it uniquely compatible with spatial architectures because dataflow maps translate directly into hardware-level DSD vector operations.
  • Predictable Performance: Unlike traditional cache-heavy CPUs or GPUs where runtime can be highly variable due to cache misses, the WSE's SRAM-based, asynchronous architecture allows analytical models to predict performance trends with remarkable accuracy (within a constant overhead factor).

Key Results

  • The automatically generated code achieved up to a 4.8× speedup over an NVIDIA A100 GPU when running the LULESH benchmark.
  • The analytical performance model proved highly reliable, maintaining a consistent 50.5% to 50.9% difference compared to actual hardware execution times across varying domain sizes, validating its utility for guiding compilation choices.
  • Using DSD vector operations instead of standard loops yielded a 30× speedup in local compute microbenchmarks.

Limitations and Future Work

  • Precision Constraints: The Cerebras CS-2 does not natively support 64-bit floating-point datatypes, forcing the application to run in 32-bit precision.
  • Address Calculation Overhead: The current model slightly underestimates runtime because address calculations for indirect memory accesses (offsetting) take multiple cycles in assembly, a hardware quirk the authors plan to integrate into future iterations of the sequential model.
  • Instruction Footprint: The necessity of splitting code into subprograms introduces communication overhead. Future work will focus on more aggressive code compression techniques to fit more logic onto a single PE, unlocking even greater speedups.

Summary updated

BibTeX
@misc{luczynski2026unstructured,
  author = {Piotr Luczynski and Tal Ben-Nun and Leighton Wilson and Brian Van Essen},
  title = {{Unstructured Hydrodynamics on Spatial Dataflow Architectures: A Joint Code and Data Decomposition Approach}},
  year = {2026},
  eprint = {2607.18650},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2607.18650},
}
Figure