/puma-simulator

[ASPLOS 2019] PUMA-simulator provides a detailed simulation model of a dataflow architecture built with NVM (non-volatile memory), and runs ML models compiled using the puma compiler.

Primary LanguagePythonMIT LicenseMIT

PUMA Simulator

Below you will find some information on how to use the PUMA Simulator.

Table of Contents

Introduction

This emulator was created as part of the PUMA work presented at ASPLOS 2019.

Paper: https://dl.acm.org/citation.cfm?id=3304049 (see details on architecture and compiler here).

Slides: https://drive.google.com/file/d/1NyQP1dKjgB1mt3y7OHMb75ik02rWp3EY/view?usp=sharing

Lightning Talk:https://www.youtube.com/watch?v=x3dAPgkQFOg

System requirements

Below you can find the system requirements and versions tested.

Requirement Version
OS: Ubuntu 16.04.3 LTS (Xenial Xerus)
Python 2.7.12

Quick Start

sudo apt-get install python-tk

sudo pip install http://download.pytorch.org/whl/cu80/torch-0.3.0.post4-cp27-cp27mu-linux_x86_64.whl

sudo pip install -r <dpe_emulate>/requirements.txt

If you are behind a proxy, you should type sudo pip --proxy $http_proxy install ... instead.

Usage

Emulate

For testing if everything is working fine:

cd <puma-simulator>/src

python dpe.py

Then, you should see some results like:

...

('Cycle: ', 8783, 'Tile halt list', [1, 1, 0, 1])
('Cycle: ', 8784, 'Tile halt list', [1, 1, 0, 1])
('Cycle: ', 8785, 'Tile halt list', [1, 1, 0, 1])
('Cycle: ', 8786, 'Tile halt list', [1, 1, 1, 1])
cycle: 8786 Node Halted
Finally node halted | PS: max_cycles 10000
('Dumping tile num: ', 0)
('Dumping tile num: ', 1)
('Dumping tile num: ', 2)
('Dumping tile num: ', 3)
Output Tile dump finished
Success: Hadrware results compiled!!

Running a compiled model

This emulator executes models compiled by PUMA Compiler (https://github.com/illinois-impact/puma-compiler).

After you compile a model using the compiler, in order to execute it with the DPE emulator, follow the steps below:

1- Copy /test/generate-py.sh and /test/input.py files to the /test folder (you only need to do this once).

2- Edit /test/generate-py.sh file, line 4 and change the value of SIMULATOR_PATH variable.

SIMULATOR_PATH="<emulator_root_path>"

3- Execute the generate-py.sh script

4- Look at the number of tiles generated by the compiler for ths model and update the value of "num_tile_compute" entry in /include/config.py file to match the number fo compute tiles generated by compiler (remember that Til0 and Tile1 are used for input and output)

5- Go to emulator src directory (/src) and execute dpe.py:

python2 dpe.py -n <model_name>

Citation

Please cite the following paper if you find this work useful:

  • A. Ankit, I. El Hajj, S. Chalamalasetti, G. Ndu, M. Foltin, R. S. Williams, P. Faraboschi, W.-M. Hwu, J. P. Strachan, K. Roy, D. Milojicic. PUMA: A Programmable Ultra-efficient Memristor-based Accelerator for Machine Learning Inference. In Proceedings of the Twenty-Fourth International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS), 2019.

Authors

Aayush Ankit, Plinio Silveira, Glaucimar Aguiar