jhxu001 / MHSim

A Simulation Framework for Memristor-based Heterogeneous Computing Architectures
0 stars 2 forks source link

missing components #5

Open saba-er opened 2 years ago

saba-er commented 2 years ago

According to MHSim paper (MHSim: A Simulation Framework for Memristor-based Heterogeneous Computing Architectures), there are some key components such as "task dispatcher" that do not seem to be included in this repo. Also, it seems the repo does not support integration of Caffe with Neurosim.

  1. I was wondering if there is a more complete version of the simulator that can be publicly accessed?
  2. Do you have a recipe for integrating Caffe and Neurosim.?
  3. Neurosim 3 (included in this repo) seems to support only MLPs (and not CNNs). But, the paper shows experiments with CNNs such as AlexNet, LeNet etc. Did you use another Neurosim (like 1.3) for this purpose?
jhxu001 commented 2 years ago

We have not integrated NeuroSim with a special application, but with a system simulator. To evaluate CNNs with Caffe (or other application), you can set the command in "zsim/tests/mba.cfg": process0 = { command = "ls"; //command = "./path/to/caffe test -model /path/to/deploy.prototxt -weights /path/to/*.caffemodel -iterations 1" }; Then run ZSim: "./build/opt/zsim tests/mba.cfg".

saba-er commented 2 years ago

Thanks! Now I can run mba.cfg with a model defined in Caffe. However, I noticed there is some long stall during the run, and this message repeats: "[H] WARN: Stalled for 3800 secs so far 0"

What could be the reason?

jhxu001 commented 2 years ago

I don't know the reason for this bug from these messages you post. You can set the "useMemristor" to false in "mba.cfg" to check whether ZSim can run Caffe normally.

saba-er commented 2 years ago

Thanks, again. I think the reason is low memory with respect to model size. I have another question. How do you evaluate model accuracy using the simulator, e.g., accuracy of neural network inference? (I am referring you to accuracy graphs in the paper)

jhxu001 commented 2 years ago

I replace the GEMM function in Caffe with the memristor_mm function in Memristor_CU.h and run Caffe directly without ZSim since the simulation for Caffe on ZSim is time-costly. You can evaluate the inference accuracy with Caffe solely if you are only concerned with the accuracy degradation.

saba-er commented 2 years ago

There are a few instances where gemm is invoked in Caffe including forward_cpu_gemm and caffe_cpu_gemm. Which one should be replaced with memristor_mm function in Memristor_CU.h?

jhxu001 commented 2 years ago

caffe_cpu_gemm is OK.

saba-er commented 2 years ago

Would it be possible to show how you replaced GEMM function in Caffe with memristor_mm function? It does not seem to be trivial.

saba-er commented 2 years ago

Would it be possible to share where/how you replaced GEMM function in Caffe with memristor_mm function?

jhxu001 commented 2 years ago

Codes in NeuroSim/main.cpp show how we perform GEMM with memristor_mm.

saba-er commented 2 years ago

Thanks! As far as I see, the example in main.cop is not documented, could you briefly describe what does it do?