Git Product home page Git Product logo

gemmini-rocc-tests's Introduction

Quickstart

  1. Clone submodules:
    git submodule update --init --recursive
  2. Build the tests in this repo:
    ./build.sh

The tests' binaries will be installed in build/. The tests whose source code can be found in bareMetalC/ will be installed in build/bareMetalC/, the tests in imagenet/ will be installed in build/imagenet/, and so forth.

To run the tests yourself on a Gemmini ISA simulator, follow these steps:

  1. Install esp-isa-sim. If you are using Chipyard, then running ./scripts/build-toolchains.sh esp-tools from Chipyard's root directory will install it for you. The ISA simulator is called spike.
  2. Run test programs on spike:
    cd build/bareMetalC
    spike --extension=gemmini mvin_mvout-baremetal

Writing Your Own Gemmini Tests

bareMetalC/template.c is a template Gemmini test that you can base your own Gemmini tests off of. To write your own Gemmini test, run:

cp bareMetalC/template.c bareMetalC/my_test.c

Then, add my_test to the tests list at the top of bareMetalC/Makefile. Afterwards, running ./build.sh will install my_test-baremetal in build/bareMetalC.

gemmini-rocc-tests's People

Contributors

alonamid avatar ameerhajali avatar curiousdragon avatar hngenc avatar jerryz123 avatar pranav-prakash avatar richardyrh avatar rogerhh avatar seahk avatar seldridge avatar vighneshiyer avatar zhemao avatar zitaofang 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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

gemmini-rocc-tests's Issues

tiled_conv_dw wrong implementation

