Skip to content

Commit a4f5a8f

Browse files
author
Robert Muchsel
authored
Always call cnn_load_bias() even when not using bias (#124)
* Improve error message when running out of bias memory
1 parent bb712b9 commit a4f5a8f

File tree

4 files changed

+12
-5
lines changed

4 files changed

+12
-5
lines changed

README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# MAX78000 Model Training and Synthesis
22

3-
_April 8, 2021_
3+
_April 20, 2021_
44

55
The Maxim Integrated AI project is comprised of four repositories:
66

@@ -257,6 +257,10 @@ By default, the main branch is checked out. This branch has been tested more rig
257257
(ai8x-training) $ git checkout develop
258258
```
259259

260+
###### TensorFlow / Keras
261+
262+
Support for TensorFlow / Keras is currently in the `develop-tf` branch.
263+
260264
##### Updates
261265

262266
After additional testing, `develop` is merged into the main branch at regular intervals.
@@ -728,6 +732,8 @@ The MAX78000 hardware does not support arbitrary network parameters. Specificall
728732

729733
* The number of output channels must not exceed 1024 per layer.
730734

735+
* Bias is supported for up to 512 output channels per layer.
736+
731737
* The number of layers must not exceed 32 (where pooling and element-wise operations do not add to the count when preceding a convolution).
732738

733739
* The maximum dimension (number of rows or columns) for input or output data is 1023.
@@ -817,7 +823,7 @@ The following table describes the most important command line arguments for `tra
817823
| `--pr-curves` | Generate precision-recall curves | |
818824
| `--embedding` | Display embedding (using projector) | |
819825
| *Hardware* | | |
820-
| `--use-bias` | The `bias=True` parameter is passed to the model. The effect of this parameter is model dependent (the parameter is either ignored, effective for some operations, or all operations). | |
826+
| `--use-bias` | The `bias=True` parameter is passed to the model. The effect of this parameter is model dependent (the parameter does nothing, effects some operations, or all operations). | |
821827
| `--avg-pool-rounding` | Use rounding for AvgPool | |
822828
| *Evaluation* | | |
823829
| `-e`, `--evaluate` | Evaluate previously trained model | |

README.pdf

2.49 KB
Binary file not shown.

izer/kbias.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,9 @@ def bias_sort(e):
196196

197197
if group_bias_max[group] + blen > tc.dev.BIAS_SIZE:
198198
eprint(f'Layer {ll}: bias memory capacity exceeded - available groups: '
199-
f'{gmap}, used so far: {group_bias_max}, needed: {blen}, '
200-
f'best available: group {group}.')
199+
f'{gmap}, used so far: {group_bias_max}, needed: {blen} bytes, '
200+
f'best available: group {group} with '
201+
f'{tc.dev.BIAS_SIZE - group_bias_max[group]} bytes available.')
201202
bias_group[ll] = group
202203
for i in range(tc.dev.P_NUMGROUPS):
203204
bias_offs[ll][i] = group_bias_max[group]

izer/toplevel.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,7 @@ def main(
600600
if bias:
601601
memfile.write(' cnn_load_bias();\n')
602602
else:
603-
memfile.write(' // cnn_load_bias(); // Not used in this network\n')
603+
memfile.write(' cnn_load_bias(); // Not used in this network\n')
604604
memfile.write(' cnn_configure(); // Configure state machine\n')
605605
if not measure_energy:
606606
if not fifo:

0 commit comments

Comments
 (0)