ZigZag - Deep Learning Hardware Design Space Exploration
This repository presents the novel version of our tried-and-tested hardware Architecture-Mapping Design Space Exploration (DSE) Framework for Deep Learning (DL) accelerators. ZigZag bridges the gap between algorithmic DL decisions and their acceleration cost on specialized accelerators through a fast and accurate hardware cost estimation.
SpatialMappingInternal Class Reference

Class that collect all the info related to spatial mapping. More...

Public Member Functions

def __init__ (self, SpatialMappingPerMemLvl spatial_mapping_dict, "LayerNode" layer_node)
 
def __str__ (self)
 
def __repr__ (self)
 
def __jsonrepr__ (self)
 JSON representation of this object to save it to a file. More...
 
def get_unrolling (self, LayerOperand op, int level)
 Return the unrolled loops for operand 'op' at level 'level'. More...
 
list[tuple[LayerDim, UnrollFactor]] get_unrolling_all (self, LayerOperand op, int min_level)
 Return all the spatial loops at a given level and above for a given operand. More...
 
None calc_unroll_size (self)
 Calculate unrolled loop size for different loop types (r/ir/total) per operand per architecture level. More...
 
def calc_unit_count (self)
 Calculate total/unique/duplicate unit count per operand per architecture level. More...
 
def calc_data_serve_scope (self)
 Calculate data serve scope, i.e., for input operands, it means that each data element is broadcast to how many unit at below level; for output operand, it means that how many unit add/collect their output values to one result, and push it to above level. More...
 
def calc_mem_bw_boost_factor (self)
 Calculate memory bandwidth incremental factor between architectural levels. More...
 
None save_spatial_loop_dim_size (self)
 Save the loops that were unrolled spatially in a list without any arch level information for easy access in loma. More...
 

Public Attributes

 mapping_dict_origin
 
 layer_node
 
 arch_level
 
 unroll_size_r
 
 unroll_size_ir
 
 unroll_size_total
 
 unit_count
 
 unit_unique
 
 unit_duplicate
 
 data_serve_scope
 
 mem_bw_boost
 

Detailed Description

Class that collect all the info related to spatial mapping.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
SpatialMappingPerMemLvl  spatial_mapping_dict,
"LayerNode"  layer_node 
)

Member Function Documentation

◆ __jsonrepr__()

def __jsonrepr__ (   self)

JSON representation of this object to save it to a file.

Here is the call graph for this function:

◆ __repr__()

def __repr__ (   self)

◆ __str__()

def __str__ (   self)

◆ calc_data_serve_scope()

def calc_data_serve_scope (   self)

Calculate data serve scope, i.e., for input operands, it means that each data element is broadcast to how many unit at below level; for output operand, it means that how many unit add/collect their output values to one result, and push it to above level.

NOTE: data_serve_scope doesn't include MAC level, thus is one level less than other spatial mapping attributes.

data_serve_scope is calculated by dividing unit_duplicate at current level by unit_count at one level above.

◆ calc_mem_bw_boost_factor()

def calc_mem_bw_boost_factor (   self)

Calculate memory bandwidth incremental factor between architectural levels.

   NOTE: mem_bw_boost doesn't include MAC level, thus is one level less than other spatial mapping attributes.

   mem_bw_boost can calculated by either dividing unit_unique at current level by unit_count at one level above.

◆ calc_unit_count()

def calc_unit_count (   self)

Calculate total/unique/duplicate unit count per operand per architecture level.

◆ calc_unroll_size()

None calc_unroll_size (   self)

Calculate unrolled loop size for different loop types (r/ir/total) per operand per architecture level.

◆ get_unrolling()

def get_unrolling (   self,
LayerOperand  op,
int  level 
)

Return the unrolled loops for operand 'op' at level 'level'.

'level' = 0 would signify the operational level.

Here is the caller graph for this function:

◆ get_unrolling_all()

list[tuple[LayerDim, UnrollFactor]] get_unrolling_all (   self,
LayerOperand  op,
int  min_level 
)

Return all the spatial loops at a given level and above for a given operand.

    Args:
        op (str): The layer operand for which to return the spatial loops.
        min_level (int): The lowest level.

    Returns:
        list: A list of all spatial loops at given level and above.
    # TODO this has the same functionality as SpatialMapping.flatten_unrollings()
Here is the call graph for this function:

◆ save_spatial_loop_dim_size()

None save_spatial_loop_dim_size (   self)

Save the loops that were unrolled spatially in a list without any arch level information for easy access in loma.

We take one of the input operands and go through the spatial mapping dict for that operand. Which operand shouldn't matter as all operands store the same loops, but possibly at different arch levels.

Member Data Documentation

◆ arch_level

arch_level

◆ data_serve_scope

data_serve_scope

◆ layer_node

layer_node

◆ mapping_dict_origin

mapping_dict_origin

◆ mem_bw_boost

mem_bw_boost

◆ unit_count

unit_count

◆ unit_duplicate

unit_duplicate

◆ unit_unique

unit_unique

◆ unroll_size_ir

unroll_size_ir

◆ unroll_size_r

unroll_size_r

◆ unroll_size_total

unroll_size_total

The documentation for this class was generated from the following file: