Zhaoshixin-sky / CIM-MLC

[ASPLOS 2024] CIM-MLC: A Multi-level Compilation Stack for Computing-In-Memory Accelerators
21 stars 2 forks source link

Compilation error when compile the example config #2

Open Marrrb1e opened 5 days ago

Marrrb1e commented 5 days ago

When I directly run the following command: python3 main.py -onnx_model_path ./onnx_model/conv_model.onnx --ifmsize 1 3 32 32 --arch_config_module configs.example_config

the code return an error: Traceback (most recent call last): File "/mnt/d/Program/Ubuntu/UbuntuFile/home/Codespace/CIM MLC/CIM-MLC-main/main.py", line 123, in main(args.onnx_model_path, ifmsize, args.input_precision, args.weight_precision, arch_config, args.output_dir) File "/mnt/d/Program/Ubuntu/UbuntuFile/home/Codespace/CIM MLC/CIM-MLC-main/main.py", line 94, in main rcwiseCodegen.run() File "/mnt/d/Program/Ubuntu/UbuntuFile/home/Codespace/CIM MLC/CIM-MLC-main/codegen/WordlineWise.py", line 104, in run self.process_node(node, node_id) File "/mnt/d/Program/Ubuntu/UbuntuFile/home/Codespace/CIM MLC/CIM-MLC-main/codegen/WordlineWise.py", line 115, in process_node self.process_linear_node_wlm(node, node_id, OpSrc) File "/mnt/d/Program/Ubuntu/UbuntuFile/home/Codespace/CIM MLC/CIM-MLC-main/codegen/WordlineWise.py", line 354, in process_linear_node_wlm xb_occupation_update(self.xb_cycle,dst,dst + (xb_num[0] * xb_num[1]),range(max_cycle, max_cycle + SplitNum)) TypeError: 'float' object cannot be interpreted as an integer

I checked the code and found an error in WordlineWise.py, in line 345 : max_cycle = max(cycle, max_cycle) it return a float number, so i add a code: max_cycle = int(max_cycle) so that it can't return an error.

So i am wondering that this my change is correct or not. image The following is my output after my change. image

Marrrb1e commented 5 days ago

image I am also wondering that how to change the architecture input. I tried to change to PUMA but failed. Could u teach me how to change?

Zhaoshixin-sky commented 5 days ago

Thank you for the questions! You are correct for the first question, and we will figure out what is wrong with the current version. For the second question, you can change the 'PUMA' in the first line of the configs/PUMA.py to 'ArchTem'. We wrote PUMA earlier just as an example of how to complete hardware abstraction.

Marrrb1e commented 4 days ago

Thank you for the questions! You are correct for the first question, and we will figure out what is wrong with the current version. For the second question, you can change the 'PUMA' in the first line of the configs/PUMA.py to 'ArchTem'. We wrote PUMA earlier just as an example of how to complete hardware abstraction.

Thanks for your help! I tried, but still failed when importing PUMA's architecture, the message is shown below: image

So I tried another possible solution: directly copy the content of PUMA to example_config, but it still returns an error about the data type. The related message is shown below: image

After checking the code, I found that your code seems doesn't deal with the None date type in GBBuf and XBbus. When I changed the input ArchTem to Jain, it doesn't work until I change this two data to two exact numbers. image image

So I guess that you may need to add some handling about the input.