-
Notifications
You must be signed in to change notification settings - Fork 44
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
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…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.
|
… the check condition is more strict.
… dim is mapped on multiple hardware dims
The pytests are now mostly failing, I suggest you investigate why they're no longer passing? |
…support mix sm loop
…t serves all hardware dims
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. |
asyms
approved these changes
Nov 14, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
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.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.spatial_mapping_hint
was not created when a partialspatial_mapping
is provided.