Git Product home page Git Product logo

puma-simulator's Introduction

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

puma-simulator's People

Contributors

aayush-ankit avatar dependabot[bot] avatar glaucimar avatar gustahrodrigues avatar izabellaaaq avatar negishubham avatar pliniosilveira avatar rodrigojra avatar yliborio avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

puma-simulator's Issues

python2 dpe.py -n lstm

请问一下执行python2 dpe.py -n lstm的时候会报错,说IOError: [Errno 2] No such file or directory: '/home/sjtuca/puma/puma-simulator/test/testasm/lstm/tile0/tile_imem.npy'.请问这是怎么回事,也找不到25个tile。assert那句话不注释掉会报错,但产生25个tile目录的命令被注释掉了。请问这里是怎么操作的?

About nn2puma.txt

Hi, I noticed the nn2puma.txt file, can anyone tell me what this file is, and how should I emulate this file instruction, thanks.
And what should the instruction format of PUMA-ISA look like, how many registers does the PUMA simulator have, and whether there is any relevant documentation, thank you.

Running full training

Hello, did someone try running a "full training" on panther? If so, can you please list the steps? Thanks!

Out of memory problem when compiling VGG-16 model with the puma-compiler.

Dear Aayush Ankit,

Thank you for your work.

When I compile the VGG-16 model with the puma-compiler, it crashes due to the constantly increasing memory during the 3rd step coalescer, which will finally exceed the physical memory (64GB). But it works fine with the MLP model and single layer test.

The question is:
(1) Is 64GB memory sufficient to compile the VGG-16 model with the puma-compiler?
(2) Is there something wrong with the vgg16.cpp file which will cause the out of memory problem?

Thank you in advance!
Frank.

Generate.py i_mvm Assertion error

Hello,

I've been following how_to_run step by step, however I'm getting assertion erros in i_mvm, I tried to use all of the i_mvm implementations available but all of them give the same error.

Could how to run guide be outdated? Is there any updated versions or forks of the repo?

