neurosim / DNN_NeuroSim_V2.1

Benchmark framework of compute-in-memory based accelerators for deep neural network (on-chip training chip focused)
108 stars 50 forks source link

It seems wrong for tileLocaEachLayer #12

Open fishfishfishfishfish opened 2 years ago

fishfishfishfishfish commented 2 years ago

In the function ChipFloorPlan in Training_pytorch/NeuroSIM/Chip.cpp, it calculate the double vector tileLocaEachLayer. I presume that tileLocaEachLayer record the location of the first tile that store a layer. The following code to calculate tileLocaEachLayer seems wrong.

for (int i=0; i<netStructure.size(); i++) {
  if (i==0) {
    tileLocaEachLayerRow.push_back(0);
    tileLocaEachLayerCol.push_back(0);
  } else {
        // original code here
    // thisTileTotal += numTileEachLayer[0][i]*numTileEachLayer[1][i];
    tileLocaEachLayerRow.push_back((int)thisTileTotal/(*numTileRow));
    tileLocaEachLayerCol.push_back((int)thisTileTotal%(*numTileRow)-1);
  }
  // I think it should be moved here.
  thisTileTotal += numTileEachLayer[0][i]*numTileEachLayer[1][i];
}

I think the calculation of thisTileTotal should be moved from the else clause to outside.