Skip to content

Commit

Permalink
Merge pull request #6 from JiacongSun/master
Browse files Browse the repository at this point in the history
Bug Fix 0.1: Issue Resolutions (SpatialMappingGeneratorStage and CACTI Script)
  • Loading branch information
JiacongSun authored Nov 15, 2023
2 parents 5d91e85 + d2ddfdd commit cb865a9
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 16 deletions.
14 changes: 7 additions & 7 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions zigzag/classes/hardware/architecture/get_cacti_cost.py
Original file line number Diff line number Diff line change
Expand Up @@ -487,15 +487,15 @@ def get_cacti_cost(cacti_path, tech_node, mem_type, mem_size_in_byte, bw, hd_has
pass
# get required cost
try:
access_time = scaling_factor*float(result[' Access time (ns)'][0]) # unit: ns
access_time = scaling_factor*float(result[' Access time (ns)'][-1]) # unit: ns
if bw > 32:
area = scaling_factor*float(result[' Area (mm2)'][0]) * 2 * bw/32 # unit: mm2
r_cost = scaling_factor*float(result[' Dynamic read energy (nJ)'][0]) * bw/32 # unit: nJ
w_cost = scaling_factor*float(result[' Dynamic write energy (nJ)'][0]) * bw/32 # unit: nJ
area = scaling_factor*float(result[' Area (mm2)'][-1]) * 2 * bw/32 # unit: mm2
r_cost = scaling_factor*float(result[' Dynamic read energy (nJ)'][-1]) * bw/32 # unit: nJ
w_cost = scaling_factor*float(result[' Dynamic write energy (nJ)'][-1]) * bw/32 # unit: nJ
else:
area = scaling_factor*float(result[' Area (mm2)'][0]) * 2 # unit: mm2
r_cost = scaling_factor*float(result[' Dynamic read energy (nJ)'][0]) # unit: nJ
w_cost = scaling_factor*float(result[' Dynamic write energy (nJ)'][0]) # unit: nJ
area = scaling_factor*float(result[' Area (mm2)'][-1]) * 2 # unit: mm2
r_cost = scaling_factor*float(result[' Dynamic read energy (nJ)'][-1]) # unit: nJ
w_cost = scaling_factor*float(result[' Dynamic write energy (nJ)'][-1]) # unit: nJ
except KeyError:
_logging.critical(f'**KeyError** in result, current result: {result}')
breakpoint()
Expand Down
5 changes: 3 additions & 2 deletions zigzag/classes/stages/SpatialMappingGeneratorStage.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,11 +215,12 @@ def modify_innermost_input_mem_size(self, core_id, user_spatial_mapping):
if layer_op_to_mem_op[act_operand] in mem_ops:
act_innermost_mem_level = memory_level
act_served_oa_dim: set = memory_level.served_dimensions
act_served_oa_dim_name = list(act_served_oa_dim)[0].name
# check if act is not served in the innermost memories, or it is uti-casting for act.
# keep the spatial loop as it was if act is not served.
if "act_served_oa_dim" not in locals() or len(act_served_oa_dim) == 0:
if "act_served_oa_dim" not in locals() or len(act_served_oa_dim) != 1:
return input_mem_size_updated, self.accelerator
else:
act_served_oa_dim_name = list(act_served_oa_dim)[0].name
# get the mem scaling factor if OX, OY exist
mem_scaling_factor = 1
if (
Expand Down
Binary file removed zigzag/visualization/list_of_cmes.pickle
Binary file not shown.

0 comments on commit cb865a9

Please sign in to comment.