(.venv) ➜  test git:(master) ✗ bash generate-py.sh
*.puma lstm-layer-tile0-core0.puma lstm-layer-tile0-core1.puma lstm-layer-tile0-core2.puma lstm-layer-tile0-core3.puma lstm-layer-tile0-core4.puma lstm-layer-tile0-core5.puma lstm-layer-tile0-core6.puma lstm-layer-tile0-core7.puma lstm-layer-tile0.puma lstm-layer-tile1-core0.puma lstm-layer-tile1-core1.puma lstm-layer-tile1-core2.puma lstm-layer-tile1-core3.puma lstm-layer-tile1-core4.puma lstm-layer-tile1-core5.puma lstm-layer-tile1-core6.puma lstm-layer-tile1-core7.puma lstm-layer-tile1.puma lstm-layer-tile10-core0.puma lstm-layer-tile10-core1.puma lstm-layer-tile10-core2.puma lstm-layer-tile10-core3.puma lstm-layer-tile10-core4.puma lstm-layer-tile10-core5.puma lstm-layer-tile10-core6.puma lstm-layer-tile10-core7.puma lstm-layer-tile10.puma lstm-layer-tile11-core0.puma lstm-layer-tile11-core1.puma lstm-layer-tile11-core2.puma lstm-layer-tile11-core3.puma lstm-layer-tile11-core4.puma lstm-layer-tile11-core5.puma lstm-layer-tile11-core6.puma lstm-layer-tile11-core7.puma lstm-layer-tile11.puma lstm-layer-tile12-core0.puma lstm-layer-tile12-core1.puma lstm-layer-tile12-core2.puma lstm-layer-tile12-core3.puma lstm-layer-tile12-core4.puma lstm-layer-tile12-core5.puma lstm-layer-tile12-core6.puma lstm-layer-tile12-core7.puma lstm-layer-tile12.puma lstm-layer-tile13-core0.puma lstm-layer-tile13-core1.puma lstm-layer-tile13-core2.puma lstm-layer-tile13-core3.puma lstm-layer-tile13-core4.puma lstm-layer-tile13-core5.puma lstm-layer-tile13-core6.puma lstm-layer-tile13-core7.puma lstm-layer-tile13.puma lstm-layer-tile14-core0.puma lstm-layer-tile14-core1.puma lstm-layer-tile14-core2.puma lstm-layer-tile14-core3.puma lstm-layer-tile14-core4.puma lstm-layer-tile14-core5.puma lstm-layer-tile14-core6.puma lstm-layer-tile14-core7.puma lstm-layer-tile14.puma lstm-layer-tile15-core0.puma lstm-layer-tile15-core1.puma lstm-layer-tile15-core2.puma lstm-layer-tile15-core3.puma lstm-layer-tile15-core4.puma lstm-layer-tile15-core5.puma lstm-layer-tile15-core6.puma lstm-layer-tile15-core7.puma lstm-layer-tile15.puma lstm-layer-tile16-core0.puma lstm-layer-tile16-core1.puma lstm-layer-tile16-core2.puma lstm-layer-tile16-core3.puma lstm-layer-tile16-core4.puma lstm-layer-tile16-core5.puma lstm-layer-tile16-core6.puma lstm-layer-tile16-core7.puma lstm-layer-tile16.puma lstm-layer-tile17-core0.puma lstm-layer-tile17-core1.puma lstm-layer-tile17-core2.puma lstm-layer-tile17-core3.puma lstm-layer-tile17-core4.puma lstm-layer-tile17-core5.puma lstm-layer-tile17-core6.puma lstm-layer-tile17-core7.puma lstm-layer-tile17.puma lstm-layer-tile18-core0.puma lstm-layer-tile18-core1.puma lstm-layer-tile18-core2.puma lstm-layer-tile18-core3.puma lstm-layer-tile18-core4.puma lstm-layer-tile18-core5.puma lstm-layer-tile18-core6.puma lstm-layer-tile18-core7.puma lstm-layer-tile18.puma lstm-layer-tile19-core0.puma lstm-layer-tile19-core1.puma lstm-layer-tile19-core2.puma lstm-layer-tile19-core3.puma lstm-layer-tile19-core4.puma lstm-layer-tile19-core5.puma lstm-layer-tile19-core6.puma lstm-layer-tile19-core7.puma lstm-layer-tile19.puma lstm-layer-tile2-core0.puma lstm-layer-tile2-core1.puma lstm-layer-tile2-core2.puma lstm-layer-tile2-core3.puma lstm-layer-tile2-core4.puma lstm-layer-tile2-core5.puma lstm-layer-tile2-core6.puma lstm-layer-tile2-core7.puma lstm-layer-tile2.puma lstm-layer-tile20-core0.puma lstm-layer-tile20-core1.puma lstm-layer-tile20-core2.puma lstm-layer-tile20-core3.puma lstm-layer-tile20-core4.puma lstm-layer-tile20-core5.puma lstm-layer-tile20-core6.puma lstm-layer-tile20-core7.puma lstm-layer-tile20.puma lstm-layer-tile21-core0.puma lstm-layer-tile21-core1.puma lstm-layer-tile21-core2.puma lstm-layer-tile21-core3.puma lstm-layer-tile21-core4.puma lstm-layer-tile21-core5.puma lstm-layer-tile21-core6.puma lstm-layer-tile21-core7.puma lstm-layer-tile21.puma lstm-layer-tile22-core0.puma lstm-layer-tile22-core1.puma lstm-layer-tile22-core2.puma lstm-layer-tile22-core3.puma lstm-layer-tile22-core4.puma lstm-layer-tile22-core5.puma lstm-layer-tile22-core6.puma lstm-layer-tile22-core7.puma lstm-layer-tile22.puma lstm-layer-tile23-core0.puma lstm-layer-tile23-core1.puma lstm-layer-tile23-core2.puma lstm-layer-tile23-core3.puma lstm-layer-tile23-core4.puma lstm-layer-tile23-core5.puma lstm-layer-tile23-core6.puma lstm-layer-tile23-core7.puma lstm-layer-tile23.puma lstm-layer-tile24-core0.puma lstm-layer-tile24-core1.puma lstm-layer-tile24-core2.puma lstm-layer-tile24-core3.puma lstm-layer-tile24-core4.puma lstm-layer-tile24-core5.puma lstm-layer-tile24-core6.puma lstm-layer-tile24-core7.puma lstm-layer-tile24.puma lstm-layer-tile3-core0.puma lstm-layer-tile3-core1.puma lstm-layer-tile3-core2.puma lstm-layer-tile3-core3.puma lstm-layer-tile3-core4.puma lstm-layer-tile3-core5.puma lstm-layer-tile3-core6.puma lstm-layer-tile3-core7.puma lstm-layer-tile3.puma lstm-layer-tile4-core0.puma lstm-layer-tile4-core1.puma lstm-layer-tile4-core2.puma lstm-layer-tile4-core3.puma lstm-layer-tile4-core4.puma lstm-layer-tile4-core5.puma lstm-layer-tile4-core6.puma lstm-layer-tile4-core7.puma lstm-layer-tile4.puma lstm-layer-tile5-core0.puma lstm-layer-tile5-core1.puma lstm-layer-tile5-core2.puma lstm-layer-tile5-core3.puma lstm-layer-tile5-core4.puma lstm-layer-tile5-core5.puma lstm-layer-tile5-core6.puma lstm-layer-tile5-core7.puma lstm-layer-tile5.puma lstm-layer-tile6-core0.puma lstm-layer-tile6-core1.puma lstm-layer-tile6-core2.puma lstm-layer-tile6-core3.puma lstm-layer-tile6-core4.puma lstm-layer-tile6-core5.puma lstm-layer-tile6-core6.puma lstm-layer-tile6-core7.puma lstm-layer-tile6.puma lstm-layer-tile7-core0.puma lstm-layer-tile7-core1.puma lstm-layer-tile7-core2.puma lstm-layer-tile7-core3.puma lstm-layer-tile7-core4.puma lstm-layer-tile7-core5.puma lstm-layer-tile7-core6.puma lstm-layer-tile7-core7.puma lstm-layer-tile7.puma lstm-layer-tile8-core0.puma lstm-layer-tile8-core1.puma lstm-layer-tile8-core2.puma lstm-layer-tile8-core3.puma lstm-layer-tile8-core4.puma lstm-layer-tile8-core5.puma lstm-layer-tile8-core6.puma lstm-layer-tile8-core7.puma lstm-layer-tile8.puma lstm-layer-tile9-core0.puma lstm-layer-tile9-core1.puma lstm-layer-tile9-core2.puma lstm-layer-tile9-core3.puma lstm-layer-tile9-core4.puma lstm-layer-tile9-core5.puma lstm-layer-tile9-core6.puma lstm-layer-tile9-core7.puma lstm-layer-tile9.puma
generate-py.sh: line 14: $g: ambiguous redirect
('xbar_ip_energy_dict', {'60': 170.00000000000003, '0': 170.00000000000003, '20': 170.00000000000003, '70': 170.00000000000003, '90': 170.00000000000003, '80': 170.00000000000003, '30': 170.00000000000003, '50': 170.00000000000003, '40': 170.00000000000003, '10': 170.00000000000003})
lstm-layer-tile0-core0.puma
('xbar_ip_energy_dict', {'60': 170.00000000000003, '0': 170.00000000000003, '20': 170.00000000000003, '70': 170.00000000000003, '90': 170.00000000000003, '80': 170.00000000000003, '30': 170.00000000000003, '50': 170.00000000000003, '40': 170.00000000000003, '10': 170.00000000000003})
lstm-layer-tile0-core1.puma
('xbar_ip_energy_dict', {'60': 170.00000000000003, '0': 170.00000000000003, '20': 170.00000000000003, '70': 170.00000000000003, '90': 170.00000000000003, '80': 170.00000000000003, '30': 170.00000000000003, '50': 170.00000000000003, '40': 170.00000000000003, '10': 170.00000000000003})
lstm-layer-tile0-core2.puma
('xbar_ip_energy_dict', {'60': 170.00000000000003, '0': 170.00000000000003, '20': 170.00000000000003, '70': 170.00000000000003, '90': 170.00000000000003, '80': 170.00000000000003, '30': 170.00000000000003, '50': 170.00000000000003, '40': 170.00000000000003, '10': 170.00000000000003})
lstm-layer-tile0-core3.puma
('xbar_ip_energy_dict', {'60': 170.00000000000003, '0': 170.00000000000003, '20': 170.00000000000003, '70': 170.00000000000003, '90': 170.00000000000003, '80': 170.00000000000003, '30': 170.00000000000003, '50': 170.00000000000003, '40': 170.00000000000003, '10': 170.00000000000003})
lstm-layer-tile0-core4.puma
('xbar_ip_energy_dict', {'60': 170.00000000000003, '0': 170.00000000000003, '20': 170.00000000000003, '70': 170.00000000000003, '90': 170.00000000000003, '80': 170.00000000000003, '30': 170.00000000000003, '50': 170.00000000000003, '40': 170.00000000000003, '10': 170.00000000000003})
lstm-layer-tile0-core5.puma
('xbar_ip_energy_dict', {'60': 170.00000000000003, '0': 170.00000000000003, '20': 170.00000000000003, '70': 170.00000000000003, '90': 170.00000000000003, '80': 170.00000000000003, '30': 170.00000000000003, '50': 170.00000000000003, '40': 170.00000000000003, '10': 170.00000000000003})
lstm-layer-tile0-core6.puma
('xbar_ip_energy_dict', {'60': 170.00000000000003, '0': 170.00000000000003, '20': 170.00000000000003, '70': 170.00000000000003, '90': 170.00000000000003, '80': 170.00000000000003, '30': 170.00000000000003, '50': 170.00000000000003, '40': 170.00000000000003, '10': 170.00000000000003})
lstm-layer-tile0-core7.puma
('xbar_ip_energy_dict', {'60': 170.00000000000003, '0': 170.00000000000003, '20': 170.00000000000003, '70': 170.00000000000003, '90': 170.00000000000003, '80': 170.00000000000003, '30': 170.00000000000003, '50': 170.00000000000003, '40': 170.00000000000003, '10': 170.00000000000003})
lstm-layer-tile0.puma
('xbar_ip_energy_dict', {'60': 170.00000000000003, '0': 170.00000000000003, '20': 170.00000000000003, '70': 170.00000000000003, '90': 170.00000000000003, '80': 170.00000000000003, '30': 170.00000000000003, '50': 170.00000000000003, '40': 170.00000000000003, '10': 170.00000000000003})
lstm-layer-tile1-core0.puma
('xbar_ip_energy_dict', {'60': 170.00000000000003, '0': 170.00000000000003, '20': 170.00000000000003, '70': 170.00000000000003, '90': 170.00000000000003, '80': 170.00000000000003, '30': 170.00000000000003, '50': 170.00000000000003, '40': 170.00000000000003, '10': 170.00000000000003})
lstm-layer-tile1-core1.puma
('xbar_ip_energy_dict', {'60': 170.00000000000003, '0': 170.00000000000003, '20': 170.00000000000003, '70': 170.00000000000003, '90': 170.00000000000003, '80': 170.00000000000003, '30': 170.00000000000003, '50': 170.00000000000003, '40': 170.00000000000003, '10': 170.00000000000003})
lstm-layer-tile1-core2.puma
('xbar_ip_energy_dict', {'60': 170.00000000000003, '0': 170.00000000000003, '20': 170.00000000000003, '70': 170.00000000000003, '90': 170.00000000000003, '80': 170.00000000000003, '30': 170.00000000000003, '50': 170.00000000000003, '40': 170.00000000000003, '10': 170.00000000000003})
lstm-layer-tile1-core3.puma
('xbar_ip_energy_dict', {'60': 170.00000000000003, '0': 170.00000000000003, '20': 170.00000000000003, '70': 170.00000000000003, '90': 170.00000000000003, '80': 170.00000000000003, '30': 170.00000000000003, '50': 170.00000000000003, '40': 170.00000000000003, '10': 170.00000000000003})
lstm-layer-tile1-core4.puma
('xbar_ip_energy_dict', {'60': 170.00000000000003, '0': 170.00000000000003, '20': 170.00000000000003, '70': 170.00000000000003, '90': 170.00000000000003, '80': 170.00000000000003, '30': 170.00000000000003, '50': 170.00000000000003, '40': 170.00000000000003, '10': 170.00000000000003})
lstm-layer-tile1-core5.puma
('xbar_ip_energy_dict', {'60': 170.00000000000003, '0': 170.00000000000003, '20': 170.00000000000003, '70': 170.00000000000003, '90': 170.00000000000003, '80': 170.00000000000003, '30': 170.00000000000003, '50': 170.00000000000003, '40': 170.00000000000003, '10': 170.00000000000003})
lstm-layer-tile1-core6.puma
('xbar_ip_energy_dict', {'60': 170.00000000000003, '0': 170.00000000000003, '20': 170.00000000000003, '70': 170.00000000000003, '90': 170.00000000000003, '80': 170.00000000000003, '30': 170.00000000000003, '50': 170.00000000000003, '40': 170.00000000000003, '10': 170.00000000000003})
lstm-layer-tile1-core7.puma
('xbar_ip_energy_dict', {'60': 170.00000000000003, '0': 170.00000000000003, '20': 170.00000000000003, '70': 170.00000000000003, '90': 170.00000000000003, '80': 170.00000000000003, '30': 170.00000000000003, '50': 170.00000000000003, '40': 170.00000000000003, '10': 170.00000000000003})
lstm-layer-tile1.puma
('xbar_ip_energy_dict', {'60': 170.00000000000003, '0': 170.00000000000003, '20': 170.00000000000003, '70': 170.00000000000003, '90': 170.00000000000003, '80': 170.00000000000003, '30': 170.00000000000003, '50': 170.00000000000003, '40': 170.00000000000003, '10': 170.00000000000003})
lstm-layer-tile10-core0.puma
('xbar_ip_energy_dict', {'60': 170.00000000000003, '0': 170.00000000000003, '20': 170.00000000000003, '70': 170.00000000000003, '90': 170.00000000000003, '80': 170.00000000000003, '30': 170.00000000000003, '50': 170.00000000000003, '40': 170.00000000000003, '10': 170.00000000000003})
Traceback (most recent call last):
  File "lstm/tile10/lstm-layer-tile10-core0.puma.py", line 49, in <module>
    i_temp = i_mvm(['111111'])
  File "/home/ubuntu22/git-repos/puma/puma-simulator/src/instrn_proto.py", line 113, in i_mvm
    assert (len(xb_nma_list) == cfg.num_matrix) # each matrix in a core has a 3-bit mask
