zigzag-dse 3.1.2__tar.gz → 3.2.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (156) hide show
  1. zigzag_dse-3.2.0/MANIFEST.in +2 -0
  2. {zigzag_dse-3.1.2/zigzag_dse.egg-info → zigzag_dse-3.2.0}/PKG-INFO +6 -3
  3. {zigzag_dse-3.1.2 → zigzag_dse-3.2.0}/pyproject.toml +8 -5
  4. zigzag_dse-3.2.0/tests/main/test_imc/test_aimc.py +34 -0
  5. zigzag_dse-3.2.0/tests/main/test_imc/test_dimc.py +34 -0
  6. zigzag_dse-3.2.0/tests/main/test_origin/test_ascend_like.py +33 -0
  7. {zigzag_dse-3.1.2 → zigzag_dse-3.2.0}/tests/main/test_origin/test_edge_tpu_like.py +7 -11
  8. zigzag_dse-3.1.2/tests/main/test_origin/test_ascend_like.py → zigzag_dse-3.2.0/tests/main/test_origin/test_meta_prototype_like.py +7 -11
  9. {zigzag_dse-3.1.2 → zigzag_dse-3.2.0}/tests/main/test_origin/test_tesla_npu_like.py +7 -11
  10. {zigzag_dse-3.1.2 → zigzag_dse-3.2.0}/tests/main/test_origin/test_tpu_like.py +7 -11
  11. {zigzag_dse-3.1.2 → zigzag_dse-3.2.0}/tests/main/test_with_mix_spatial_mapping/test_ascend_like.py +5 -9
  12. {zigzag_dse-3.1.2 → zigzag_dse-3.2.0}/tests/main/test_with_mix_spatial_mapping/test_edge_tpu_like.py +5 -9
  13. {zigzag_dse-3.1.2 → zigzag_dse-3.2.0}/tests/main/test_with_mix_spatial_mapping/test_meta_prototype_like.py +5 -9
  14. {zigzag_dse-3.1.2 → zigzag_dse-3.2.0}/tests/main/test_with_mix_spatial_mapping/test_tesla_npu_like.py +5 -9
  15. {zigzag_dse-3.1.2 → zigzag_dse-3.2.0}/tests/main/test_with_mix_spatial_mapping/test_tpu_like.py +5 -9
  16. {zigzag_dse-3.1.2 → zigzag_dse-3.2.0}/tests/main/test_without_unused_memory/test_ascend_like.py +5 -9
  17. {zigzag_dse-3.1.2 → zigzag_dse-3.2.0}/tests/main/test_without_unused_memory/test_edge_tpu_like.py +5 -9
  18. {zigzag_dse-3.1.2 → zigzag_dse-3.2.0}/tests/main/test_without_unused_memory/test_meta_prototype_like.py +5 -9
  19. {zigzag_dse-3.1.2 → zigzag_dse-3.2.0}/tests/main/test_without_unused_memory/test_tesla_npu_like.py +5 -9
  20. {zigzag_dse-3.1.2 → zigzag_dse-3.2.0}/tests/main/test_without_unused_memory/test_tpu_like.py +5 -9
  21. zigzag_dse-3.2.0/zigzag/__init__.py +3 -0
  22. {zigzag_dse-3.1.2 → zigzag_dse-3.2.0}/zigzag/__main__.py +4 -22
  23. {zigzag_dse-3.1.2 → zigzag_dse-3.2.0}/zigzag/api.py +76 -92
  24. {zigzag_dse-3.1.2 → zigzag_dse-3.2.0}/zigzag/cacti/cacti_master/cacti_config_creator.py +8 -7
  25. zigzag_dse-3.2.0/zigzag/cost_model/__init__.py +0 -0
  26. {zigzag_dse-3.1.2 → zigzag_dse-3.2.0}/zigzag/cost_model/cost_model.py +49 -40
  27. zigzag_dse-3.2.0/zigzag/cost_model/cost_model_imc.py +186 -0
  28. {zigzag_dse-3.1.2 → zigzag_dse-3.2.0}/zigzag/hardware/architecture/Adder.py +2 -2
  29. {zigzag_dse-3.1.2 → zigzag_dse-3.2.0}/zigzag/hardware/architecture/Core.py +6 -2
  30. zigzag_dse-3.2.0/zigzag/hardware/architecture/ImcArray.py +585 -0
  31. {zigzag_dse-3.1.2 → zigzag_dse-3.2.0}/zigzag/hardware/architecture/MemoryHierarchy.py +5 -4
  32. {zigzag_dse-3.1.2 → zigzag_dse-3.2.0}/zigzag/hardware/architecture/MemoryInstance.py +1 -0
  33. zigzag_dse-3.2.0/zigzag/hardware/architecture/__init__.py +0 -0
  34. {zigzag_dse-3.1.2 → zigzag_dse-3.2.0}/zigzag/hardware/architecture/get_cacti_cost.py +25 -43
  35. zigzag_dse-3.2.0/zigzag/hardware/architecture/imc_unit.py +440 -0
  36. {zigzag_dse-3.1.2 → zigzag_dse-3.2.0}/zigzag/hardware/architecture/memory_level.py +13 -4
  37. {zigzag_dse-3.1.2 → zigzag_dse-3.2.0}/zigzag/hardware/architecture/memory_port.py +0 -1
  38. zigzag_dse-3.2.0/zigzag/hardware/architecture/operational_array.py +56 -0
  39. {zigzag_dse-3.1.2 → zigzag_dse-3.2.0}/zigzag/hardware/architecture/operational_unit.py +3 -3
  40. zigzag_dse-3.2.0/zigzag/inputs/workload/alexnet.onnx +0 -0
  41. zigzag_dse-3.2.0/zigzag/inputs/workload/mobilenetv2.onnx +0 -0
  42. zigzag_dse-3.2.0/zigzag/inputs/workload/resnet18.onnx +0 -0
  43. {zigzag_dse-3.1.2 → zigzag_dse-3.2.0}/zigzag/mapping/Mapping.py +47 -39
  44. {zigzag_dse-3.1.2 → zigzag_dse-3.2.0}/zigzag/mapping/SpatialMappingInternal.py +13 -8
  45. {zigzag_dse-3.1.2 → zigzag_dse-3.2.0}/zigzag/mapping/TemporalMapping.py +9 -4
  46. zigzag_dse-3.2.0/zigzag/mapping/__init__.py +0 -0
  47. {zigzag_dse-3.1.2 → zigzag_dse-3.2.0}/zigzag/mapping/data_movement.py +10 -2
  48. {zigzag_dse-3.1.2 → zigzag_dse-3.2.0}/zigzag/mapping/mapping_assist_funcs.py +3 -2
  49. {zigzag_dse-3.1.2 → zigzag_dse-3.2.0}/zigzag/mapping/spatial_mapping.py +14 -10
  50. zigzag_dse-3.2.0/zigzag/opt/__init__.py +0 -0
  51. {zigzag_dse-3.1.2 → zigzag_dse-3.2.0}/zigzag/opt/loma/LomaEngine.py +16 -12
  52. {zigzag_dse-3.1.2 → zigzag_dse-3.2.0}/zigzag/opt/loma/MemoryAllocator.py +6 -5
  53. zigzag_dse-3.2.0/zigzag/opt/loma/__init__.py +0 -0
  54. {zigzag_dse-3.1.2 → zigzag_dse-3.2.0}/zigzag/opt/loma/multipermute.py +9 -6
  55. {zigzag_dse-3.1.2 → zigzag_dse-3.2.0}/zigzag/opt/salsa/SalsaEngine.py +5 -9
  56. zigzag_dse-3.2.0/zigzag/opt/salsa/__init__.py +0 -0
  57. {zigzag_dse-3.1.2 → zigzag_dse-3.2.0}/zigzag/parser/AcceleratorValidator.py +91 -23
  58. {zigzag_dse-3.1.2 → zigzag_dse-3.2.0}/zigzag/parser/MappingValidator.py +5 -11
  59. {zigzag_dse-3.1.2 → zigzag_dse-3.2.0}/zigzag/parser/UpgradedValidator.py +14 -14
  60. {zigzag_dse-3.1.2 → zigzag_dse-3.2.0}/zigzag/parser/WorkloadValidator.py +0 -6
  61. zigzag_dse-3.2.0/zigzag/parser/__init__.py +0 -0
  62. {zigzag_dse-3.1.2 → zigzag_dse-3.2.0}/zigzag/parser/accelerator_factory.py +47 -11
  63. zigzag_dse-3.2.0/zigzag/parser/arguments.py +25 -0
  64. {zigzag_dse-3.1.2 → zigzag_dse-3.2.0}/zigzag/parser/onnx/ConvParser.py +27 -7
  65. {zigzag_dse-3.1.2 → zigzag_dse-3.2.0}/zigzag/parser/onnx/GemmParser.py +1 -1
  66. {zigzag_dse-3.1.2 → zigzag_dse-3.2.0}/zigzag/parser/onnx/MatMulParser.py +1 -1
  67. {zigzag_dse-3.1.2 → zigzag_dse-3.2.0}/zigzag/parser/onnx/ONNXOperatorParser.py +5 -1
  68. zigzag_dse-3.2.0/zigzag/parser/onnx/__init__.py +0 -0
  69. {zigzag_dse-3.1.2 → zigzag_dse-3.2.0}/zigzag/parser/onnx/utils.py +2 -36
  70. {zigzag_dse-3.1.2 → zigzag_dse-3.2.0}/zigzag/parser/workload_factory.py +3 -4
  71. zigzag_dse-3.2.0/zigzag/py.typed +0 -0
  72. {zigzag_dse-3.1.2 → zigzag_dse-3.2.0}/zigzag/stages/AcceleratorParserStage.py +4 -3
  73. {zigzag_dse-3.1.2 → zigzag_dse-3.2.0}/zigzag/stages/CostModelStage.py +3 -3
  74. {zigzag_dse-3.1.2 → zigzag_dse-3.2.0}/zigzag/stages/PEArrayScalingStage.py +0 -1
  75. {zigzag_dse-3.1.2 → zigzag_dse-3.2.0}/zigzag/stages/PlotTemporalMappingsStage.py +4 -9
  76. {zigzag_dse-3.1.2 → zigzag_dse-3.2.0}/zigzag/stages/RemoveUnusedMemoryStage.py +43 -79
  77. zigzag_dse-3.2.0/zigzag/stages/SearchUnusedMemoryStage.py +354 -0
  78. {zigzag_dse-3.1.2 → zigzag_dse-3.2.0}/zigzag/stages/SpatialMappingConversionStage.py +3 -3
  79. {zigzag_dse-3.1.2 → zigzag_dse-3.2.0}/zigzag/stages/SpatialMappingGeneratorStage.py +87 -19
  80. zigzag_dse-3.2.0/zigzag/stages/VisualizationStage.py +53 -0
  81. {zigzag_dse-3.1.2 → zigzag_dse-3.2.0}/zigzag/stages/WorkloadParserStage.py +4 -2
  82. {zigzag_dse-3.1.2 → zigzag_dse-3.2.0}/zigzag/stages/WorkloadStage.py +4 -8
  83. zigzag_dse-3.2.0/zigzag/stages/__init__.py +0 -0
  84. {zigzag_dse-3.1.2 → zigzag_dse-3.2.0}/zigzag/stages/reduce_stages.py +0 -2
  85. {zigzag_dse-3.1.2 → zigzag_dse-3.2.0}/zigzag/stages/run_opt_stages.py +9 -11
  86. {zigzag_dse-3.1.2 → zigzag_dse-3.2.0}/zigzag/stages/save_stages.py +42 -36
  87. {zigzag_dse-3.1.2 → zigzag_dse-3.2.0}/zigzag/utils.py +7 -6
  88. zigzag_dse-3.2.0/zigzag/visualization/__init__.py +0 -0
  89. zigzag_dse-3.2.0/zigzag/visualization/graph/__init__.py +0 -0
  90. {zigzag_dse-3.1.2 → zigzag_dse-3.2.0}/zigzag/visualization/graph/memory_hierarchy.py +0 -1
  91. {zigzag_dse-3.1.2 → zigzag_dse-3.2.0}/zigzag/visualization/graph/workload.py +2 -1
  92. zigzag_dse-3.2.0/zigzag/visualization/results/__init__.py +0 -0
  93. {zigzag_dse-3.1.2 → zigzag_dse-3.2.0}/zigzag/visualization/results/plot_cme.py +2 -4
  94. {zigzag_dse-3.1.2 → zigzag_dse-3.2.0}/zigzag/visualization/results/print_mapping.py +2 -0
  95. {zigzag_dse-3.1.2 → zigzag_dse-3.2.0}/zigzag/workload/LayerNodeABC.py +1 -1
  96. {zigzag_dse-3.1.2 → zigzag_dse-3.2.0}/zigzag/workload/Workload.py +1 -1
  97. zigzag_dse-3.2.0/zigzag/workload/__init__.py +0 -0
  98. {zigzag_dse-3.1.2 → zigzag_dse-3.2.0}/zigzag/workload/layer_attributes.py +15 -6
  99. {zigzag_dse-3.1.2 → zigzag_dse-3.2.0}/zigzag/workload/layer_node.py +12 -11
  100. {zigzag_dse-3.1.2 → zigzag_dse-3.2.0/zigzag_dse.egg-info}/PKG-INFO +6 -3
  101. {zigzag_dse-3.1.2 → zigzag_dse-3.2.0}/zigzag_dse.egg-info/SOURCES.txt +20 -17
  102. {zigzag_dse-3.1.2 → zigzag_dse-3.2.0}/zigzag_dse.egg-info/requires.txt +4 -1
  103. {zigzag_dse-3.1.2 → zigzag_dse-3.2.0}/zigzag_dse.egg-info/top_level.txt +0 -3
  104. zigzag_dse-3.1.2/MANIFEST.in +0 -2
  105. zigzag_dse-3.1.2/tests/main/test_imc/test_aimc.py +0 -40
  106. zigzag_dse-3.1.2/tests/main/test_imc/test_dimc.py +0 -40
  107. zigzag_dse-3.1.2/tests/main/test_origin/test_meta_prototype_like.py +0 -37
  108. zigzag_dse-3.1.2/zigzag/__init__.py +0 -1
  109. zigzag_dse-3.1.2/zigzag/cost_model/CostModelEvaluationForIMC.py +0 -432
  110. zigzag_dse-3.1.2/zigzag/hardware/architecture/AimcArray.py +0 -503
  111. zigzag_dse-3.1.2/zigzag/hardware/architecture/DimcArray.py +0 -816
  112. zigzag_dse-3.1.2/zigzag/hardware/architecture/ImcArray.py +0 -39
  113. zigzag_dse-3.1.2/zigzag/hardware/architecture/imc_unit.py +0 -243
  114. zigzag_dse-3.1.2/zigzag/hardware/architecture/operational_array.py +0 -74
  115. zigzag_dse-3.1.2/zigzag/inputs/validation/hardware/sram_imc/aimc_validation/22-28nm/aimc1_validation_subfunc.py +0 -182
  116. zigzag_dse-3.1.2/zigzag/inputs/validation/hardware/sram_imc/aimc_validation/22-28nm/aimc2_validation_subfunc.py +0 -286
  117. zigzag_dse-3.1.2/zigzag/inputs/validation/hardware/sram_imc/aimc_validation/22-28nm/aimc3_validation_subfunc.py +0 -210
  118. zigzag_dse-3.1.2/zigzag/inputs/validation/hardware/sram_imc/aimc_validation/22-28nm/aimc_cost_model.py +0 -55
  119. zigzag_dse-3.1.2/zigzag/inputs/validation/hardware/sram_imc/aimc_validation/22-28nm/aimc_validation.py +0 -144
  120. zigzag_dse-3.1.2/zigzag/inputs/validation/hardware/sram_imc/aimc_validation/22-28nm/dimc_cost_model.py +0 -393
  121. zigzag_dse-3.1.2/zigzag/inputs/validation/hardware/sram_imc/dimc_validation/28nm/dimc_cost_model.py +0 -393
  122. zigzag_dse-3.1.2/zigzag/inputs/validation/hardware/sram_imc/dimc_validation/28nm/dimc_validation.py +0 -145
  123. zigzag_dse-3.1.2/zigzag/inputs/validation/hardware/sram_imc/dimc_validation/28nm/dimc_validation4.py +0 -46
  124. zigzag_dse-3.1.2/zigzag/inputs/validation/hardware/sram_imc/dimc_validation/28nm/dimc_validation_subfunc.py +0 -422
  125. zigzag_dse-3.1.2/zigzag/inputs/validation/hardware/sram_imc/dimc_validation/28nm/dimc_validation_subfunc4.py +0 -215
  126. zigzag_dse-3.1.2/zigzag/inputs/validation/hardware/sram_imc/dimc_validation/28nm/model_extration_28nm.py +0 -79
  127. zigzag_dse-3.1.2/zigzag/stages/DumpStage.py +0 -35
  128. zigzag_dse-3.1.2/zigzag/stages/GeneralParameterIteratorStage.py +0 -58
  129. zigzag_dse-3.1.2/zigzag/stages/SearchUnusedMemoryStage.py +0 -458
  130. {zigzag_dse-3.1.2 → zigzag_dse-3.2.0}/LICENSE +0 -0
  131. {zigzag_dse-3.1.2 → zigzag_dse-3.2.0}/README.md +0 -0
  132. {zigzag_dse-3.1.2 → zigzag_dse-3.2.0}/setup.cfg +0 -0
  133. {zigzag_dse-3.1.2 → zigzag_dse-3.2.0}/tests/main/test_imc/__init__.py +0 -0
  134. {zigzag_dse-3.1.2 → zigzag_dse-3.2.0}/tests/main/test_with_mix_spatial_mapping/__init__.py +0 -0
  135. {zigzag_dse-3.1.2 → zigzag_dse-3.2.0}/tests/main/test_without_unused_memory/__init__.py +0 -0
  136. {zigzag_dse-3.1.2 → zigzag_dse-3.2.0}/zigzag/cacti/cacti_master/cacti_top.py +0 -0
  137. {zigzag_dse-3.1.2 → zigzag_dse-3.2.0}/zigzag/cacti/cacti_parser.py +0 -0
  138. {zigzag_dse-3.1.2 → zigzag_dse-3.2.0}/zigzag/cost_model/port_activity.py +0 -0
  139. {zigzag_dse-3.1.2 → zigzag_dse-3.2.0}/zigzag/datatypes.py +0 -0
  140. {zigzag_dse-3.1.2 → zigzag_dse-3.2.0}/zigzag/hardware/architecture/Accelerator.py +0 -0
  141. {zigzag_dse-3.1.2 → zigzag_dse-3.2.0}/zigzag/opt/loma/Loop.py +0 -0
  142. {zigzag_dse-3.1.2 → zigzag_dse-3.2.0}/zigzag/opt/salsa/SalsaState.py +0 -0
  143. {zigzag_dse-3.1.2 → zigzag_dse-3.2.0}/zigzag/parser/onnx/DefaultNodeParser.py +0 -0
  144. {zigzag_dse-3.1.2 → zigzag_dse-3.2.0}/zigzag/parser/onnx/ONNXModelParser.py +0 -0
  145. {zigzag_dse-3.1.2 → zigzag_dse-3.2.0}/zigzag/stages/LomaStage.py +0 -0
  146. {zigzag_dse-3.1.2 → zigzag_dse-3.2.0}/zigzag/stages/MainStage.py +0 -0
  147. {zigzag_dse-3.1.2 → zigzag_dse-3.2.0}/zigzag/stages/ONNXModelParserStage.py +0 -0
  148. {zigzag_dse-3.1.2 → zigzag_dse-3.2.0}/zigzag/stages/SalsaStage.py +0 -0
  149. {zigzag_dse-3.1.2 → zigzag_dse-3.2.0}/zigzag/stages/Stage.py +0 -0
  150. {zigzag_dse-3.1.2 → zigzag_dse-3.2.0}/zigzag/stages/TemporalOrderingConversionStage.py +0 -0
  151. {zigzag_dse-3.1.2 → zigzag_dse-3.2.0}/zigzag/workload/DNNWorkload.py +0 -0
  152. {zigzag_dse-3.1.2 → zigzag_dse-3.2.0}/zigzag/workload/DummyNode.py +0 -0
  153. {zigzag_dse-3.1.2 → zigzag_dse-3.2.0}/zigzag/workload/LayerAttribute.py +0 -0
  154. {zigzag_dse-3.1.2 → zigzag_dse-3.2.0}/zigzag/workload/ONNXWorkload.py +0 -0
  155. {zigzag_dse-3.1.2 → zigzag_dse-3.2.0}/zigzag_dse.egg-info/dependency_links.txt +0 -0
  156. {zigzag_dse-3.1.2 → zigzag_dse-3.2.0}/zigzag_dse.egg-info/entry_points.txt +0 -0
