Closed JiacongSun closed 11 months ago
Corrected an erroneous API call in the original pytest cases.
Updated pytest cases to include five tests, each addressing different scenarios related to mixed spatial mapping features:
spatial_mapping
is provided while spatial_mapping_hint
is not provided (Test: test_with_mix_spatial_mapping/test_ascend_like.py
).spatial_mapping
and spatial_mapping_hint
are provided (Test: test_with_mix_spatial_mapping/test_edge_tpu_like.py
).spatial_mapping
is provided, and spatial_mapping_hint
is provided (Test: test_with_mix_spatial_mapping/test_meta_prototype_like.py
).spatial_mapping_hint
is provided (Test: test_with_mix_spatial_mapping/test_tesla_npu_like.py
).spatial_mapping_hint
exceeds the dimensions available in the hardware (Test: test_with_mix_spatial_mapping/test_tpu_like.py
).
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 whenspatial_mapping
is 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
:SpatialMappingGeneratorStage
will auto-generate mix spatial mapping.SpatialMappingGeneratorStage
will stick to spatial mapping of single layer dimension.maximize_hardware_utilization
:SpatialMappingGeneratorStage
will only keep two spatial mapping candidates for each hardware dimension, which has the highest hardware utilization, for a faster simulation time.SpatialMappingGeneratorStage
will keep all spatial mapping candidates it found.Adds/Changes:
SpatialMappingGeneratorStage
now can also generate mix spatial mappings.SpatialMappingConversionStage
now can also interpret mix spatial mappings./tests/main/test_with_mix_spatial_mapping
folder for testing scenarios involving mixed spatial mapping. Additionally, a dedicated test case with aspatial_mapping_hint
definition can be found intest_tesla_npu_like.py
.Bug Fixes:
SpatialMappingGeneratorStage
has been fixed for cases where only parts of the spatial mapping are user-provided.LomaStage
, where the same layer dimension was mapped to different hardware dimensions, has been resolved. Now, these spatial mappings on different hardware dimensions are merged before being sent toLomaStage
.