Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Introduce Weight Diagonal Mapping and Bug Fixes in Spatial Mapping and Cost Model Stages #35

Merged
merged 14 commits into from
Nov 14, 2023

Conversation

JiacongSun
Copy link
Collaborator

New Feature: Support for Weight Diagonal Mapping

We have introduced a new feature that enables weight diagonal mapping when activation is served in the innermost memories and weight stationary is applied. This feature is expected to be useful when the PE array is underutilized, and activation can be reused as the kernel slides across the feature map.

New Parameter

A new parameter can now be provided at the top:

enable_weight_diagonal_mapping:
True -> SpatialMappingGeneratorStage will add a weight-irrelevant spatial loop, if possible, to the hardware dimension served by the activation register.
False (default) -> SpatialMappingGeneratorStage will remain the same as before.

Bug Fixes

  • Previously, SpatialMappingGeneratorStage would generate illegal spatial mapping when a layer dimension is mapped to multiple hardware dimensions. Now, an extra check for legality has been added before yielding the spatial mapping.
  • Previously, CostModelStage would round up the spatial mapping for latency calculation, causing inconsistency with the original spatial mapping. Now, it will fetch the spatial mapping from stages ahead.
  • Fixed the error where spatial_mapping_hint was not created when a partial spatial_mapping is provided.

…on multiple hardware dims; new: adjust the last oa mapping when updating the spatial mapping to be a multiple of the layer dim size; new: only yield 2 spatial mapping options when maximize_hardware_utilization=True (default)
…ng is provided. New: add assertion when no legal spatial mapping is found.
…int in cost_model.py is fetched from SpatialGeneratorStage now to avoid the mapping inconsistence.
@JiacongSun JiacongSun requested a review from asyms November 10, 2023 19:42
@JiacongSun
Copy link
Collaborator Author

  • This merge will have an impact on the latency calculation (slightly increase). Pytest cases are to be updated.

@asyms
Copy link
Contributor

asyms commented Nov 13, 2023

The pytests are now mostly failing, I suggest you investigate why they're no longer passing?

@JiacongSun
Copy link
Collaborator Author

For now, only the pytest cases for mix spatial mappings will be affected. Please see the review section above.

All other pytest cases will stay the same.

Copy link
Contributor

@asyms asyms left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@asyms asyms merged commit 9c8d4a3 into KULeuven-MICAS:master Nov 14, 2023
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants