KULeuven-MICAS / zigzag

HW Architecture-Mapping Design Space Exploration Framework for Deep Learning Accelerators
https://kuleuven-micas.github.io/zigzag/
MIT License
90 stars 31 forks source link

New feature: Allows the output data of a layer to remain in the low-level memory for later use when possible #25

Closed JiacongSun closed 8 months ago

JiacongSun commented 9 months ago

New feature:

Note:

  1. This feature applies only to layers on the same branch.
  2. By default, it is assumed that the initial input and final output of the entire network can be generated from the low-level memory. If your case requires them to travel to/from the top memory level, you can change this assumption by setting the workload_data_always_from_top_mem parameter to True in the run() function within the SearchNoUseMemStage.py file.

New stages:

How to use:

Example:

An example function, get_hardware_performance_zigzag_unused_mem_removing is provided in api.py for reference.

JiacongSun commented 8 months ago

New fixes:

  1. SearchNoUseMemStage is renamed as SearchUnusedMemoryStage, RemoveNoUseMemStage is renamed as RemoveUnusedMemoryStage.
  2. Coding style in stages above are reformated using black.
  3. Add more comments in the new stages, including explicitly label whether a operand is of the layer representation or the mem representation.
  4. pytest cases are added under /tests/main/test_without_unused_memory/. Original pytest cases are moved to /tests/main/test_origin/.

Extra note: