Skip to content

Commit

Permalink
Refactor unit test data generation (ARM-software#121)
Browse files Browse the repository at this point in the history
- Separate development in refactored_test_gen during migration period
- Initial support for lstm unit tests
  • Loading branch information
AdrianLundell authored Mar 25, 2024
1 parent 2e5dcdc commit 6e8256a
Show file tree
Hide file tree
Showing 10 changed files with 1,539 additions and 0 deletions.
27 changes: 27 additions & 0 deletions Tests/UnitTest/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ FVP_Corstone_SSE-300_Ethos-U55 --cpulimit 2 -C mps3_board.visualisation.disable-
```

## Generating new test data
**NOTE:** The data generation scrips are being reworked, see *Refactoring of generate_test_data*

Generating new test data is done with the following script. Use the -h flag to get more info.

Expand All @@ -135,6 +136,31 @@ This test is depending on tflite_micro for its reference data. This is because t

Note that tflite_micro interpreter is currently only supported for SVDF and LSTM.

### Refactoring of generate_test_data.py
Test data generation is in progress of incrementally moving over to the cleaned up scripts placed in `RefactoredTestGen`.

To try out the new scripts, use
```
./RefactoredTestGen/generate_test_data.py --help
```

The previous generate_test_data will remain as the main data generator until all functionality is replicated with the new scripts.

Current progress:

| Operator | Old | New | Notes
| --- | --- | --- | ---
| convolution | x | |
| fully_connected | x | |
| lstm | x | x | Only new version supporting 16x8
| svdf | x | |
| softmax | x | |
| avgpool | x | |
| maxpool | x | |
| add | x | |
| mul | x | |


## Overview of the Folders

- `Corstone-300` - These are dependencies, like linker files etc, needed when building binaries targeting the FVP based on Arm Corstone-300 software. This is mostly taken from Arm Ethos-U Core Platform project.
Expand All @@ -148,6 +174,7 @@ Note that tflite_micro interpreter is currently only supported for SVDF and LSTM
- `TestCases/<cmsis-nn function name>/Unity/TestRunner` - This folder will contain the autogenerated Unity test runner.
- `TestCases/TestData` - This is auto generated test data in .h files that the unit tests are using. The data in PregenrateData folder has fp32 data of a network whereas here it is the quantized equivalent of the same. They are not the same. All data can regenerated or only parts of it (e.g. only bias data). Of course even the config can be regenerated. This partial/full regeneration is useful during debugging.
- `TestCases/Common` - Common files used in test data generation is placed here.
- `RefactoredTestGen` - Temporary location for new test generation scripts

## Formatting

Expand Down
Loading

0 comments on commit 6e8256a

Please sign in to comment.