scalesim-project / scale-sim-v2

Repository to host and maintain scale-sim-v2 code
MIT License
212 stars 93 forks source link

GEMM operation cannot run #106

Closed lovemyyuyu closed 1 month ago

lovemyyuyu commented 2 months ago

When I run the matrix multiplication operation with the following command:

 python3 ./scalesim/scale.py -c ./configs/scale.cfg -t ./topologies/GEMM_mnk/transformer_partial.csv -p ./output -i gemm

There will be the following error message

Traceback (most recent call last):
  File "/mnt/d/code_paper/run/scale-sim-v2-main/./scalesim/scale.py", line 34, in <module>
    s = scalesim(save_disk_space=True, verbose=True,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/xue/anaconda3/envs/scale-sim/lib/python3.11/site-packages/scalesim-2.0.2-py3.11.egg/scalesim/scale_sim.py", line 34, in __init__
    self.set_params(config_filename=config, topology_filename=topology)
  File "/home/xue/anaconda3/envs/scale-sim/lib/python3.11/site-packages/scalesim-2.0.2-py3.11.egg/scalesim/scale_sim.py", line 69, in set_params
    self.topo.load_arrays(topofile=self.topology_file, mnk_inputs=self.read_gemm_inputs)
  File "/home/xue/anaconda3/envs/scale-sim/lib/python3.11/site-packages/scalesim-2.0.2-py3.11.egg/scalesim/topology_utils.py", line 41, in load_arrays
    self.load_arrays_gemm(topofile)
  File "/home/xue/anaconda3/envs/scale-sim/lib/python3.11/site-packages/scalesim-2.0.2-py3.11.egg/scalesim/topology_utils.py", line 67, in load_arrays_gemm
    assert len(elems) > 3, 'There should be at least 4 entries per row'
           ^^^^^^^^^^^^^^

How should I solve it?

JINU98 commented 2 months ago

Hello there ,

You can chnage the topology_utils.py line 67 to make it work just remove the [:-1] : elems = row.split(',')

ritikraj7 commented 1 month ago

Hi @lovemyyuyu, there was some typo in ./topologies/GEMM_mnk/transformer_partial.csv It's fixed now. Please git pull and re-run.