SimPhony: A Device-Circuit-Architecture Cross-Layer Modeling and Simulation Framework for Heterogeneous Electronic-Photonic AI Systems.
By Ziang Yin, Meng Zhang, Amir Begovic, Rena Huang, Jeff Zhang, and Jiaqi Gu†.
This repo is the official implementation of "SimPhony: A Device-Circuit-Architecture Cross-Layer Modeling and Simulation Framework for Heterogeneous Electronic-Photonic AI Systems"
SimPhony aims to provide researchers and engineers with a powerful tool for simulating and analyzing photonic architectures. By supporting various dataflow switching methods and offering extensive device libraries, SimPhony enables detailed performance evaluations and optimizations of photonic systems.
In SimPhony, users can define the basic building blocks and reuse them in photonic core designs. If a complete netlist is provided, SimPhony is capable of calculating area in a layout-aware manner. Users can always define a customized function for area calculation.
SimPhony realizes photonic domain parallelism during latency and energy calculation; users may define it in the configuration.
SimPhony is also capable of calculating device energy in a data-dependent manner. (Warning: this can only be realized when using both TorchONN and "PowerCalculator" located in models/layers/utils
) Users can always define a customized function for any arbitrary energy calculation.
Case Study: Dynamic Array-style Tensor Cores TeMPO.
We first define the architecture parameters: R tiles, each containing C cores, with H
To efficiently span the multi- core architecture without manually detailing every connection, we define scaling rules applied to each node and describe inter-node connections. There are RCHW total nodes for parallel dot-product. As the output of C cores in a tile are in-situ accumulated, integrators/ADCs can be shared and thus scaled by CHW . MZM group A encodes one matrix operand and can be broadcast to R tiles. Thus, the input encoders, i.e., DAC A and MZM A, are scaled by RH. These scaling rules are expressed as customizable symbolic expressions in circuit description files, enabling user-defined reuse styles to suit specific designs.
In this folder, we provide Lightning Transformer, a multi-wavelength version of the TeMPO architecture for users to study and validate. You may run the example in the unitest
folders to learn how each module can be used.
- Dataflow Switching: Supports input, weight, and output stationary dataflows.
- Device Libraries:
- Photonic Devices: Includes energy, area, latency, and insertion loss parameters.
- Electronic Devices: Provides detailed models for electronic components.
- Memory Computation: Supports bandwidth aware memory hierarchies
- Integration with TorchONN: Seamless integration for optical neural network simulations.
- Detailed Simulation Report: Reports from Simphony contain detailed information on each device and each memory hierarchy's energy, and area breakdown. It also provides detailed insertion loss analysis with critical path defined.
- cacti/: Contains the CACTI tool for cache and memory simulation.
- configs/: Configuration files for various simulation aspects.
- architecture_mapping/: Maps architectures for simulation.
- design/: Architecture design-specific configurations.
- devices/: Device parameter configurations.
- memory/: Memory hierarchy configurations.
- nn_mapping/: Neural network mapping configurations.
- onn_mapping/: Optical neural network mapping configurations.
- models/: Pre-defined models with customizable layers used in simulations.
- onnarchsim/: Core simulation engine and supporting scripts.
- database/: Scripts for recursive architecture and device configuration loading.
- plot/: Scripts for visualizing simulation outputs.
- workflow/: Manages simulation workflows.
- simulator.py: The main simulator script.
- version.py: Version information.
- unitest/: Example scripts demonstrating module usage.
- utils/: Utilities for configuration loading and management.
- Python 3.6 or higher
- Required Python packages (listed in requirements.txt)
- CACTI tool installed in the cacti/ directory
- TorchONN (optional but highly recommended, for optical neural network simulations)
Make sure to install the packages mentioned in the requirements.txt.
For Pyutils package, please visit https://github.com/JeremieMelo/pyutility.git and install it manually by typing python setup.py --install
git clone https://github.com/ScopeX-ASU/SimPhony
Please go over each example in the unitest
folder in the following order:
test_load_devices.py
test_architecturedb.py
test_CNN_model_convert.py
test_insertion_loss.py
test_dataflow.py
test_energy.py
test_area.py
test_memory.py
test_sim.py
@misc{yin2024simphonydevicecircuitarchitecturecrosslayermodeling,
title={SimPhony: A Device-Circuit-Architecture Cross-Layer Modeling and Simulation Framework for Heterogeneous Electronic-Photonic AI System},
author={Ziang Yin and Meng Zhang and Amir Begovic and Rena Huang and Jeff Zhang and Jiaqi Gu},
year={2024},
eprint={2411.13715},
archivePrefix={arXiv},
primaryClass={physics.optics},
url={https://arxiv.org/abs/2411.13715},
}