@@ -0,0 +1,2 @@
1
+ include zigzag/inputs/workload/*.onnx
2
+ recursive-include zigzag/classes/cacti *
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: zigzag-dse
3
- Version: 3.1.2
3
+ Version: 3.2.0
4
4
  Summary: ZigZag - Deep Learning Hardware Design Space Exploration
5
5
  Author-email: Arne Symons <arne.symons@kuleuven.be>, Linyan Mei <linyan.mei@kuleuven.be>
6
6
  License: MIT License
@@ -25,7 +25,7 @@ License: MIT License
25
25
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
26
  SOFTWARE.
27
27
 
28
- Project-URL: Homepage, https://github.com/ZigZag-Project/zigzag
28
+ Project-URL: Homepage, https://github.com/KULeuven-MICAS/zigzag
29
29
  Keywords: zigzag,dse,design-space-exploration,machine-learning,deep-learning,mapping
30
30
  Classifier: License :: OSI Approved :: BSD License
31
31
  Classifier: Programming Language :: Python
@@ -40,12 +40,15 @@ Requires-Dist: onnx
40
40
  Requires-Dist: tqdm
41
41
  Requires-Dist: multiprocessing_on_dill
42
42
  Requires-Dist: pyyaml
43
- Requires-Dist: tomli
43
+ Requires-Dist: cerberus
44
44
  Provides-Extra: dev
45
45
  Requires-Dist: bumpver; extra == "dev"
46
46
  Requires-Dist: pip-tools; extra == "dev"
47
47
  Requires-Dist: build; extra == "dev"
48
48
  Requires-Dist: twine; extra == "dev"
49
+ Requires-Dist: pytest; extra == "dev"
50
+ Requires-Dist: typeguard; extra == "dev"
51
+ Requires-Dist: ruff; extra == "dev"
49
52
 
50
53
  # ZigZag [Documentation](https://kuleuven-micas.github.io/zigzag/) [Tutorial](https://www.youtube.com/watch?v=VgUuG4QaSQQ&list=PLUi74Rw4uFDIuK_6FCF9Bv7SMJlHfG4l3&index=1)
51
54
  This repository presents the novel version of our tried-and-tested HW Architecture-Mapping Design Space Exploration (DSE) Framework for Deep Learning (DL) accelerators. ZigZag bridges the gap between algorithmic DL decisions and their acceleration cost on specialized accelerators through a fast and accurate HW cost estimation.
@@ -9,9 +9,12 @@ include = ["*"] # ["*"] by default
9
9
  exclude = ["inputs*", "outputs*", "docs*"]
10
10
  namespaces = true # true by default
11
11
 
12
+ [tool.setuptools.package-data]
13
+ "zigzag" = ["py.typed"]
14
+
12
15
  [project]
13
16
  name = "zigzag-dse"
14
- version = "3.1.2"
17
+ version = "3.2.0"
15
18
  description = "ZigZag - Deep Learning Hardware Design Space Exploration"
16
19
  readme = "README.md"
17
20
  authors = [{ name = "Arne Symons", email = "arne.symons@kuleuven.be" }, { name = "Linyan Mei", email = "linyan.mei@kuleuven.be" }]
@@ -30,22 +33,22 @@ dependencies = [
30
33
  'tqdm',
31
34
  'multiprocessing_on_dill',
32
35
  'pyyaml',
33
- 'tomli',
36
+ 'cerberus',
34
37
  ]
35
38
  requires-python = ">=3.11"
36
39
 
37
40
 
38
41
  [project.optional-dependencies]
39
- dev = ["bumpver", "pip-tools", "build", "twine"]
42
+ dev = ["bumpver", "pip-tools", "build", "twine", 'pytest', 'typeguard', 'ruff']
40
43
 
41
44
  [project.urls]
42
- Homepage = "https://github.com/ZigZag-Project/zigzag"
45
+ Homepage = "https://github.com/KULeuven-MICAS/zigzag"
43
46
 
44
47
  [project.scripts]
45
48
  realpython = "zigzag.__main__:main"
46
49
 
47
50
  [tool.bumpver]
48
- current_version = "3.1.2"
51
+ current_version = "3.2.0"
49
52
  version_pattern = "MAJOR.MINOR.PATCH"
50
53
  commit_message = "bump version {old_version} -> {new_version}"
51
54
  commit = true
@@ -0,0 +1,34 @@
1
+ import pytest
2
+
3
+ from zigzag.api import get_hardware_performance_zigzag_imc
4
+
5
+ workloads = (
6
+ "zigzag/inputs/workload/resnet18.onnx",
7
+ "zigzag/inputs/workload/resnet18.yaml",
8
+ )
9
+
10
+ # Expected energy, latency (#cycles), clk time and area for each workload defined above
11
+ ens_lats_clks_areas = {
12
+ "zigzag/inputs/workload/resnet18.onnx": (4695829569.611852, 5540772.0, 14.07244, 2.3426222152749223),
13
+ "zigzag/inputs/workload/resnet18.yaml": (4265124724.2396007, 4907619.0, 14.07244, 2.3426222152749223),
14
+ }
15
+
16
+
17
+ @pytest.fixture
18
+ def mapping():
19
+ return "zigzag/inputs/mapping/default_imc.yaml"
20
+
21
+
22
+ @pytest.fixture
23
+ def accelerator():
24
+ return "zigzag/inputs/hardware/aimc.yaml"
25
+
26
+
27
+ @pytest.mark.parametrize("workload", workloads)
28
+ def test_api(workload: str, accelerator: str, mapping: str):
29
+ (energy, latency, tclk, area, cmes) = get_hardware_performance_zigzag_imc(workload, accelerator, mapping)
30
+ (expected_energy, expected_latency, expected_tclk, expected_area) = ens_lats_clks_areas[workload]
31
+ assert energy == pytest.approx(expected_energy)
32
+ assert latency == pytest.approx(expected_latency)
33
+ assert tclk == pytest.approx(expected_tclk)
34
+ assert area == pytest.approx(expected_area)
@@ -0,0 +1,34 @@
1
+ import pytest
2
+
3
+ from zigzag.api import get_hardware_performance_zigzag_imc
4
+
5
+ workloads = (
6
+ "zigzag/inputs/workload/resnet18.onnx",
7
+ "zigzag/inputs/workload/resnet18.yaml",
8
+ )
9
+
10
+ # Expected energy, latency (#cycles), clk time and area for each workload defined above
11
+ ens_lats_clks_areas = {
12
+ "zigzag/inputs/workload/resnet18.onnx": (4726270705.225856, 6337852.0, 3.75708, 0.8566212024),
13
+ "zigzag/inputs/workload/resnet18.yaml": (4268432908.954752, 5789353.0, 3.75708, 0.8566212024),
14
+ }
15
+
16
+
17
+ @pytest.fixture
18
+ def mapping():
19
+ return "zigzag/inputs/mapping/default_imc.yaml"
20
+
21
+
22
+ @pytest.fixture
23
+ def accelerator():
24
+ return "zigzag/inputs/hardware/dimc.yaml"
25
+
26
+
27
+ @pytest.mark.parametrize("workload", workloads)
28
+ def test_api(workload: str, accelerator: str, mapping: str):
29
+ (energy, latency, tclk, area, cmes) = get_hardware_performance_zigzag_imc(workload, accelerator, mapping)
30
+ (expected_energy, expected_latency, expected_tclk, expected_area) = ens_lats_clks_areas[workload]
31
+ assert energy == pytest.approx(expected_energy)
32
+ assert latency == pytest.approx(expected_latency)
33
+ assert tclk == pytest.approx(expected_tclk)
34
+ assert area == pytest.approx(expected_area)
@@ -0,0 +1,33 @@
1
+ import pytest
2
+
3
+ from zigzag.api import get_hardware_performance_zigzag
4
+
5
+ workloads = (
6
+ "zigzag/inputs/workload/resnet18.onnx",
7
+ "zigzag/inputs/workload/resnet18.yaml",
8
+ )
9
+
10
+ # Expected energy and latency for each workload defined above
11
+ ens_lats = {
12
+ "zigzag/inputs/workload/resnet18.onnx": (1860963861.6800003, 3698589.0),
13
+ "zigzag/inputs/workload/resnet18.yaml": (2411783423.28, 4779709.0),
14
+ }
15
+
16
+
17
+ @pytest.fixture
18
+ def mapping():
19
+ return "zigzag/inputs/mapping/ascend_like.yaml"
20
+
21
+
22
+ @pytest.fixture
23
+ def accelerator():
24
+ return "zigzag/inputs/hardware/ascend_like.yaml"
25
+
26
+
27
+ @pytest.mark.parametrize("workload", workloads)
28
+ def test_api(workload: str, accelerator: str, mapping: str):
29
+ (energy, latency, _) = get_hardware_performance_zigzag(workload, accelerator, mapping)
30
+ (expected_energy, expected_latency) = ens_lats[workload]
31
+ print(f"'{workload}': ({energy}, {latency}),")
32
+ assert energy == pytest.approx(expected_energy)
33
+ assert latency == pytest.approx(expected_latency)
@@ -3,33 +3,29 @@ import pytest
3
3
  from zigzag.api import get_hardware_performance_zigzag
4
4
 
5
5
  workloads = (
6
- "inputs/workload/alexnet.onnx",
7
- "inputs/workload/mobilenetv2.onnx",
8
- "inputs/workload/resnet18.onnx",
9
- "inputs/workload/resnet18.yaml",
6
+ "zigzag/inputs/workload/resnet18.onnx",
7
+ "zigzag/inputs/workload/resnet18.yaml",
10
8
  )
11
9
 
12
10
  # Expected energy and latency for each workload defined above
13
11
  ens_lats = {
14
- "inputs/workload/alexnet.onnx": (5657178248.6, 8221391.0),
15
- "inputs/workload/mobilenetv2.onnx": (1680773377.4499998, 3562331.0),
16
- "inputs/workload/resnet18.onnx": (1902637139.1499994, 3333310.0),
17
- "inputs/workload/resnet18.yaml": (2413348670.67, 4268451.0),
12
+ "zigzag/inputs/workload/resnet18.onnx": (1902637139.1499994, 3333310.0),
13
+ "zigzag/inputs/workload/resnet18.yaml": (2413348670.67, 4268451.0),
18
14
  }
19
15
 
20
16
 
21
17
  @pytest.fixture
22
18
  def mapping():
23
- return "inputs/mapping/edge_tpu_like.yaml"
19
+ return "zigzag/inputs/mapping/edge_tpu_like.yaml"
24
20
 
25
21
 
26
22
  @pytest.fixture
27
23
  def accelerator():
28
- return "inputs/hardware/edge_tpu_like.yaml"
24
+ return "zigzag/inputs/hardware/edge_tpu_like.yaml"
29
25
 
30
26
 
31
27
  @pytest.mark.parametrize("workload", workloads)
32
- def test_api(workload, accelerator, mapping):
28
+ def test_api(workload: str, accelerator: str, mapping: str):
33
29
  (energy, latency, cmes) = get_hardware_performance_zigzag(workload, accelerator, mapping)
34
30
  (expected_energy, expected_latency) = ens_lats[workload]
35
31
  print(f"'{workload}': ({energy}, {latency}),")
@@ -3,33 +3,29 @@ import pytest
3
3
  from zigzag.api import get_hardware_performance_zigzag
4
4
 
5
5
  workloads = (
6
- "inputs/workload/alexnet.onnx",
7
- "inputs/workload/mobilenetv2.onnx",
8
- "inputs/workload/resnet18.onnx",
9
- "inputs/workload/resnet18.yaml",
6
+ "zigzag/inputs/workload/resnet18.onnx",
7
+ "zigzag/inputs/workload/resnet18.yaml",
10
8
  )
11
9
 
12
10
  # Expected energy and latency for each workload defined above
13
11
  ens_lats = {
14
- "inputs/workload/alexnet.onnx": (5738188827.200001, 8696068.0),
15
- "inputs/workload/mobilenetv2.onnx": (1913154775.600001, 7359658.0),
16
- "inputs/workload/resnet18.onnx": (1860963861.6800003, 3698589.0),
17
- "inputs/workload/resnet18.yaml": (2411783423.28, 4779709.0),
12
+ "zigzag/inputs/workload/resnet18.onnx": (1869036158.08, 3366695.0),
13
+ "zigzag/inputs/workload/resnet18.yaml": (2418511845.2400002, 4130645.0),
18
14
  }
19
15
 
20
16
 
21
17
  @pytest.fixture
22
18
  def mapping():
23
- return "inputs/mapping/ascend_like.yaml"
19
+ return "zigzag/inputs/mapping/meta_prototype_like.yaml"
24
20
 
25
21
 
26
22
  @pytest.fixture
27
23
  def accelerator():
28
- return "inputs/hardware/ascend_like.yaml"
24
+ return "zigzag/inputs/hardware/meta_prototype.yaml"
29
25
 
30
26
 
31
27
  @pytest.mark.parametrize("workload", workloads)
32
- def test_api(workload, accelerator, mapping):
28
+ def test_api(workload: str, accelerator: str, mapping: str):
33
29
  (energy, latency, cmes) = get_hardware_performance_zigzag(workload, accelerator, mapping)
34
30
  (expected_energy, expected_latency) = ens_lats[workload]
35
31
  print(f"'{workload}': ({energy}, {latency}),")
@@ -3,33 +3,29 @@ import pytest
3
3
  from zigzag.api import get_hardware_performance_zigzag
4
4
 
5
5
  workloads = (
6
- "inputs/workload/alexnet.onnx",
7
- "inputs/workload/mobilenetv2.onnx",
8
- "inputs/workload/resnet18.onnx",
9
- "inputs/workload/resnet18.yaml",
6
+ "zigzag/inputs/workload/resnet18.onnx",
7
+ "zigzag/inputs/workload/resnet18.yaml",
10
8
  )
11
9
 
12
10
  # Expected energy and latency for each workload defined above
13
11
  ens_lats = {
14
- "inputs/workload/alexnet.onnx": (6131856327.976001, 8442657.0),
15
- "inputs/workload/mobilenetv2.onnx": (1683001389.998, 2824122.0),
16
- "inputs/workload/resnet18.onnx": (1863716799.84, 3380242.0),
17
- "inputs/workload/resnet18.yaml": (2374655424.176, 4066942.0),
12
+ "zigzag/inputs/workload/resnet18.onnx": (1863716799.84, 3380242.0),
13
+ "zigzag/inputs/workload/resnet18.yaml": (2374655424.176, 4066942.0),
18
14
  }
19
15
 
20
16
 
21
17
  @pytest.fixture
22
18
  def mapping():
23
- return "inputs/mapping/tesla_npu_like.yaml"
19
+ return "zigzag/inputs/mapping/tesla_npu_like.yaml"
24
20
 
25
21
 
26
22
  @pytest.fixture
27
23
  def accelerator():
28
- return "inputs/hardware/tesla_npu_like.yaml"
24
+ return "zigzag/inputs/hardware/tesla_npu_like.yaml"
29
25
 
30
26
 
31
27
  @pytest.mark.parametrize("workload", workloads)
32
- def test_api(workload, accelerator, mapping):
28
+ def test_api(workload: str, accelerator: str, mapping: str):
33
29
  (energy, latency, cmes) = get_hardware_performance_zigzag(workload, accelerator, mapping)
34
30
  (expected_energy, expected_latency) = ens_lats[workload]
35
31
  print(f"'{workload}': ({energy}, {latency}),")
@@ -3,33 +3,29 @@ import pytest
3
3
  from zigzag.api import get_hardware_performance_zigzag
4
4
 
5
5
  workloads = (
6
- "inputs/workload/alexnet.onnx",
7
- "inputs/workload/mobilenetv2.onnx",
8
- "inputs/workload/resnet18.onnx",
9
- "inputs/workload/resnet18.yaml",
6
+ "zigzag/inputs/workload/resnet18.onnx",
7
+ "zigzag/inputs/workload/resnet18.yaml",
10
8
  )
11
9
 
12
10
  # Expected energy and latency for each workload defined above
13
11
  ens_lats = {
14
- "inputs/workload/alexnet.onnx": (5567501203.632, 9061821.0),
15
- "inputs/workload/mobilenetv2.onnx": (1904482765.907, 23101112.0),
16
- "inputs/workload/resnet18.onnx": (1795904402.5120003, 4158539.0),
17
- "inputs/workload/resnet18.yaml": (2296490149.296, 4906975.0),
12
+ "zigzag/inputs/workload/resnet18.onnx": (1795904402.5120003, 4158539.0),
13
+ "zigzag/inputs/workload/resnet18.yaml": (2296490149.296, 4906975.0),
18
14
  }
19
15
 
20
16
 
21
17
  @pytest.fixture
22
18
  def mapping():
23
- return "inputs/mapping/tpu_like.yaml"
19
+ return "zigzag/inputs/mapping/tpu_like.yaml"
24
20
 
25
21
 
26
22
  @pytest.fixture
27
23
  def accelerator():
28
- return "inputs/hardware/tpu_like.yaml"
24
+ return "zigzag/inputs/hardware/tpu_like.yaml"
29
25
 
30
26
 
31
27
  @pytest.mark.parametrize("workload", workloads)
32
- def test_api(workload, accelerator, mapping):
28
+ def test_api(workload: str, accelerator: str, mapping: str):
33
29
  (energy, latency, _) = get_hardware_performance_zigzag(workload, accelerator, mapping)
34
30
  (expected_energy, expected_latency) = ens_lats[workload]
35
31
  print(f"{workload}: ({energy}, {latency}),")
@@ -7,18 +7,14 @@ from zigzag.api import get_hardware_performance_zigzag_with_mix_spatial_mapping
7
7
  # Test case for when spatial_mapping is provided, while spatial_mapping_hint is not provided.
8
8
 
9
9
  workloads = (
10
- "zigzag/inputs/examples/workload/alexnet.onnx",
11
- "zigzag/inputs/examples/workload/mobilenetv2.onnx",
12
- "zigzag/inputs/examples/workload/resnet18.onnx",
13
- "zigzag.inputs.examples.workload.resnet18",
10
+ "zigzag/inputs/workload/resnet18.onnx",
11
+ "zigzag/inputs/workload/resnet18.yaml",
14
12
  )
15
13
 
16
14
  # Expected energy and latency for each workload defined above
17
15
  ens_lats = {
18
- "zigzag/inputs/examples/workload/alexnet.onnx": (5667407342.66, 8528846),
19
- "zigzag/inputs/examples/workload/mobilenetv2.onnx": (921552096.0700004, 3828967),
20
- "zigzag/inputs/examples/workload/resnet18.onnx": (1679218425.5100002, 3713386),
21
- "zigzag.inputs.examples.workload.resnet18": (2290766279.31, 4442443),
16
+ "zigzag/inputs/workload/resnet18.onnx": (1679218425.5100002, 3713386),
17
+ "zigzag/inputs/workload/resnet18.yaml": (2290766279.31, 4442443),
22
18
  }
23
19
 
24
20
 
@@ -56,7 +52,7 @@ def accelerator():
56
52
 
57
53
 
58
54
  @pytest.mark.parametrize("workload", workloads)
59
- def test_api(workload, accelerator, mapping):
55
+ def test_api(workload: str, accelerator: str, mapping: str):
60
56
  (energy, latency, cmes) = get_hardware_performance_zigzag_with_mix_spatial_mapping(workload, accelerator, mapping)
61
57
  (expected_energy, expected_latency) = ens_lats[workload]
62
58
  assert energy == pytest.approx(expected_energy)
@@ -7,18 +7,14 @@ from zigzag.api import get_hardware_performance_zigzag_with_mix_spatial_mapping
7
7
  # Test case for when both spatial_mapping and spatial_mapping_hint are provided.
8
8
 
9
9
  workloads = (
10
- "zigzag/inputs/examples/workload/alexnet.onnx",
11
- "zigzag/inputs/examples/workload/mobilenetv2.onnx",
12
- "zigzag/inputs/examples/workload/resnet18.onnx",
13
- "zigzag.inputs.examples.workload.resnet18",
10
+ "zigzag/inputs/workload/resnet18.onnx",
11
+ "zigzag/inputs/workload/resnet18.yaml",
14
12
  )
15
13
 
16
14
  # Expected energy and latency for each workload defined above
17
15
  ens_lats = {
18
- "zigzag/inputs/examples/workload/alexnet.onnx": (5582059481.445, 8343378),
19
- "zigzag/inputs/examples/workload/mobilenetv2.onnx": (819971935.77, 2430583),
20
- "zigzag/inputs/examples/workload/resnet18.onnx": (1763135800.67, 5001291),
21
- "zigzag.inputs.examples.workload.resnet18": (2090252961.0700002, 5858437),
16
+ "zigzag/inputs/workload/resnet18.onnx": (1763135800.67, 5001291),
17
+ "zigzag/inputs/workload/resnet18.yaml": (2090252961.0700002, 5858437),
22
18
  }
23
19
 
24
20
 
@@ -72,7 +68,7 @@ def accelerator():
72
68
 
73
69
 
74
70
  @pytest.mark.parametrize("workload", workloads)
75
- def test_api(workload, accelerator, mapping):
71
+ def test_api(workload: str, accelerator: str, mapping: str):
76
72
  (energy, latency, cmes) = get_hardware_performance_zigzag_with_mix_spatial_mapping(workload, accelerator, mapping)
77
73
  (expected_energy, expected_latency) = ens_lats[workload]
78
74
  assert energy == pytest.approx(expected_energy)
@@ -7,18 +7,14 @@ from zigzag.api import get_hardware_performance_zigzag_with_mix_spatial_mapping
7
7
  # Test case for when an incomplete spatial_mapping is provided and spatial_mapping_hint is also provided.
8
8
 
9
9
  workloads = (
10
- "zigzag/inputs/examples/workload/alexnet.onnx",
11
- "zigzag/inputs/examples/workload/mobilenetv2.onnx",
12
- "zigzag/inputs/examples/workload/resnet18.onnx",
13
- "zigzag.inputs.examples.workload.resnet18",
10
+ "zigzag/inputs/workload/resnet18.onnx",
11
+ "zigzag/inputs/workload/resnet18.yaml",
14
12
  )
15
13
 
16
14
  # Expected energy and latency for each workload defined above
17
15
  ens_lats = {
18
- "zigzag/inputs/examples/workload/alexnet.onnx": (5679695605, 8299150),
19
- "zigzag/inputs/examples/workload/mobilenetv2.onnx": (901092009, 2610609),
20
- "zigzag/inputs/examples/workload/resnet18.onnx": (1730672410, 3262009),
21
- "zigzag.inputs.examples.workload.resnet18": (2265438430, 4017227),
16
+ "zigzag/inputs/workload/resnet18.onnx": (1730672410, 3262009),
17
+ "zigzag/inputs/workload/resnet18.yaml": (2265438430, 4017227),
22
18
  }
23
19
 
24
20
 
@@ -56,7 +52,7 @@ def accelerator():
56
52
 
57
53
 
58
54
  @pytest.mark.parametrize("workload", workloads)
59
- def test_api(workload, accelerator, mapping):
55
+ def test_api(workload: str, accelerator: str, mapping: str):
60
56
  (energy, latency, cmes) = get_hardware_performance_zigzag_with_mix_spatial_mapping(workload, accelerator, mapping)
61
57
  (expected_energy, expected_latency) = ens_lats[workload]
62
58
  assert energy == pytest.approx(expected_energy)
@@ -7,18 +7,14 @@ from zigzag.api import get_hardware_performance_zigzag_with_mix_spatial_mapping
7
7
  # Test case for when only spatial_mapping_hint is provided.
8
8
 
9
9
  workloads = (
10
- "zigzag/inputs/examples/workload/alexnet.onnx",
11
- "zigzag/inputs/examples/workload/mobilenetv2.onnx",
12
- "zigzag/inputs/examples/workload/resnet18.onnx",
13
- "zigzag.inputs.examples.workload.resnet18",
10
+ "zigzag/inputs/workload/resnet18.onnx",
11
+ "zigzag/inputs/workload/resnet18.yaml",
14
12
  )
15
13
 
16
14
  # Expected energy and latency for each workload defined above
17
15
  ens_lats = {
18
- "zigzag/inputs/examples/workload/alexnet.onnx": (6044768678, 8370470),
19
- "zigzag/inputs/examples/workload/mobilenetv2.onnx": (930702060, 1965457),
20
- "zigzag/inputs/examples/workload/resnet18.onnx": (1724869681, 3257898),
21
- "zigzag.inputs.examples.workload.resnet18": (2220861655, 3934616),
16
+ "zigzag/inputs/workload/resnet18.onnx": (1724869681, 3257898),
17
+ "zigzag/inputs/workload/resnet18.yaml": (2220861655, 3934616),
22
18
  }
23
19
 
24
20
 
@@ -52,7 +48,7 @@ def accelerator():
52
48
 
53
49
 
54
50
  @pytest.mark.parametrize("workload", workloads)
55
- def test_api(workload, accelerator, mapping):
51
+ def test_api(workload: str, accelerator: str, mapping: str):
56
52
  (energy, latency, cmes) = get_hardware_performance_zigzag_with_mix_spatial_mapping(workload, accelerator, mapping)
57
53
  (expected_energy, expected_latency) = ens_lats[workload]
58
54
  assert energy == pytest.approx(expected_energy)
@@ -7,18 +7,14 @@ from zigzag.api import get_hardware_performance_zigzag_with_mix_spatial_mapping
7
7
  # Test case for when more non-existent dimensions are provided in spatial_mapping_hint.
8
8
 
9
9
  workloads = (
10
- "zigzag/inputs/examples/workload/alexnet.onnx",
11
- "zigzag/inputs/examples/workload/mobilenetv2.onnx",
12
- "zigzag/inputs/examples/workload/resnet18.onnx",
13
- "zigzag.inputs.examples.workload.resnet18",
10
+ "zigzag/inputs/workload/resnet18.onnx",
11
+ "zigzag/inputs/workload/resnet18.yaml",
14
12
  )
15
13
 
16
14
  # Expected energy and latency for each workload defined above
17
15
  ens_lats = {
18
- "zigzag/inputs/examples/workload/alexnet.onnx": (5468347515.336, 8210374),
19
- "zigzag/inputs/examples/workload/mobilenetv2.onnx": (730691567.0230001, 3358406),
20
- "zigzag/inputs/examples/workload/resnet18.onnx": (1648700710.272, 2946593),
21
- "zigzag.inputs.examples.workload.resnet18": (1972279074.768, 3455539),
16
+ "zigzag/inputs/workload/resnet18.onnx": (1648700710.272, 2946593),
17
+ "zigzag/inputs/workload/resnet18.yaml": (1972279074.768, 3455539),
22
18
  }
23
19
 
24
20
 
@@ -60,7 +56,7 @@ def accelerator():
60
56
 
61
57
 
62
58
  @pytest.mark.parametrize("workload", workloads)
63
- def test_api(workload, accelerator, mapping):
59
+ def test_api(workload: str, accelerator: str, mapping: str):
64
60
  (energy, latency, cmes) = get_hardware_performance_zigzag_with_mix_spatial_mapping(workload, accelerator, mapping)
65
61
  (expected_energy, expected_latency) = ens_lats[workload]
66
62
  assert energy == pytest.approx(expected_energy)
@@ -5,18 +5,14 @@ sys.path.append("../zigzag")
5
5
  from zigzag.api import get_hardware_performance_zigzag_without_unused_memory
6
6
 
7
7
  workloads = (
8
- "zigzag/inputs/examples/workload/alexnet.onnx",
9
- "zigzag/inputs/examples/workload/mobilenetv2.onnx",
10
- "zigzag/inputs/examples/workload/resnet18.onnx",
11
- "zigzag.inputs.examples.workload.resnet18",
8
+ "zigzag/inputs/workload/resnet18.onnx",
9
+ "zigzag/inputs/workload/resnet18.yaml",
12
10
  )
13
11
 
14
12
  # Expected energy and latency for each workload defined above
15
13
  ens_lats = {
16
- "zigzag/inputs/examples/workload/alexnet.onnx": (5649555894.9, 8637780),
17
- "zigzag/inputs/examples/workload/mobilenetv2.onnx": (1881386179.71, 6486685),
18
- "zigzag/inputs/examples/workload/resnet18.onnx": (1709089377.83, 3583047),
19
- "zigzag.inputs.examples.workload.resnet18": (2243493483.15, 4657130),
14
+ "zigzag/inputs/workload/resnet18.onnx": (1709089377.83, 3583047),
15
+ "zigzag/inputs/workload/resnet18.yaml": (2243493483.15, 4657130),
20
16
  }
21
17
 
22
18
 
@@ -31,7 +27,7 @@ def accelerator():
31
27
 
32
28
 
33
29
  @pytest.mark.parametrize("workload", workloads)
34
- def test_api(workload, accelerator, mapping):
30
+ def test_api(workload: str, accelerator: str, mapping: str):
35
31
  (energy, latency, cmes) = get_hardware_performance_zigzag_without_unused_memory(workload, accelerator, mapping)
36
32
  (expected_energy, expected_latency) = ens_lats[workload]
37
33
  assert energy == pytest.approx(expected_energy)
@@ -5,18 +5,14 @@ sys.path.append("../zigzag")
5
5
  from zigzag.api import get_hardware_performance_zigzag_without_unused_memory
6
6
 
7
7
  workloads = (
8
- "zigzag/inputs/examples/workload/alexnet.onnx",
9
- "zigzag/inputs/examples/workload/mobilenetv2.onnx",
10
- "zigzag/inputs/examples/workload/resnet18.onnx",
11
- "zigzag.inputs.examples.workload.resnet18",
8
+ "zigzag/inputs/workload/resnet18.onnx",
9
+ "zigzag/inputs/workload/resnet18.yaml",
12
10
  )
13
11
 
14
12
  # Expected energy and latency for each workload defined above
15
13
  ens_lats = {
16
- "zigzag/inputs/examples/workload/alexnet.onnx": (5568602396.684999, 8134431),
17
- "zigzag/inputs/examples/workload/mobilenetv2.onnx": (751128562.4699999, 2427487),
18
- "zigzag/inputs/examples/workload/resnet18.onnx": (1784539639.4349997, 3176546),
19
- "zigzag.inputs.examples.workload.resnet18": (2115122870.395, 3884789),
14
+ "zigzag/inputs/workload/resnet18.onnx": (1784539639.4349997, 3176546),
15
+ "zigzag/inputs/workload/resnet18.yaml": (2115122870.395, 3884789),
20
16
  }
21
17
 
22
18
 
@@ -31,7 +27,7 @@ def accelerator():
31
27
 
32
28
 
33
29
  @pytest.mark.parametrize("workload", workloads)
34
- def test_api(workload, accelerator, mapping):
30
+ def test_api(workload: str, accelerator: str, mapping: str):
35
31
  (energy, latency, cmes) = get_hardware_performance_zigzag_without_unused_memory(workload, accelerator, mapping)
36
32
  (expected_energy, expected_latency) = ens_lats[workload]
37
33
  assert energy == pytest.approx(expected_energy)
@@ -5,18 +5,14 @@ sys.path.append("../zigzag")
5
5
  from zigzag.api import get_hardware_performance_zigzag_without_unused_memory
6
6
 
7
7
  workloads = (
8
- "zigzag/inputs/examples/workload/alexnet.onnx",
9
- "zigzag/inputs/examples/workload/mobilenetv2.onnx",
10
- "zigzag/inputs/examples/workload/resnet18.onnx",
11
- "zigzag.inputs.examples.workload.resnet18",
8
+ "zigzag/inputs/workload/resnet18.onnx",
9
+ "zigzag/inputs/workload/resnet18.yaml",
12
10
  )
13
11
 
14
12
  # Expected energy and latency for each workload defined above
15
13
  ens_lats = {
16
- "zigzag/inputs/examples/workload/alexnet.onnx": (5679695605.4400015, 8299150),
17
- "zigzag/inputs/examples/workload/mobilenetv2.onnx": (901092009.6000001, 2610609),
18
- "zigzag/inputs/examples/workload/resnet18.onnx": (1730672410.3200004, 3262009),
19
- "zigzag.inputs.examples.workload.resnet18": (2265438430.2299995, 4017227),
14
+ "zigzag/inputs/workload/resnet18.onnx": (1730672410.3200004, 3262009),
15
+ "zigzag/inputs/workload/resnet18.yaml": (2265438430.2299995, 4017227),
20
16
  }
21
17
 
22
18
 
@@ -31,7 +27,7 @@ def accelerator():
31
27
 
32
28
 
33
29
  @pytest.mark.parametrize("workload", workloads)
34
- def test_api(workload, accelerator, mapping):
30
+ def test_api(workload: str, accelerator: str, mapping: str):
35
31
  (energy, latency, cmes) = get_hardware_performance_zigzag_without_unused_memory(workload, accelerator, mapping)
36
32
  (expected_energy, expected_latency) = ens_lats[workload]
37
33
  assert energy == pytest.approx(expected_energy)