Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated PR with changes for homogeneous ADC precision, constant file #45

Open
wants to merge 48 commits into
base: training
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
a52a2da
dictionary values for all xb sizes added
May 21, 2020
8538983
default values added
May 27, 2020
73e503b
bash scripts added in gitignore
May 27, 2020
bc0d212
changed back to previous version
May 27, 2020
4980210
assertion added for data width
Jun 1, 2020
67baf94
Merge branch 'cnn-support' into training
Jun 1, 2020
4a5f327
pdb import removed
Jun 1, 2020
11a8941
xbar inner product updated with inference flag
Jun 9, 2020
0066d44
data fetched form ramload appended with dummy values
Jun 9, 2020
e94e38d
num acces uncommented in propagate dummy function for adc cost
Jun 9, 2020
11ac159
config cnn updated for homogenous adc precision
Jun 9, 2020
8277bfb
default adc precision updated
Jun 9, 2020
eabb62b
config mlp updated for homogenous adc precision
Jun 9, 2020
bad1c20
print removed from tile modules
Jun 9, 2020
c2eb630
comment removed
Jun 9, 2020
7b86549
key updates
Jun 11, 2020
f76b984
commented memory number removed
Jun 17, 2020
e756653
homogenous and heterogenous adc support added
Jun 17, 2020
2cd8576
constants file for 128 xb
Jun 17, 2020
9141dda
constants file for all xb size added
Jun 17, 2020
d1ff703
how to run updated for quantization steps
Jun 17, 2020
ca76069
how to run updated for quantization steps
Jun 17, 2020
31cf145
commment added
Jun 17, 2020
93211d9
dummy config file deleted
Jun 17, 2020
9ede1ee
dummy constants file deleted
Jun 17, 2020
ad42997
merge conflict removed
Jun 17, 2020
22b962b
default constants file added
Jun 17, 2020
5f17687
updated
Jun 17, 2020
afec543
updated
Jun 17, 2020
e824542
updated with changes for digital version
Jun 17, 2020
8783d0c
default config for 128 xb
Jun 17, 2020
8a8bd2f
default constants for 128 xb
Jun 17, 2020
fd136b3
config with default analog values
Jun 17, 2020
49feb75
config with default analog values
Jun 17, 2020
e9cfe2d
changes adapted from digital version
Jun 17, 2020
c3ba14f
change adapted from digital repo
Jun 17, 2020
85a5551
config file updated
Mar 22, 2021
dff4c38
config file updated
Mar 22, 2021
9d9f2ee
constants file updated for crossbar sizes
Mar 22, 2021
b0dcc03
core and tile cntrl cycle updated
Mar 22, 2021
fb6112e
ima updates
Mar 22, 2021
8cdcd84
tile module update
Mar 22, 2021
12e1349
conv layer model for stride updated
Mar 22, 2021
e97f5fe
config file
May 10, 2021
a42be9f
config file
May 10, 2021
31a7d60
config file
May 10, 2021
3b4fbf4
comments removed from configs
May 10, 2021
e223699
comments removed from configs
May 10, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions how_to_run.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,11 @@ num_tile_compute = 23 # number of tiles mapped by dnn (leaving input and output
# Do not change this - total number of tiles
num_tile = num_node * num_tile_compute + 2 # +1 for first tile (I/O tile) - dummy, others - compute -- (Line 95)
```
#### 6.2 - Setup constants file:

Use the appropriate constants file from ```puma-simulator/include/example-constants/(constant file name)```
For example: for 128x128 crossbar use ```constants-128.py```
Copy the file to ```puma-simulator/include/``` and rename it to ```constants.py```

### 7. Run your model, in this example, the ```lstm-layer.cpp```:

Expand Down Expand Up @@ -185,3 +190,12 @@ number of tiles mapped: 23
### 10. To run Regression tests after running with weights for inference, go to simulator/test/val.

```python reg_test_1.py -n mlp```

### 11. Quantization:
Change the ```input_prec``` and ```weight_width``` parameters in config file to see the effects of quantization.

```
# Input and Weight parameters
input_prec = 16
weight_width = 16
```
20 changes: 12 additions & 8 deletions include/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
xbar_record = 1
inference = 1
training = not(inference)
sparse_opt = 1 # Flag for Sparsity optimisaton (Make it 0 for only dense computations)
sparse_opt = 0 # Flag for Sparsity optimisaton (Make it 0 for only dense computations)

## Variable to define the type of MVMU
# One of "Analog", "Digital_V1" or "Digital_V2"
Expand Down Expand Up @@ -35,7 +35,7 @@
# Fixed parameters
addr_width = 22 # Added to address larger address space for conv layers (#TODO: Compiler needs to fix shared memory reuse)
data_width = num_bits # (in bits)
xbdata_width = data_width # (in bits)
xbdata_width = data_width # (in bits), equivalent to input_prec
instrn_width = 48 # (in bits)
# Input and Weight parameters
input_prec = 16
Expand All @@ -50,15 +50,19 @@
num_adc_per_matrix = 2
num_adc = num_adc_per_matrix * num_matrix

#uncomment this line for homogeneous ADC precision
adc_res_new ={}

#uncomment adc_res_new for heterogenous adcs
# The idea is to have different ADC resolution value for each ADC.
# The number of ADC if defined by num_adc property. Currently it is 2 * num_matrix(2) = 4
# NOTE: Only taking in account indexes 0 and 2, 1 and 3 are ignored, because ADCs 1 and 3 are assumed t be equal to 0 and 2.
adc_res_new = {
'matrix_adc_0' : 8,
'matrix_adc_1' : 4,
'matrix_adc_2' : 8,
'matrix_adc_3' : 4
}
#adc_res_new = {
# 'matrix_adc_0' : 8,
# 'matrix_adc_1' : 4,
# 'matrix_adc_2' : 8,
# 'matrix_adc_3' : 4
# }

num_ALU = num_matrix*2
#dataMem_size = num_matrix*(6*xbar_size) # 4 for 4 input spaces within matrix (1 for f/b each, 2 for d)
Expand Down
Loading