Introducing a new generation Adaptive Optics simulation framework: from PASSATA to SPECULA

Introducing a new generation Adaptive Optics simulation framework: from PASSATA to SPECULA
Notice: This research summary and analysis were automatically generated using AI technology. For absolute accuracy, please refer to the [Original Paper Viewer] below or the Original ArXiv Source.

Numerical end-to-end simulation in Adaptive Optics (AO) is a key tool in the development of complex systems, from the initial design to the commissioning phase. Based on our previous experience with PASSATA, we decided to develop a new AO simulation framework in Python language, naming it SPECULA (short for: Scalable Parallel Execution of Computations Upscaling Large Adaptive optics simulations). Following an object-oriented approach, the physical entities are modeled as processing objects connected to each other to exchange data objects. A simulation is run by providing its description instead of writing and executing a specific script. The Python language and its library flexibility allowed us to write one single code that can be run on CPU and GPU platforms. We put a strong focus on computational efficiency, relying on CuPy and its interface to access the CUDA-stream mechanism. Moreover, SPECULA is capable of distributed computations over multiple processing nodes, making it suitable to run in an HPC environment, as tested on the Italian supercomputer Leonardo. SPECULA can also be used in laboratory environment to implement a hybrid simulation, allowing us to interface simulated and concrete objects: this feature was demonstrated in the Adaptive Optics laboratories at Arcetri Observatory. In this paper, we describe the main characteristics of SPECULA, show some relevant examples of its use, and finally draw our goals for the future.


💡 Research Summary

The paper presents SPECULA (Scalable Parallel Execution of Computations Upscaling Large Adaptive optics simulations), a next‑generation end‑to‑end adaptive optics (AO) simulation framework that supersedes the legacy IDL‑based PASSATA. Recognizing PASSATA’s limitations—lack of modern libraries, cumbersome GPU integration, and poor scalability to high‑performance computing (HPC) environments—the authors rebuilt the simulator in Python, leveraging the extensive scientific ecosystem and the GPU‑oriented CuPy library with CUDA‑stream support.

SPECULA adopts a clean object‑oriented architecture. Physical entities (atmosphere, wave propagation, wavefront sensors, deformable mirrors, etc.) are encapsulated as Processing Objects, while the numerical data they exchange (electric fields, images, commands) are wrapped in Data Objects. Each Data Object tracks its last modification time, enabling the framework to skip unnecessary recomputations. Connections between objects are defined declaratively in a YAML configuration file; the user never writes an explicit execution script.

The execution order is derived from a directed‑acyclic graph (DAG) after removing “delayed connections” that would otherwise create circular dependencies within a single time step. A simple leaf‑removal algorithm assigns an integer trigger order to each node, guaranteeing a valid schedule for a single executor. In multi‑process or multi‑node runs, the same trigger order is used locally, while inter‑process synchronization relies on MPI message passing. This design ensures deterministic, reproducible simulations while allowing massive parallelism.

GPU acceleration is achieved through a unified interface (self.xp) that transparently switches between NumPy (CPU) and CuPy (GPU). The core computation of a Processing Object is split into four phases: check_ready (non‑parallelizable setup), trigger (the main CUDA‑graph‑captured kernel), post_trigger (synchronisation and output update), and send_outputs (communication for remote connections). By capturing the trigger phase into a CUDA graph and executing it on a dedicated CUDA stream, SPECULA minimizes host‑device synchronization overhead and maximizes GPU occupancy. Objects can be pinned to specific GPU indices, enabling the distribution of large memory footprints across several GPUs—critical for simulating systems such as the MORFEO AO instrument.

The framework’s management layer includes a Simul class that parses the YAML description, instantiates all objects, resolves dependencies, and builds the computational graph. It also handles data persistence using FITS files, providing save and read methods that store the complete simulation state for later replay or analysis. Visualization of the processing graph and resource allocation is supported via the orthogram library.

A distinctive feature of SPECULA is its hybrid simulation capability. Real laboratory hardware (e.g., a physical deformable mirror or sensor) can be linked to virtual Processing Objects, allowing a seamless mix of real‑time measurements and simulated components. The authors demonstrated this in the Adaptive Optics laboratories at Arcetri Observatory, where hardware‑in‑the‑loop tests were performed with the SPECULA environment acting as the surrounding AO system.

Performance benchmarks on the Italian supercomputer Leonardo show that SPECULA scales efficiently across multiple nodes and GPUs, delivering speed‑ups of several times compared with PASSATA and achieving memory usage that exceeds the capacity of a single GPU. The codebase, comprising more than 50 ready‑to‑use Processing Objects, is open‑source on GitHub (ArcetriAdaptiveOptics/SPECULA) and accompanied by extensive documentation and tutorials on Read the Docs.

Future work outlined by the authors includes extending the framework to support non‑linear control loops, real‑time streaming data, standardized interfaces to other AO simulators (e.g., CAOS, OCTOPUS, YAO), and integration of machine‑learning‑based optimization modules.

In summary, SPECULA delivers a modern, flexible, and high‑performance AO simulation platform that combines the ease of Python development, GPU and HPC scalability, declarative configuration, and hybrid laboratory integration, thereby addressing the shortcomings of PASSATA and positioning itself as a valuable tool for the design, commissioning, and operation of next‑generation adaptive optics systems.


Comments & Academic Discussion

Loading comments...

Leave a Comment