Accelergy-Project / timeloop-accelergy-exercises

Exercises for exploring the Fibertree, Timeloop and Accelergy tools
MIT License
80 stars 28 forks source link

How Accelergy determines an area from the plug-ins ? #20

Closed Olivier-Dopeli closed 3 years ago

Olivier-Dopeli commented 3 years ago

Hello,

I'm looking at the different exercises in the tutorial to understand the Timeloop and Accelergy frameworks.

In example 05-mapper-conv1d+oc-3level of Timeloop , the architecture is composed of a single PE containing 1 integer MAC. The command timeloop-mapper arch/3level.arch.yaml prob/conv1d+oc.prob.yaml mapper/exhaustive.mapper.yaml constraints/null.constraints.yaml -o output generates the file timeloop-mapper.ART_summary.yaml which contains the following MAC area data:

ART_summary:
  version: 0.3
  table_summary:
  ...
  - name: System.Chip.PE.MACC
    area: 332.25
    primitive_estimations: Aladdin_table
  ...

I have seen that it is script aladdin_table.py that collects the area data of a multiplier and an adder in the corresponding .csv files. By default, the data corresponding to a latency of 5ns are collected. Then the area of the multiplier and the adder are added to estimate the area of the MAC. In this case, I think I can manually estimate the area : Adder area : 1.79E+02 + mult. area : 4.60E+03 = MAC area : 4 779 um^2

But, the manually calculated MAC area doesn't correspond to the MAC area obtained in the file timeloop-mapper.ART_summary.yaml

Can you explain to me why I have this difference, please?

Thank you in advance.

nellie-wu commented 3 years ago

The CSV files in the Aladdin plug-in records the energy and area for 32-bit int adder and multipliers, so in aladdin_table.py, we perform interpolations to get the energy and area for these units of different data widths. For multipliers with data width d, the values in the CSV files are scaled by 32/d^2 and for adders, it is just a linear scale, e.g., as implemented here: https://github.com/Accelergy-Project/accelergy-aladdin-plug-in/blob/master/aladdin_table.py#L305

For the specific example, the data width is 8 bits, so we have 179/4+4600/16 = 332.25 for mac area.

Omar-Abdul-Aziz commented 1 year ago

Can you support on this related issue?

https://github.com/NVlabs/timeloop/issues/199#issuecomment-1461866785

nellie-wu commented 1 year ago

Please see the reply in the timeloop repo.