Skip to main content

Systolic CNN AcceLerator Simulator

Project description

Systolic CNN AcceLErator Simulator (SCALE Sim) v2

SCALE Sim is a simulator for systolic array based accelerators for Convolution, Feed Forward, and any layer that uses GEMMs. This is a refreshed version of the simulator with feature enhancements, restructured code to aid feature additions, and ease of distribution.

The previous version of the simulator can be found here.

Getting started in 30 seconds

Installing the package

Getting started is simple! SCALE-Sim is completely written in python and is available both as a package and could be run from source.

You can install SCALE-Sim in your environment using the following command

$ pip3 install scalesim

Alternatively you can install the package from the source as well

$ python3 setup.py install

Launching a run

SCALE-Sim can be run by using the scale.py script from the repository and providing the paths to the architecture configuration, and the topology descriptor csv file.

$ python3 scale.py -c <path_to_config_file> -t <path_to_topology_file>

Try it now in the google colab notebook (TBD)

Custom Experiment

  • Fill in the config file, scale.cfg with proper values.
  • Move into "scale_sim_simulator" sub-directory
  • Run the command: python scale.py
  • Wait for the run to finish

The config file scale.cfg contains two sections, architecture presets and network presets.
Here is sample of the config file.
sample config
Architecture presets are the variable parameters for SCALE-Sim, like array size, memory etc.

Network preset contains just one field for now, that is the path to the topology csv file.
SCALE-Sim accepts topology csv in the format shown below.
yolo_tiny topology

Since SCALE-Sim is a CNN simulator please do not provide any layers other than convolutional or fully connected in the csv. You can take a look at yolo_tiny.csv for your reference.

Output

Here is an example output dumped to stdout when running Yolo Tiny (whose configuration is in yolo_tiny.csv): screen_out

Also, the simulator generates read write traces and summary logs at ./scale_sim_simulator/outputs/<run_name>/. There are three summary logs:

  • Layer wise runtime and average utilization
  • Layer wise MAX DRAM bandwidth log
  • Layer wise AVG DRAM bandwidth log
  • Layer wise breakdown of data movement and compute cycles

In addition cycle accurate SRAM/DRAM access logs are also dumped and could be accesses at ./scale_sim_simulator/outputs/<run_name>/

Detailed Documentation

For detailed insights on using SCALE-Sim, you can refer to this paper

Using MNK Operands

If a user would like to use SCALE-Sim to run non-CNN layers, scale_sim_simulator/run_nets_mnk.py has the logic to input custom IFMAP (input activations), FILTER (weights), OFMAP (output activations) in a GEMM format

  • Run the command: python run_nets_mnk.py

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

scalesim-2.0.tar.gz (31.7 kB view hashes)

Uploaded Source

Built Distribution

scalesim-2.0-py3-none-any.whl (44.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page