Skip to content

Commit

Permalink
New feature: supporting ox/oy diagonal mapping. Fix: spatial_mapping_…
Browse files Browse the repository at this point in the history
…int in cost_model.py is fetched from SpatialGeneratorStage now to avoid the mapping inconsistence.
  • Loading branch information
JiacongSun committed Nov 10, 2023
1 parent dd45365 commit b9738e1
Show file tree
Hide file tree
Showing 5 changed files with 610 additions and 112 deletions.
4 changes: 3 additions & 1 deletion zigzag/classes/cost_model/cost_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,12 +211,14 @@ def __init__(
accelerator,
layer,
spatial_mapping,
spatial_mapping_int,
temporal_mapping,
access_same_data_considered_as_no_access=True,
):
self.accelerator = accelerator
self.layer = layer
self.spatial_mapping = spatial_mapping
self.spatial_mapping_int = spatial_mapping_int # the original spatial mapping without decimal
self.temporal_mapping = temporal_mapping
self.access_same_data_considered_as_no_access = (
access_same_data_considered_as_no_access
Expand Down Expand Up @@ -249,7 +251,7 @@ def __init__(
# self.spatial_mapping_dict_int = spatial_mapping_fractional_to_int(
# self.spatial_mapping.mapping_dict_origin
# )
self.spatial_mapping_dict_int = self.spatial_mapping.mapping_dict_origin
self.spatial_mapping_dict_int = self.spatial_mapping_int

# For constructing Mapping object, the last parameter "self.access_same_data_considered_as_no_access" is optional
self.mapping = Mapping(
Expand Down
Loading

0 comments on commit b9738e1

Please sign in to comment.