KULeuven-MICAS / zigzag

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

New Feature: Support User-provided Mix Spatial Mapping, And spatial_mapping_hint Definition Can Be Provided in the Mapping File for Mix Spatial Mapping Auto-generation. #31

Closed JiacongSun closed 11 months ago

JiacongSun commented 11 months ago

New feature: Supporting Mixed Spatial Mapping

We have introduced a new feature that enables the inclusion of mixed spatial mapping in the mapping file, alongside the original single-layer-dimension spatial mapping. For examples, please refer to the files located under the /tests/main/test_with_mix_spatial_mapping folder.

New parameter in the input mapping file:

spatial_mapping_hint: Dict: {hardware_dimension: [supported_layer_dimensions]}. This parameter only works when spatial_mappingis not provided or partially provided in the mapping file. Now the generated spatial mappings will only be on the layer dimensions defined in spatial_mapping_hint. It will be assumed to include all layer dimensions if this parameter is not provided.

New parameters can be provided from the top:

enable_mix_spatial_mapping_generation:

maximize_hardware_utilization:

Adds/Changes:

Bug Fixes:

JiacongSun commented 11 months ago

New fixes:

  1. When only spatial_mapping is provided while spatial_mapping_hint is not provided (Test: test_with_mix_spatial_mapping/test_ascend_like.py).
  2. When both spatial_mapping and spatial_mapping_hint are provided (Test: test_with_mix_spatial_mapping/test_edge_tpu_like.py).
  3. When an incomplete spatial_mapping is provided, and spatial_mapping_hint is provided (Test: test_with_mix_spatial_mapping/test_meta_prototype_like.py).
  4. When only spatial_mapping_hint is provided (Test: test_with_mix_spatial_mapping/test_tesla_npu_like.py).
  5. When the number of dimensions provided in the spatial_mapping_hint exceeds the dimensions available in the hardware (Test: test_with_mix_spatial_mapping/test_tpu_like.py).