ecolab-nus / morpher

An Open-Source Tool for CGRA Accelerators
MIT License
52 stars 7 forks source link

microspeech_1 test error #11

Open neulxf opened 1 year ago

neulxf commented 1 year ago

The command: python -u run_morpher.py woset_benchmarks/microspeech_1/microspeech.c microspeech_conv_layer_hycube config/microspeech_hycube_m m_0.yaml

The result:

image

odarcy1 commented 1 year ago

I get the very same issue with the array_add example, hycube simulator fails the same assertion

odarcy1 commented 1 year ago

ok so I digged a little more, and the error you are getting when invoking Hycube simulator is due to the fact that it is given as argument -c *.bin which in my case does not exist, so hycube simulator errors out with assertion that it can't open the cmem file.

The cmem file (*.bin) should have been generated in a previous step, which is what I am going to dig next to understand why the cmem file did not get generated

neulxf commented 1 year ago

I pass the array_add example, but in the microspeech_1 test, the Mapper can not generate the cmem file(*.bin), so the Hycube simulator error

odarcy1 commented 1 year ago

Ok, so I rebuilt everything from scratch, and now for the array_add example the mapper is able to generate the cmem file (*.bin) but it fails further in the hycube simulation. See below, there is a STORE instruction that fails an asseertion because the operand2 is not aligned on 4 bytes.

hycube_simulator: /home/odarcy/morpher/hycube_simulator/src/CGRATile.cpp:947: DataType HyCUBESim::CGRATile::store(DataType, DataType, int): Assertion `op2 % 4 == 0' failed. Aborted (core dumped) 0%| | 0/1 [00:00<?, ?it/s] Traceback (most recent call last): File "run_morpher.py", line 218, in main(csource, function) File "run_morpher.py", line 192, in main f = open("sim_result.txt", "r") FileNotFoundError: [Errno 2] No such file or directory: 'sim_result.txt'

odarcy1 commented 1 year ago

I found in the Hycube source code that if you set environment variable SIMULATOR in your shell prior to running hycube simulator, you get a detailed execution log, here is what I see at the end, indeed there is a STORE operation with in2 = 42 which is not 4 byte aligned... :

---------------execute new instruction ---------------------------- current PC = 1,LER=4,LSR=1 kII =17,PC =1,y=0,x=0 RegInfo :: P=INV,I1=655360,I2=42,R0=INV,R1=INV,R2=INV,R3=INV,RES=INV currIns :: NPB=0,OP=STORE,CONSTVALID=0,CONST=0 ,BYP_R0=1,BYP_R1=1,BYP_R2=1,BYP_R3=1 ,REN_R0=0,REN_R1=0,REN_R2=0,REN_R3=0,tregwen=0 ,XB_P=INV,XB_I1=INV,XB_I2=INV,XB_NORTH=INV,XB_EAST=INV,XB_WEST=INV,XB_SOUTH=INV print ins end : STORE,655360,42 hycube_simulator: /home/o00244506/morpher/hycube_simulator/src/CGRATile.cpp:947: DataType HyCUBESim::CGRATile::store(DataType, DataType, int): Assertion `op2 % 4 == 0' failed.

neulxf commented 1 year ago

I get the same issue when I build the Moroher in ubuntu22.04, but when build with Dockerfile, there is no issue, I guess the reason is that the compiler used version is different

odarcy1 commented 1 year ago

Yes, with the dockerfile, it works for me too, the array_add example/tutorial passes. But I also recently found out that in my own environment, it works too, array_add example passes. The thing the you must NOT DO even if the README file tells you to is this line:

Pull the code clone first: git clone --recurse-submodules https://github.com/ecolab-nus/Morpher.git pull the latest changes of submodules.: git submodule update --init --remote

The first git clone command seems to pull the right versions of the 3 submodules. Everything works with that. But if you do the second git submodule update, that screws up everything, it pull a different version of the 3 submodules, and although they all build, you get runtime errors as I mentionned in earlier posts

jiayi-wang98 commented 7 months ago

@odarcy1

Yes, with the dockerfile, it works for me too, the array_add example/tutorial passes. But I also recently found out that in my own environment, it works too, array_add example passes. The thing the you must NOT DO even if the README file tells you to is this line:

Pull the code clone first: git clone --recurse-submodules https://github.com/ecolab-nus/Morpher.git pull the latest changes of submodules.: git submodule update --init --remote

The first git clone command seems to pull the right versions of the 3 submodules. Everything works with that. But if you do the second git submodule update, that screws up everything, it pull a different version of the 3 submodules, and although they all build, you get runtime errors as I mentionned in earlier posts

Thank you so much! I got the exactly same issue with you and it works now without doing the second pulling.