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.
|
Represents a single layer in a workload. More...
Public Member Functions | |
def | __init__ (self, int layer_id, str node_name, LayerNodeAttributes node_attr, MappingAttributes mapping_attr) |
To construct each layer node, algorithm equation/dimension/indirect relation are parsed. More... | |
LayerOperand | get_act_layer_op (self) |
Return the I LayerOperand: either the non-constant operand or one of the input operands if none are constant. More... | |
LayerOperand | get_weight_layer_op (self) |
Return the W LayerOperand: either the constant operand or one of the input operands if none are constant. More... | |
tuple[PrLoop, LoopList, PrScalingFactors] | build_pr_funcs (self) |
def | __str__ (self) |
def | __jsonrepr__ (self) |
JSON representation used for saving this object to a json file. More... | |
float | calc_tensor_size (self, LayerOperand layer_op, LayerDimSizes layer_dim_sizes) |
Calculates the tensor size (nb of elements) for the given operand layer_op with the given loop dimension sizes layer_dim_sizes. More... | |
def | calc_tensor_dim (self, LayerDim dim, LayerDimSizes layer_dim_sizes) |
dict[LayerDim, UnrollFactor] | calc_tensor_dims (self, LayerOperand layer_op, LayerDimSizes layer_dim_sizes) |
int | calc_pr_dimension_size_total (self, LayerDim dim) |
Compute the total pr dimension size of this node, taking padding into account. More... | |
def | extract_layer_info (self) |
This function extract basic information for each layer node. More... | |
list[LayerDim] | get_operand_irrelevant_layer_dims (self, LayerOperand layer_op) |
Return the irrelevant dimensions of layer operand 'layer_op'. More... | |
LayerNodeAttributes | extract_node_attr (self) |
Pack this layer node's attributes in a LayerNodeAttributes instance. More... | |
MappingAttributes | extract_mapping_attr (self) |
![]() | |
def | __init__ (self, int node_id, str node_name) |
str | __repr__ (self) |
Static Public Member Functions | |
def | calc_pr_dimension_size (int sa, int a, int sb, int b) |
Calculates the number of unique indices c generated by iterating through the indices a in range(0,A,1) and b in range(0,B,1) according to the equation c = sa * a + sb * b. More... | |
Represents a single layer in a workload.
def __init__ | ( | self, | |
int | layer_id, | ||
str | node_name, | ||
LayerNodeAttributes | node_attr, | ||
MappingAttributes | mapping_attr | ||
) |
To construct each layer node, algorithm equation/dimension/indirect relation are parsed.
This parser collects information of operand, loop dimension, and loop relevance. Equal-to-1 loop dimensions are eliminated.
layer_id | The identifier (key) of the layer, as defined in the workload |
node_name | an optional name for the Node. E.g. the node's name from the onnx model. |
def __jsonrepr__ | ( | self | ) |
JSON representation used for saving this object to a json file.
Reimplemented from LayerNodeABC.
def __str__ | ( | self | ) |
tuple[PrLoop, LoopList, PrScalingFactors] build_pr_funcs | ( | self | ) |
|
static |
Calculates the number of unique indices c generated by iterating through the indices a in range(0,A,1) and b in range(0,B,1) according to the equation c = sa * a + sb * b.
sa and sb thus represent the scaling of a, resp. b.
int calc_pr_dimension_size_total | ( | self, | |
LayerDim | dim | ||
) |
Compute the total pr dimension size of this node, taking padding into account.
dim | (str): The partially relevant dimension, e.g. 'IX'. |
def calc_tensor_dim | ( | self, | |
LayerDim | dim, | ||
LayerDimSizes | layer_dim_sizes | ||
) |
dict[LayerDim, UnrollFactor] calc_tensor_dims | ( | self, | |
LayerOperand | layer_op, | ||
LayerDimSizes | layer_dim_sizes | ||
) |
float calc_tensor_size | ( | self, | |
LayerOperand | layer_op, | ||
LayerDimSizes | layer_dim_sizes | ||
) |
Calculates the tensor size (nb of elements) for the given operand layer_op with the given loop dimension sizes layer_dim_sizes.
def extract_layer_info | ( | self | ) |
This function extract basic information for each layer node.
MappingAttributes extract_mapping_attr | ( | self | ) |
LayerNodeAttributes extract_node_attr | ( | self | ) |
Pack this layer node's attributes in a LayerNodeAttributes instance.
Useful for instantiating new layer nodes (used in Stream)
LayerOperand get_act_layer_op | ( | self | ) |
Return the I
LayerOperand: either the non-constant operand or one of the input operands if none are constant.
list[LayerDim] get_operand_irrelevant_layer_dims | ( | self, | |
LayerOperand | layer_op | ||
) |
Return the irrelevant dimensions of layer operand 'layer_op'.
LayerOperand get_weight_layer_op | ( | self | ) |
Return the W
LayerOperand: either the constant operand or one of the input operands if none are constant.
constant_operands |
dimension_relations |
equation |
input_operand_source |
input_operands |
layer_dim_sizes |
layer_dims |
layer_operands |
loop_relevancy_info |
memory_operand_links |
operand_data_reuse |
operand_precision |
operand_size_bit |
output_operand |
padding |
pr_decoupled_relevancy_info |
pr_layer_dim_sizes |
pr_scaling_factors |
spatial_mapping |
spatial_mapping_hint |
temporal_ordering |
total_mac_count |
type |