AssertionError
lstm-layer-tile10-core1.puma
('xbar_ip_energy_dict', {'60': 170.00000000000003, '0': 170.00000000000003, '20': 170.00000000000003, '70': 170.00000000000003, '90': 170.00000000000003, '80': 170.00000000000003, '30': 170.00000000000003, '50': 170.00000000000003, '40': 170.00000000000003, '10': 170.00000000000003})
Traceback (most recent call last):
  File "lstm/tile10/lstm-layer-tile10-core1.puma.py", line 53, in <module>
    i_temp = i_mvm(['111111'])
  File "/home/ubuntu22/git-repos/puma/puma-simulator/src/instrn_proto.py", line 113, in i_mvm
    assert (len(xb_nma_list) == cfg.num_matrix) # each matrix in a core has a 3-bit mask
AssertionError
lstm-layer-tile10-core2.puma
('xbar_ip_energy_dict', {'60': 170.00000000000003, '0': 170.00000000000003, '20': 170.00000000000003, '70': 170.00000000000003, '90': 170.00000000000003, '80': 170.00000000000003, '30': 170.00000000000003, '50': 170.00000000000003, '40': 170.00000000000003, '10': 170.00000000000003})
Traceback (most recent call last):
  File "lstm/tile10/lstm-layer-tile10-core2.puma.py", line 53, in <module>
    i_temp = i_mvm(['111111'])
  File "/home/ubuntu22/git-repos/puma/puma-simulator/src/instrn_proto.py", line 113, in i_mvm
    assert (len(xb_nma_list) == cfg.num_matrix) # each matrix in a core has a 3-bit mask

