Class that collect all the info related to spatial mapping.
More...
|
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...
|
|
Class that collect all the info related to spatial mapping.
◆ __init__()
def __init__ |
( |
|
self, |
|
|
SpatialMappingPerMemLvl |
spatial_mapping_dict, |
|
|
"LayerNode" |
layer_node |
|
) |
| |
◆ __jsonrepr__()
JSON representation of this object to save it to a file.
◆ __repr__()
◆ __str__()
◆ 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()
Return the unrolled loops for operand 'op' at level 'level'.
'level' = 0 would signify the operational level.
◆ get_unrolling_all()
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()
◆ 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.
◆ arch_level
◆ data_serve_scope
◆ layer_node
◆ mapping_dict_origin
◆ mem_bw_boost
◆ unit_count
◆ unit_duplicate
◆ unit_unique
◆ unroll_size_ir
◆ unroll_size_r
◆ unroll_size_total
The documentation for this class was generated from the following file: