Xilinx / gemx

Matrix Operation Library for FPGA https://xilinx.github.io/gemx/
Other
63 stars 21 forks source link

Error: Missing DSA or platform repo. Stop. #1

Open liyb13 opened 6 years ago

liyb13 commented 6 years ago

when I try to compile the gemm project, the following error happens: /tmp/cc8fJfho.s: Assembler messages: /tmp/cc8fJfho.s:318: Error: expecting string instruction after rep' /tmp/cc8fJfho.s:386: Error: expecting string instruction afterrep' /tmp/cc8fJfho.s:6845: Error: expecting string instruction after rep' /tmp/cc8fJfho.s:16931: Error: expecting string instruction afterrep' /tmp/cc8fJfho.s:21658: Error: expecting string instruction after `rep' make: *** [out_host/gemx_host.exe] Error 1

lisaliu1 commented 6 years ago

Which version of SDx are you using? If you compile for vu9pf1, you should use SDx2017.1

lisaliu1 commented 6 years ago

string instruction afterrep' /tmp/cc8fJfho.s:6845: Error: expecting string instruction after rep' /tmp/cc8fJfho.s:16931: Error:

This error is caused by the lower version of binutils you are using. Can you run following command to check which version of binutils you are using. ld -v

Currently we use 2.26, if your version number is lower than that, you might need to upgrade your binutils.

liyb13 commented 6 years ago

Thanks for your help. I have successfully compile the project. I run it on AWS F1 and then get some results. It reports that kernel result does not match the reference.

lisaliu1 commented 6 years ago

Which command did you use to build .xclbin? And how do you test the .xclbin on F1? I will try to see if I can reproduce your results on my side.

liyb13 commented 6 years ago

Thanks for your reply. I did as the README.md (https://github.com/Xilinx/gemx):

Another question: I think "gemx_api_gemm.exe gemx.awsxclbin 512 512 512" means the buffer size of A is 512*512. Then buffer A could store the 512*512*16bit. While the buffer size of A is GEMX_gemmMBlocks*GEMX_ddrWidth x GEMX_gemmKBlocks*GEMX_ddrWidth = 256*256. Should I modify the default values of variables?

lisaliu1 commented 6 years ago

I tried the steps you mentioned, and it works on F1 for me. Can you check following items:

  1. if you copied the generated out_hw/xbinst to the out_hw/ directory on F1?
  2. if you have setup the env correctly? Below is the content of the run.sh I used to run this command source /opt/Xilinx/SDx/2017.1.rte/setup.sh pushd out_hw/xbinst export SDACCEL_TIMELINE_REPORT=true export SDACCEL_DEVICE_PROFILE=true export LD_LIBRARY_PATH=$PWD/../../lib/opencv:$PWD/../../lib:$LD_LIBRARY_PATH GEMX_HOST_DIR=../../out_host GEMX_HW_DIR=../ ${GEMX_HOST_DIR}/gemx_api_gemm.exe ${GEMX_HW_DIR}/gemx.awsxclbin 512 512 512 popd

regarding your question: the 512 512 and 512 mean the value for dimention M, K and N. the matrix multiplication is doing C = A * B, where A has dimension M x K, B has dimension K x N and C has dimension M x N the local buffer size for A, B and C is controlled by the setup of GEMX_gemmMBlocks, GEMX_gemmKBlocks ang GEMX_gemmNBlocks and GEMX_ddrWidth.

liyb13 commented 6 years ago

Thanks for your reply. But I can not find /lib/opencv on aws f1 instance

lisaliu1 commented 6 years ago

you can remove /lib/opencv from the LD_LIBRARY_PATH, it should still work.

liyb13 commented 6 years ago

Thanks. It is declaired that the GEMX supports sparse matrix multiplication. Would you please tell me the detailed procedures to run the simulation and implementation for the sparse mode. Many thanks.

lisaliu1 commented 6 years ago

please sync your master branch with the repository first. After that, please follow the steps below to run cpu emulation for SPMV implementation.

  1. run settings64.sh / settings64.csh to set up the SDx 2017.4 environment
  2. navigate to gemx/
  3. run

make clean

  1. run

make run_cpu_em GEMX_ddrWidth=16 GEMX_argInstrWidth=1 GEMX_numKernels=1 GEMX_runGemv=0 GEMX_runGemm=0 GEMX_runTransp=0 GEMX_runSpmv=1 GEMX_dataType=float GEMX_part=ku115 GEN_BIN_PROGRAM="spmv 96 128 256 none A0 B0 C0 spmv 0 0 0 data/spmv/Rucci1.mtx.gz A1 B1 C1"

if you change "run_cpu_em" to "run_hw_em" and add "HWEMUGUI=1" then you can run hw emulation with GUI to deplay the waveform of the SPMV simulation results.