Several AssertionError for generate-py.sh

for all .puma.py there is assertion error.
assert (len(xb_nma_list) == cfg.num_matrix) # each matrix in a core has a 3-bit mask
AssertionError
Traceback (most recent call last):
File "bigLSTM/tile1219/bigLSTM-tile1219-core5.puma.py", line 49, in
i_temp = i_mvm(['111111'])

PUMA-ISA

I saw the PUMA-ISA format in the constants.py, and the paper mentions that the width is 7 bytes, is there a specific placeholder for each operand?

Can I ask some questions about the compiler?

I have also read the code of the PUMA simulator, but I have still some questions about the hardware platforms. May I ask some questions about them?

The most important question is how to calculate the time of one full MVM?
In my point of view, the time of one full MVM = #col_involved * time_adc_once * (#input_bit + 2), is it right?
And how to model the time of writing to and reading from xbars?
Thank you very much!

Unable to run single-layer conv example on PUMA simulator.

I modified the example conv-layer.cpp file to add a binding to the kernel weights as follows:

int main(int argc, char** argv) {

 Model model = Model::create("conv_layer");

 // Process parameters
 unsigned int in_size_x = 14;
 unsigned int in_size_y = 14;
 unsigned int in_channels = 32;
 unsigned int out_channels = 64;
 unsigned int k_size_x = 3;
 unsigned int k_size_y = 3;
 
 // Input stream
 auto in_stream = InputImagePixelStream::create(model, "in_stream", in_size_x, in_size_y, in_channels);

 // Output stream
 unsigned int out_size_x = in_size_x;
 unsigned int out_size_y = in_size_y;
 auto out_stream = OutputImagePixelStream::create(model, "out_stream", out_size_x, out_size_y, out_channels);

 // Layer
 out_stream = conv_layer(model, "", k_size_x, k_size_y, in_size_x, in_size_y, in_channels, out_channels, in_stream);

 // Compile
 model.compile();

 // Bind data
 ModelInstance modelInstance = ModelInstance::create(model);
 float* layer1Weights = new float[k_size_x * k_size_y * in_channels * out_channels];

 //Reading weights from text files
 int i=0;
 std::ifstream wf1;
 wf1.open("conv_layer_weights/wl1.txt");
 while(wf1 >> layer1Weights[i])
 { i++; }
 wf1.close();
 std::cout << "Read " << i << " weights." << std::endl;

 conv_layer_bind(modelInstance, "", layer1Weights);

 //modelInstance.bind("layer" + std::to_string(1) + "mat", layer1Weights);

 modelInstance.generateData();

 // Destroy model
 model.destroy();
 delete[] layer1Weights;

 return 0;
 }