the function tiled_conv_dw in gemmini.h produces wrong output. Seems like the input pointer is incorrectly updated. A simple test case like : input with shape 1x2x4x4 (Batch dim, Channel dim, H, W) depth-wise convolving with 1x2x3x3 kernel will show this.: ex

     // input 
    static elem_t cnn_convd_1_in[4*4][2] row_align(1) = {{{1,1},{0,1},{1,0},{1,0},
                                                         {0,0},{0,1},{0,0},{1,0},
                                                         {1,0},{0,1},{0,0},{1,0},
                                                         {1,0},{0,1},{0,0},{1,0}},;
     // weight 

    static const elem_t cnn_convd_1_w_flat[3*3][2] row_align(1) = {{1,1},{1,1},{1,1},
                                                                   {1,1},{1,1},{1,1},
                                                                   {1,1},{1,1},{1,1}};

PS: the CPU version (conv_dw) of this function is working correctly tho.

Execution stall on boom

I am trying architectures with a Large Boom and a 4x4 dummy Gemmini, but it does not execute.

I have compiled the test for the gemmini_params.h file generated when generating the architecture and it works fine on a Rocket + 4x4 Gemmini.

But when executing it on Boom I have issues.
It just does not say anything about mlockall even if I run it without root permission and the test does not progress.
It just shows a debug info I printed after the mlockall and before the gemmini_flush.

Transformer spike error

Hi, I tried to run spike on the transformer code, but I got the following error:
spike: ../gemmini/gemmini.cc:367: void gemmini_t::config(reg_t, reg_t): Assertion `false' failed.

my gemmini branch is v0.6.4, the shipyard is at 117624d8, and the gemmini-rocc-test is bert-softmax-hasan.
I could run spike successfully for other applications such as resnet50 and mobilenet, but I got the error for the transformer.

Thanks in advance for the help.

Add support Squeezenet

Hello,

Would it be possible for you to add a test for squeezenet? I mean like the ones for mobilenet and resnet50 on the imagenet folder.
Maybe the parameter file of squeeznet is not so big and you can upload it.

Thank you.

Convolution Data Layout NHWC vs. NCHW

Moin,

the tiled_conv_auto function from gemmini.h expects the inputs to be in NHWC and the weights to be in KhKwIO format, but the standard layout in PyTorch is NCHW for input/output tensors and OIKhKw for the weights.
Right now for testing I manually permute my input data to match the format expected by Gemmini which works, but it causes significant overhead so I was wondering how difficult it would be to make this a variable parameter?

I tried modifying the following lines in gemmini.h:

const elem_t * weights_slice = weights + (poch*kernel_dim*in_channels + kch*in_channels + krow_) * out_channels + kcol_;
[...]
const elem_t * in = input + (b*in_dim*in_dim + kch*in_channels  + ((irow+upad)>>input_dilated)) * in_dim  + ((icol+lpad)>>input_dilated);

But it does not work, I would appreciate any input on this
Best Regards

Gemmini 8x8

Hello,

Is this prepared for any dimension of gemmini?
I was able to run it on a Rocket + 16x16 Gemmini.
But now I am trying to run it on a Rocket + 8x8 Gemmini and I am having issues.
It executes fine if I select the cpu mode, but when using the default parameters (ws and conv) it gets stucked after matmul 5.

I compiled it for linux with riscv64-unknown-linux-gcc and it is running on a debian.

how to execute this programs

I am sorry this may seem childish, but can i know steps how to run this c programs, what i need to install to run and learn about risc-v and gemmini... thanks.

Run test programs failed

Hi, I have finished the compilation of esp-tools version of risc-v toolchian and gemmini-rocc-tests. But when i follow the instrucion to run spike --extension=gemmini mvin_mvout-baremetal, the result is failed and the Matrix 0 output are all zeros. I have also tried conv-baremetal and resnet50-baremetal, mobilenet-baremetal that located in imagenet folder, all the results are zeros, too.
Here are my steps:
1 git clone https://github.com/ucb-bar/chipyard.git
2 in chipyard folder ./scripts/init-submodules-no-riscv-tools.sh
3 ./scripts/build-toolchains.sh esp-tools
4 source ./env.sh
5 go to generators/gemmini/software/gemmini-rocc-tests and run git submodule update --init --recursive
6 ./build.sh
7 go to build/bareMetalC and run spike --extension=gemmini mvin_mvout-baremetal
Here is the result of mvin_mvout-baremetal.

Gemmini extension configured with:
    dim = 16
Matrix 0:
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 
112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 
-128 -127 -126 -125 -124 -123 -122 -121 -120 -119 -118 -117 -116 -115 -114 -113 
-112 -111 -110 -109 -108 -107 -106 -105 -104 -103 -102 -101 -100 -99 -98 -97 
-96 -95 -94 -93 -92 -91 -90 -89 -88 -87 -86 -85 -84 -83 -82 -81 
-80 -79 -78 -77 -76 -75 -74 -73 -72 -71 -70 -69 -68 -67 -66 -65 
-64 -63 -62 -61 -60 -59 -58 -57 -56 -55 -54 -53 -52 -51 -50 -49 
-48 -47 -46 -45 -44 -43 -42 -41 -40 -39 -38 -37 -36 -35 -34 -33 
-32 -31 -30 -29 -28 -27 -26 -25 -24 -23 -22 -21 -20 -19 -18 -17 
-16 -15 -14 -13 -12 -11 -10 -9 -8 -7 -6 -5 -4 -3 -2 -1 
Matrix 0 output:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 

*** FAILED *** (tohost = 1)

So what's wrong with my steps? Thanks for helping.

Improvement: Provide static typed function implementations in gemmini.h?

Currently, the datatype of the software program is determined at compile time by the typedefs in gemmini_params.h:

typedef int8_t elem_t;
static const elem_t elem_t_max = 127;
static const elem_t elem_t_min = -128;
typedef int32_t acc_t;
typedef int64_t full_t;

However, this does not work if in a single design, we wish to run multiple gemmini program with different datatypes (for example, running fp32 and fp16 in a single program).

Hence, is it possible to provide a set of statically typed function routines, so the software can use the corresponding function for each datatype? (e.g. providing tiled_matmul_auto_f16, tiled_matmul_auto_f32, tiled_matmul_auto_i8 in addition to the default tiled_matmul_auto?)

To maintain backward compatibility, we can still typedef or macro define the elem_t to be a certain type, and let the compiler handle the function selection process in the default tiled_matmul_auto.

alexnet_params.h not found

In the imagenet directory is a alexnet.c which I would like to compile. However, the ? alexnet_params.h and alexnet_images.h are missing from that directory, and due to that, the compilation of AlexNet fails. Is it possible to get the header files for AlexNet?

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.