Xilinx / Vitis_Libraries

Vitis Libraries
https://docs.xilinx.com/r/en-US/Vitis_Libraries
Apache License 2.0
883 stars 354 forks source link

[SPARSE] L2/benchmarks/spmv_double hangs when using float instead of double #161

Open fedefavaro opened 1 year ago

fedefavaro commented 1 year ago

Hi, I'm trying to run the spmv_double benchmark using single precision floating point. To achieve this I modified some parameters in the Makefile, as follows: SPARSE_dataType: double --> float SPARSE_parEntries: 4 --> 8 SPARSE_dataBits: 64 --> 32 The project compiles fine for the Alveo U280 card (TARGET=hw) but when I try to run it on the board it hangs. I'm using Vitis 2022.2, platform xilinx_u280_gen3x16_xdma_1_202211_1 and Vitis_Libraries master branch.

fedefavaro commented 1 year ago

I've realized that the data generation python scripts under sparse/L2/tests/fp64/spmv/python must be configured according to the new parameters. However, these scripts don't allow the configuration of the datatype. I've tried to manually change them to work with single precision but when I run the kernel it doesn't work. In the first run, all output is zero, and in subsequent runs, it hangs.

fedefavaro commented 1 year ago

Found the problem. In rowAcc, as parameters are grouped and send via the datapath, this sets a limit in the size of the data. There are 3 parameters of 16 bits each, which do not fit in the 32 bits of a float. There are assertions in place to warn of this limitation, but as sw emulation is not working on this benchmark they do not trigger. Solved it temporarily by adding a separate stream for the parameters.