The compilation and code/data generation happen successfully.
But when I run it using the architectural simulator, I get instruction memory overflow error as follows:
Screen Shot 2021-09-20 at 12 19 23 PM

My setup is at least partially correct since I was able to run the fully-connected examples.
I am on the master branch in puma-compiler and training branch in puma-simulator.

Please help me to get the conv examples working. Thanks a lot!

Error when running

I want to test the mlp_l4_mnist model. When I get to the last step I encounter the following error and I don't know how to fix it. Thanks!

python dpe.py -n mlp

error:
image

How to get the inference result?

Hello, I'm trying to use this simulator. I want to know how to get the result of inference, like "mnist_l4_mnist". I'm not very clear about the meaning of “output.txt”.
Thank you!

Error when running the dpe.py

Hi!
I follow the guide to test this.
python dpe.py
But I got an AssertionError:
assert (1==0) # Set instructions cannot write to MVMU storage

Data Memory value dictionary

Hello, can you tell me how to set the specific value of the position of these question marks.

dataMem_lat_dict = {'256' : 1,
'512' : 1,
'1024': 1,
'2048': 1,
'4096': ?, # set
'8192': ?}

dataMem_pow_dyn_dict = {'256' : 0.16,
'512' : 0.24,
'1024': 0.33,
'2048': 0.57,
'4096': ?, # set
'8192': ?}

