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

add im2col app example #478

Merged
merged 27 commits into from
Apr 22, 2024
Merged

add im2col app example #478

merged 27 commits into from
Apr 22, 2024

Conversation

TommiTerza
Copy link
Contributor

These modifications allow the test, verification and performance analysis of the im2col function, implemented in C code, with the ultimate goal of testing the capabilities of the multichannel DMA.
The python script "verification_script.py" generates a random tensor with configurable channels and dimensions, together with a "golden result" used for the verification of the C code, i.e. the output matrix of the im2col.

Tommaso Terzano added 5 commits April 3, 2024 12:55
The verification script generates both an image and the golden im2col matrix, depending on filter parameters, padding and strides. main.c has been written, needs to be compiled and tested.
Also wrote a script for fast and modular simulation with Verilator
Still gives problems with the verification due to the malloc not working
First stable point of the code
@davideschiavone davideschiavone self-requested a review April 5, 2024 09:27
Tommaso Terzano added 14 commits April 9, 2024 09:23
Still some issues in the python script
Also added tesnorflow support on the verification script for nhwc (to be tested w server). Improved bash script for easy simulation
Fixed cases of padding (ker < pad and ker > pad) with the DMA, fixed multi batch input generation & successful test of multi batch with CPU. To be tested:  multi batch with 1D DMA
Copy link
Contributor

@LuigiGiuffrida98 LuigiGiuffrida98 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How many memory banks are needed to run the application? Maybe it could be better to shrink it to run with only two banks, so that the basic memory configuration can run all the applications.

To run the script to generate the golden values, it is necessary to use packages that are not in core-v-mini-mcu conda environment, or we clearly state that you need pytorch to generate new test samples or I think that this script can be used just by Tommaso to generate the values once. If we want to generate a new set of random values for every run, it can be useful to add the run of the script to an application specific makefile.

sw/applications/example_im2col/main.c Outdated Show resolved Hide resolved
sw/applications/example_im2col/im2colGolden.c Show resolved Hide resolved
sw/applications/example_im2col/im2col_lib.c Outdated Show resolved Hide resolved
sw/applications/example_im2col/im2col_lib.c Outdated Show resolved Hide resolved
sw/applications/example_im2col/im2col_lib.c Outdated Show resolved Hide resolved
sw/applications/example_im2col/im2col_lib.c Outdated Show resolved Hide resolved
Copy link
Contributor

@LuigiGiuffrida98 LuigiGiuffrida98 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've executed the code on the pynq-z2 and it works even with the minimal configuration (2 BANKS), after these last updates it can be merged.

@davideschiavone please enable the CI checks on this PR so that we can check either there that everything works.

sw/applications/example_im2col/im2colGolden.c Show resolved Hide resolved
sw/applications/example_im2col/main.c Show resolved Hide resolved
sw/applications/example_im2col/im2col_lib.h Outdated Show resolved Hide resolved
sw/applications/example_im2col/main.c Show resolved Hide resolved
sw/applications/example_im2col/im2col_lib.c Outdated Show resolved Hide resolved
@davideschiavone davideschiavone changed the title im2col C implementation for performance analysis and DMA verification add im2col app example Apr 20, 2024
@davideschiavone davideschiavone merged commit 1a90890 into esl-epfl:main Apr 22, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants