-
Notifications
You must be signed in to change notification settings - Fork 178
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
[examples] Add Gemmini-baremetal examples and more conv2d examples. #451
base: main
Are you sure you want to change the base?
Conversation
shirohasuki
commented
Jan 16, 2025
- Add Gemmini-baremetal examples for spike and verilator evaluation.
- Add more gemmini conv2d operation examples (like conv-2d-nhwc-fhwc).
…evaluation. 2. Add more gemmini conv2d operation examples.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Giving some quick feedback:
- Missing empty line at the end of the files.
- Please use our
pre-commit
tools:
$ cd buddy-mlir
$ pip install pre-commit
$ pre-commit install
|
||
GEMMINI_EXAMPLE_DIR := ${BUDDY_MLIR_DIR}/examples/GemminiDialect/ | ||
|
||
ELF_CC := riscv64-unknown-elf-gcc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have not seen the E2E example.
Is the remaining E2E C++ error ('_start_main_argv') related to using riscv64-unknown-elf-gcc
(expecting riscv64-unknown-elf-g++
) for end-to-end?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, E2E example still block points at compiling with riscv64-unknown-elf-g++
.
I will try to fix it and follow up with a full version commit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are a few nits to note.Finally, thank you for your contribution.
-relocation-model=pic \ | ||
-o log.o | ||
@${ELF_CC} -O2 -static -specs=htif_nano.specs log.o -o conv-2d-nhwc-fhwc-i8-baremetal | ||
@spike --extension=gemmini conv-2d-nhwc-fhwc-i8-baremetal |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add endline.
outs(%output : memref<1x3x3x1xi8>) | ||
gemmini.print %output : memref<1x3x3x1xi8> | ||
return %0 : i8 | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add endline
outs(%output : memref<1x5x5x1xi8>) | ||
gemmini.print %output : memref<1x5x5x1xi8> | ||
return %0 : i8 | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add endline.
outs(%output : memref<1x3x3x1xi8>) | ||
gemmini.print %output : memref<1x3x3x1xi8> | ||
return %0 : i8 | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add endline.
-relocation-model=pic \ | ||
-o log.o | ||
@riscv64-unknown-linux-gnu-gcc -O2 -static log.o -o a.out | ||
@spike --extension=gemmini pk a.out |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add endline.
[[1],[1],[1],[1],[1],[1],[1]]]]> | ||
|
||
memref.global "private" @kernel : memref<5x5x1x1xi8> = dense<[[[[1]], [[1]], [[1]], [[1]], [[1]]], | ||
[[[1]], [[1]], [[1]], [[1]], [[1]]], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The [
on each line should align with the [
on the previous line.
This looks better.
[[[[1]], [[1]], [[1]], [[1]], [[1]]],
[[[1]], [[1]], [[1]], [[1]], [[1]]],
This pr other examples also have this problem, you need to look at it again, thank you.
|
||
ELF_CC := riscv64-unknown-elf-gcc | ||
PK_CC := riscv64-unknown-linux-gnu-gcc | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PK_CC
or ELF_CC
Is there a better name?
### Hardware Evaluation | ||
Step 1. Execute `make <workload>-run-baremetal` in this folder to generate the baremetal test case. | ||
|
||
Step 2. Copy the generated test case `<workload>-baremetal` to the gemmini workload storage path in the chipyard folder (`chipyard/generators/software/gemmini-rocc-tests/build/`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think maybe copy is not necessary? I'm not sure anymore.