You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The kernel conv2d_3x3_unrolled2_i8_xpulpv2 from software/runtime/xpulp/conv_2d.h used in the application software/apps/onv2d_i8/main.c will result in out of bounds memory accesses. This was discovered by running the benchmark in the hardware folder with snitch_tracing enabled. The trace will contain X values which hardware/scripts/gen_trace.py cannot handle at the moment.
Steps to reproduce problem:
In hardware/Makefile set snitch_trace?=1 (l. 49) and change l. 271 to benchmark: log simcvcs.
In software/runtime/crt0.S replace l.88-89 with wfi. (This step might be optional)
In the software folder, run make apps xpulpimg=1 config=mempool.
If necessary, do unset CC && unset CXX. In the hardware folder, run make benchmark config=mempool xpulpimg=1 app=conv2d_i8.
--> this will result in hardware/scripts/gen_trace.py failing
TRACE: python3 /scratch/bsc22f8/git/oswaldlo1/mempool/hardware/scripts/gen_trace.py -p --csv build/traces/results.csv build/traces/trace_hart_0x0000 > build/trace_hart_0x0000.trace Traceback (most recent call last): File "/scratch/bsc22f8/git/oswaldlo1/mempool/hardware/scripts/gen_trace.py", line 910, in <module> sys.exit(main() File "/scratch/bsc22f8/git/oswaldlo1/mempool/hardware/scripts/gen_trace.py", line 828, in main args.permissive) File "/scratch/bsc22f8/git/oswaldlo1/mempool/hardware/scripts/gen_trace.py", line 541, in annotate_insn permissive) File "/scratch/bsc22f8/git/oswaldlo1/mempool/hardware/scripts/gen_trace.py", line 374, in annotate_snitch int_lit(extras['ld_result_32']))) KeyError: 'ld_result_32' make[1]: *** [build/trace_hart_0x0000.trace] Error 1
When looking at the end of the file hardware/build/trace_hart_0x0000.trace it is clear that the last few instructions try to load values from an out of bound address 0x0040400. The address is defined in software/bin/conv2d_i8.dump as <out>.
Further when looking in hardware/build/trace_hart_0x0000.dasm and searching for the number in the first column of trace_hart_0x0000.trace where the problem occurs, one can find values which contain X's. These are the reason why gen_trace.py fails.
The kernel
conv2d_3x3_unrolled2_i8_xpulpv2
fromsoftware/runtime/xpulp/conv_2d.h
used in the applicationsoftware/apps/onv2d_i8/main.c
will result in out of bounds memory accesses. This was discovered by running the benchmark in the hardware folder with snitch_tracing enabled. The trace will contain X values whichhardware/scripts/gen_trace.py
cannot handle at the moment.Steps to reproduce problem:
In
hardware/Makefile
setsnitch_trace?=1
(l. 49) and change l. 271 tobenchmark: log simcvcs
.In
software/runtime/crt0.S
replace l.88-89 withwfi
. (This step might be optional)In the
software
folder, runmake apps xpulpimg=1 config=mempool
.If necessary, do
unset CC && unset CXX
. In thehardware
folder, runmake benchmark config=mempool xpulpimg=1 app=conv2d_i8
.--> this will result in
hardware/scripts/gen_trace.py
failingTRACE:
python3 /scratch/bsc22f8/git/oswaldlo1/mempool/hardware/scripts/gen_trace.py -p --csv build/traces/results.csv build/traces/trace_hart_0x0000 > build/trace_hart_0x0000.trace
Traceback (most recent call last):
File "/scratch/bsc22f8/git/oswaldlo1/mempool/hardware/scripts/gen_trace.py", line 910, in <module> sys.exit(main()
File "/scratch/bsc22f8/git/oswaldlo1/mempool/hardware/scripts/gen_trace.py", line 828, in main args.permissive)
File "/scratch/bsc22f8/git/oswaldlo1/mempool/hardware/scripts/gen_trace.py", line 541, in annotate_insn permissive)
File "/scratch/bsc22f8/git/oswaldlo1/mempool/hardware/scripts/gen_trace.py", line 374, in annotate_snitch int_lit(extras['ld_result_32'])))
KeyError: 'ld_result_32'
make[1]: *** [build/trace_hart_0x0000.trace] Error 1
When looking at the end of the file
hardware/build/trace_hart_0x0000.trace
it is clear that the last few instructions try to load values from an out of bound address0x0040400
. The address is defined insoftware/bin/conv2d_i8.dump
as<out>
.Further when looking in
hardware/build/trace_hart_0x0000.dasm
and searching for the number in the first column oftrace_hart_0x0000.trace
where the problem occurs, one can find values which contain X's. These are the reason whygen_trace.py
fails.@SamuelRiedel
The text was updated successfully, but these errors were encountered: