ralc88 / riscv-vectorized-benchmark-suite Goto Github PK
View Code? Open in Web Editor NEWRiVEC Bencmark Suite
License: Other
RiVEC Bencmark Suite
License: Other
Benchmarks currently known to be not working with 1.0 branch with CAS LLVM Compiler and Spike
canneal
jacobi-2d
particle filter
swaptions
Errors related to stores and mmap.
_blackscholes/src/blackscholes.cpp
#ifdef ERR_CHK
printf("Num Errors: %d\n", numError);
#endif
Can I define ERR_CHK
macro at the beginning of the source code and expect the error to be equal to 0?
#define ERR_CHK
// RISC-V VECTOR Version by Cristóbal Ramírez Lazo, "Barcelona 2019"
...
branch: rvv-1.0
Hello everyone,
First of all, thanks for your great job! :-)
I am working on a custom implementation of the RiVEC benchmark suite to be run on spike
and our vector processor Ara (https://github.com/pulp-platform/ara).
I was porting lavaMD
, and I found an issue:
Preamble:
The scalar kernel is updating multiple times the same memory location fA[i].v
, for 0 <= i < NUMBER_PAR_PER_BOX
, within the same box (i.e., j
is constant).
The fA
pointer changes its base value only when the variable j
changes; for the rest of the time, it points to the same address (i.e., fA
remains constant when operating within the same box).
Since for different k
(neighbours) and same j
(box), the i
assumes every value in the range 0 <= i < NUMBER_PAR_PER_BOX
multiple times, then each fA[i].v
is an accumulator. This is also valid for the .x
, .y
, and .z
components.
https://github.com/RALC88/riscv-vectorized-benchmark-suite/blob/master/_lavaMD/kernel/kernel_cpu.c#L183
Issue:
In the vector version instead, each fA[i].v
does not behave as an accumulator. For example, with i == 0
, fA[0].v
is written with a vector store 1+box[l].nn
times, but the previous value is never read back to be accumulated.
When k
changes and i
starts its sweep again from 0
, the scalar accumulators for the reductions are zeroed as well.
https://github.com/RALC88/riscv-vectorized-benchmark-suite/blob/master/_lavaMD/kernel/kernel_vector.c#L201
Therefore, the value in memory is never accumulated, but only overwritten.
https://github.com/RALC88/riscv-vectorized-benchmark-suite/blob/master/_lavaMD/kernel/kernel_vector.c#L258
Example:
Let's suppose that we have only one box, so l == 0
always.
When k == 0
, we will have sweep with i
and j
.
When i == 0
, we sweep on j
, and then we store fA[0].v
, accumulating all the different contributions from the j
sweep.
i
Will also sweep until the end, and we will save to memory all the fA[i].v
, accumulating each contribution from the j
sweeps.
Up to here, both the scalar and the vector programs work correctly.
Then, k == 1
. At this point, we should repeat everything, and we only change rB
and qB
base addresses.
fA
, instead, keeps pointing to the same location as before.
Therefore, we will sweep on i
and j
, and when i == 0
, for example, we will need to accumulate again on fA[0].v
, starting from its last value in memory.
The vector program does not do it, and just overwrite the values in memory, without accumulating when k
changes.
I found the problem when I checked with Spike if the scalar and vector versions of lavaMD
could produce the same results.
They could not, from my side. Have you tried to check if the results are the same?
An easy fix would be pulp-platform/ara@89215a1
Thanks a lot,
Matteo
The makefiles here assume that the epi compiler is set up. Can you provide instructions on how to set it up
Looks like quite a long time since the last update of this repository. It looks a little bit out of date. I have tried one of the benchmarks, looks like the intrinsic API has sorts of changes according to gnu toolchain
and llvm
. Could you please help to insight me the support status of this repository, especially for the RVV 1.0 branch?
Thanks a lot.
when I use llvm from PLTC (https://github.com/plctlab/llvm-project) compile the RVV benchmark(https://github.com/RALC88/riscv-vectorized-benchmark-suite/tree/rvv-1.0)
it can't find argument '-mepi'.
My steps are as follows:
compile and install the llvm
export RISCV=~/opt/riscv-vector
git clone https://github.com/plctlab/llvm-project.git
cd llvm-project-rvv-iscas
mkdir build
cd build
cmake -G "Unix Makefiles"
-DLLVM_TARGETS_TO_BUILD="RISCV"
-DCMAKE_INSTALL_PREFIX=$RISCV
-DCMAKE_BUILD_TYPE=Release
-DLLVM_USE_LINKER=gold
-DLLVM_ENABLE_PROJECTS="clang;libcxx;libcxxabi;lld" ../llvm
make -j12
make install
compile the rvv benchmark
git clone https://github.com/RALC88/riscv-vectorized-benchmark-suite.git
cd riscv-vectorized-benchmark-suite
export LLVM=/opt/riscv-vector
export PATH=$PATH:/opt/riscv-vector/bin
make all
The following error is generated during the compilation process:
xxx/bin/clang --target=riscv64-unknown-elf -march=rv64g -O2 -c -o src/utils.o src/utils.c
src/utils.c:1:10: fatal error: 'math.h' file not found
clang-12: error: unknown argument: '-mepi'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.