dataMem_pow_leak_dict = {'256' : 0.044,
'512' : 0.078,
'1024': 0.147,
'2048': 0.33,
'4096': ?, # set
'8192': ?}

dataMem_area_dict = {'256' : 0.00056,
'512' : 0.00108,
'1024': 0.00192,
'2048': 0.00392,
'4096': ?, # set
'8192': ?}

dataMem_lat_dict = {'256' : 1,
'512' : 1,
'1024': 1,
'2048': 1,
'4096': ?,
'8192': ?}

dataMem_pow_dyn_dict = {'256' : 0.16,
'512' : 0.24,
'1024': 0.33,
'2048': 0.57,
'4096': ?,
'8192': ?}

dataMem_pow_leak_dict = {'256' : 0.044,
'512' : 0.078,
'1024': 0.147,
'2048': 0.33,
'4096': ?, # set
'8192': ?}

dataMem_area_dict = {'256' : 0.00056,
'512' : 0.00108,
'1024': 0.00192,
'2048': 0.00392,
'4096': ?, # set
'8192': ?}

How to run an LSTM model?

Hello, I am very confused about how to configure weights for the wlm_bigLSTM model. Can you give me guidance?

problem on finding *.puma files

I have some problem on running the compiler when running "./generate-py.sh" command, i.e. I get "*.puma ./generate-py.sh: line 45: read: read error: 0: Is a directory" which I think it can not find any file with .puma extension.
it requires *.puma files but not found!

