{"id":13654264,"url":"https://github.com/ARM-software/SCALE-Sim","last_synced_at":"2025-04-23T08:31:56.024Z","repository":{"id":29312466,"uuid":"119879132","full_name":"ARM-software/SCALE-Sim","owner":"ARM-software","description":null,"archived":true,"fork":false,"pushed_at":"2023-05-11T14:18:53.000Z","size":1251,"stargazers_count":336,"open_issues_count":0,"forks_count":151,"subscribers_count":24,"default_branch":"master","last_synced_at":"2024-11-10T05:32:05.709Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ARM-software.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2018-02-01T18:55:22.000Z","updated_at":"2024-11-04T12:27:07.000Z","dependencies_parsed_at":"2024-01-14T16:31:24.069Z","dependency_job_id":null,"html_url":"https://github.com/ARM-software/SCALE-Sim","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ARM-software%2FSCALE-Sim","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ARM-software%2FSCALE-Sim/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ARM-software%2FSCALE-Sim/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ARM-software%2FSCALE-Sim/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ARM-software","download_url":"https://codeload.github.com/ARM-software/SCALE-Sim/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250399509,"owners_count":21424195,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-02T02:01:25.913Z","updated_at":"2025-04-23T08:31:54.730Z","avatar_url":"https://github.com/ARM-software.png","language":"Python","readme":"# THIS PROJECT IS SUPSERSEDED BY [SCALE-SIM-V2](https://github.com/scalesim-project/scale-sim-v2)\n\n# **S**ystolic **C**NN **A**cce**LE**rator Simulator (SCALE Sim)\n\nSCALE sim is a CNN accelerator simulator, that provides cycle-accurate timing,\npower/energy, memory bandwidth and trace results for a\nspecified accelerator configuration and neural network architecture.\n\n[Skip to Getting Started](getting_started.md)\n\n## Motivation\n\nSCALE sim enables research into CNN accelerator architecture and is also suitable for system-level studies. \n\nSince deep learning based solutions have become prevalent for computer vision\nover the recent few years, \nthere has been a surge in accelerator design proposals both from academia and the industry. \n\nIt is natural to assume that we will see many more accelerators being proposed as new use cases are identified in the near future.\nHowever, it is important to keep in mind that CNN use cases will likely vary, which poses a large spectrum of efficiency and performance demands on the underlying CNN accelerator design. Therefore, it is important to quickly prototype architectural ideas and iterate over different designs.\n\nIn the present, designing a new CNN accelerator usually starts from scratch. \nPerforming a simple first order analysis often involves a team of designers writing their own simulators, tackling bugs, and iterating over multiple times.\n\nIt is not hard to see that all this effort is mostly repeated work.\nThis reinvention of the wheel could be avoided if there were a standard tool usable across various use cases and implementation goals.\nSCALE Sim is our effort to make a stride in this direction.\n\n## SCALE sim outputs\n\nAt the core of SCALE sim is a cycle-accurate architecture simulator for CNN accelerators. We build the accelerator based on the systolic array architecture, similar to the one used in Google's TPU.\n\nGiven a convolution neural network topology and certain architecture parameters,\nSCALE sim is capable of estimating the following:\n\n* Run time in cycles\n* Average utilization\n* On-chip memory requirements\n* Off-chip interface bandwidth requirements\n\nWith the help of external simulators such as CACTI or DRAMPower, users can also use SCALE sim to obtain:\n\n* Power consumption\n* Area estimates\n\n## Usecases\n\nPrimarily, we envision two major usecases of SCALE sim, which we describe below. It is our hope that by releasing ths simulator, the community will find interesting and ingenious ways of using the tool for other research tasks that expand the original usage scope of SCALE sim.\n\n### Accelerator Design Space Exploration\nSCALE sim can help the designer quickly explore accelerator design space. In this mode, SCALE expects the designer to provide a list of limits for architecture features like SRAM size, array size, and interface bandwidth; relevant to the target use case.\nThese limits help the tool in narrowing down the search space.\nSCALE will work if the limits are not specified by assuming the default values, but naturally, the run time will be large.\n\nUsually, designers can translate the use case constraints into high-level architecture constraints. \nFor instance, a power-optimized design will not have a large on-chip memory or a big computing array. \nYou get the gist. \n\n### System Simulation\nUsually in an ML-enable application, CNN is just one stage of the end-to-end processing pipeline. Therefore, it is important to understand the application characteristics in the context of the entire Systems-on-a-chip (SoC). Existing full-system simulators such as Gem5 and GemDroid lack modles for CNN accelerators (IP), and therefore presents a roadblock in studying system-level behavior of ML-enabled applications.\n\nDue to the modular interface design, users could choose to integrate SCALE sim with Gem5 or GemDroid for full-system simulation. This is particular helpful for researchers who do not wish to perform in-depth investigation of the CNN accelerator microarchitecture, but wish to integrate a decent CNN IP to obtain meaningful system-level characterization results.\n\n## How does it work?\n\nSCALE sim simulates a TPU-like systolic array for CNN computation.\nDue to the highly regular data-flow involved in CNNs, it is easy to estimate the storage, traffic, and computation metrics without actually performing the computation. \nSCALE uses this property to generate a cycle accurate traffic trace, into and out of the systolic array to the on-chip SRAM. \n\nThe on-chip SRAM is emulated as a double buffer storage unit, to amortize the high bandwidth requirement on the interface size. \nUsing the traffic traces from SRAM to the array and taking into account the double buffered SRAM, traces and metrics for the accelerator to main memory transactions are computed.\nGiven a CNN topology, the current implementation of SCALE computes the output metrics sequentially for each layer.\n\n\n## Getting Started\n\n### 30 seconds to SCALE sim!\n\nGetting started is simple! SCALE-Sim is completely written in python. At the moment, it has dependencies on the following python packages. Make sure you have them in your environment.\n\n* os\n* subprocess\n* math\n* configparser\n* tqdm\n* absl-py\n\n*NOTE: SCALE-Sim needs python3 to run correctly. If you are using python2, you might run into typecasting errors* \n\n### Custom Experiment\nThis experiment will run the default MLPERF_AlphaGoZero_32x32_os architechture contained inside scale.cfg. \nIt will also run alexnet as its network topology.\n* Run the command: ```python scale.py```\n* Wait for the run to finish\n\nThe config file inside configs contain achitecture presets.  \nthe csv files inside toologies contain different networks\n\nIn order to change a different arichtechture/network, create a new .cfg file inside ```cofigs``` and call a new network by running\n```python scale.py -arch_config=configs/eyeriss.cfg -network=topologies/yolo.csv```\nHere is sample of the config file.  \n![sample config](https://raw.githubusercontent.com/AnandS09/SCALE-Sim/master/images/config_example.png \"sample config\")    \nArchitecture presets are the variable parameters for SCALE-Sim, like array size, memory etc.  \n\nThe Network Topoplogy csv file contains the network that we want to test in our architechture.  \nSCALE-Sim accepts topology csv in the format shown below.  \n![yolo_tiny topology](https://raw.githubusercontent.com/AnandS09/SCALE-Sim/master/images/yolo_tiny_csv.png \"yolo_tiny.csv\")\n\nSince SCALE-Sim is a CNN simulator please do not provide any layers other than convolutional or fully connected in the csv.\nYou can take a look at \n[yolo_tiny.csv](https://raw.githubusercontent.com/AnandS09/SCALE-Sim/master/topologies/yolo_tiny.csv)\nfor your reference.\n\n### Output\n\nHere is an example output dumped to stdout when running Yolo tiny (whose configuration is in yolo_tiny.csv):\n![screen_out](https://github.com/AnandS09/SCALE-Sim/blob/master/images/output.png \"std_out\")\n\nAlso, the simulator generates read write traces and summary logs at ```./outputs/\u003ctopology_name\u003e```.\nThere are three summary logs:\n\n* Layer wise runtime and average utilization\n* Layer wise MAX DRAM bandwidth log\n* Layer wise AVG DRAM bandwidth log\n* Layer wise breakdown of data movement and compute cycles\n\nIn addition cycle accurate SRAM/DRAM access logs are also dumped and could be accesses at ```./outputs/\u003ctopology_name\u003e/layer_wise```\n\n### Detailed Documentation\n\nFor detailed insights on working of SCALE-Sim, you can refer to this [paper](https://arxiv.org/abs/1811.02883)\n\n## Citing\n\nIf you find this tool useful for your research, please use the following bibtex to cite us,\n\n```\n@article{samajdar2018scale,\n  title={SCALE-Sim: Systolic CNN Accelerator Simulator},\n  author={Samajdar, Ananda and Zhu, Yuhao and Whatmough, Paul and Mattina, Matthew and Krishna, Tushar},\n  journal={arXiv preprint arXiv:1811.02883},\n  year={2018}\n}\n```\n\n## Contributing\n\nPlease send a [pull request](https://help.github.com/articles/creating-a-pull-request/).\n\n## Authors\n\n[Ananda Samajdar](https://anands09.github.io), Georgia Institute of Technology\n\n[Yuhao Zhu](http://yuhaozhu.com), University of Rochester\n\n[Paul Whatmough](https://www.linkedin.com/in/paul-whatmough-2062729/), Arm Research, Boston, MA\n\n## License\n\nThis project is licensed under the MIT License - see the LICENSE file for details.\n\n","funding_links":[],"categories":["Tools"],"sub_categories":["Simulation Frameworks"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FARM-software%2FSCALE-Sim","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FARM-software%2FSCALE-Sim","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FARM-software%2FSCALE-Sim/lists"}