vgg16 simulation

Hi, I want to do some work based on puma recently.
I followed "how_to_run.md" to do the tests.
however, when I tested vgg16, I got an error as follows:

('instruction memory size requirement', 50437)
Traceback (most recent call last):
  File "dpe.py", line 231, in <module>
    DPE().run(net)
  File "dpe.py", line 127, in run
    node_dut.node_init(self.instrnpath, self.tracepath)
  File "/work_space/puma-simulator/src/node.py", line 53, in node_init
    self.tile_list[i].tile_init (temp_instrnpath, temp_tracepath)
  File "/work_space/puma-simulator/src/tile.py", line 80, in tile_init
    self.instrn_memory.load (dict_list)
  File "/work_space/puma-simulator/src/ima_modules.py", line 669, in load
    assert (len(dict_list) <= self.size), 'instructions exceed the instruction memory size'
AssertionError: instructions exceed the instruction memory size

Questions about num_inputs

When I change the num_inputs in test/testasm/mlp/input.py, the command "python dpe.py -n mlp" gives the same result. Is this reasonable? why?

Questions about executing VGG-16

Dear Aayush Ankit,

Thank you for your work.

I would like to ask how PUMA is capable of executing models which exceeds PUMA memory capacity.

For example, according to table 3 in PUMA paper, you have in total 4.3125 MB memristor capacity.
However, typical DNNs such as VGG-16 requires 138MB or more.

How PUMA accelerator handle this condition?
In addition, does the throughput simulation includes weight transfer time when executes these models?

Thank you in advance!
Yun-Chen Lo

I see that the fully connected layer uses the bind() function to connect the weight data, but I don’t see a similar function for the convolutional layer(inference). How is the weight data provided for the convolutional layer?

I tried to compile the complete vgg16 network to run on the simulator, but I didn’t see anything about the weights in the vgg16 branch either. I want to know how I should compile the vgg16 network, what is the format of the multi-dimensional weight TXT files, and how should I bind the weights to the compiler? Can you give me some help? Thank you very much!

Reported value units

Can you provide the units for each reported value:

leakage_power: 633.54611067
node_area: 99.4071733152
leakage_energy: 2.06721891623e-05
tile_area: 0.443768888781
core_area: 0.0296594732947
dynamic_energy: 4.72800337861e-05
total_energy: 6.79522229484e-05
average_power: 960.686284315
time: 7.0733e-05
cycles: 70733
peak_power: 9551.59416329
network packet injection rate: 0.000274674783037
number of tiles mapped: 23

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.