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.
zigzag.parser.onnx.utils Namespace Reference

Classes

class  OnnxTensorCategory
 Internal representation of ONNX tensor category. More...
 
class  OnnxTensorType
 

Functions

ModelProto parse_onnx_model_from_path (str onnx_model_path)
 
def add_attribute (NodeProto node, str name, Any value)
 
def add_branch_attribute (GraphProto graph, int branch=0)
 
GraphProto unroll_branches (GraphProto graph)
 
def is_dynamic (ModelProto model)
 
ModelProto parse_dynamic_onnx_model (ModelProto model)
 Modifies the given onnx model if there's dynamic behavior in terms of an 'If' operator. More...
 
list[int]|int get_attribute_ints_with_name (str name, Any attrs, list[int]|int|None default=None)
 Return the value of an attribute of given name from the given attributes If name does not exist in attrs, the default provided by the caller is used. More...
 
def get_onnx_tensor_type (str name, ModelProto model)
 
def get_node_input_output_dimension_shapes (NodeProto node, ModelProto model)
 

Variables

 logger = logging.getLogger(__name__)
 
string BRANCH_ATTRIBUTE = "branch"
 

Function Documentation

◆ add_attribute()

def zigzag.parser.onnx.utils.add_attribute ( NodeProto  node,
str  name,
Any  value 
)
Here is the caller graph for this function:

◆ add_branch_attribute()

def zigzag.parser.onnx.utils.add_branch_attribute ( GraphProto  graph,
int   branch = 0 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_attribute_ints_with_name()

list[int] | int zigzag.parser.onnx.utils.get_attribute_ints_with_name ( str  name,
Any  attrs,
list[int] | int | None   default = None 
)

Return the value of an attribute of given name from the given attributes If name does not exist in attrs, the default provided by the caller is used.

If the caller doesn't supply a default, an error is thrown.

Here is the caller graph for this function:

◆ get_node_input_output_dimension_shapes()

def zigzag.parser.onnx.utils.get_node_input_output_dimension_shapes ( NodeProto  node,
ModelProto  model 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_onnx_tensor_type()

def zigzag.parser.onnx.utils.get_onnx_tensor_type ( str  name,
ModelProto  model 
)
Here is the caller graph for this function:

◆ is_dynamic()

def zigzag.parser.onnx.utils.is_dynamic ( ModelProto  model)
Here is the caller graph for this function:

◆ parse_dynamic_onnx_model()

ModelProto zigzag.parser.onnx.utils.parse_dynamic_onnx_model ( ModelProto  model)

Modifies the given onnx model if there's dynamic behavior in terms of an 'If' operator.

All nodes are assigned a 'branch' attribute which specifies in which branch they live. The branch attribute starts from 0 and increases for each seen If operator. The nested graphs of the 'If' operators are then unrolled into a planar onnx model.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ parse_onnx_model_from_path()

ModelProto zigzag.parser.onnx.utils.parse_onnx_model_from_path ( str  onnx_model_path)
Here is the caller graph for this function:

◆ unroll_branches()

GraphProto zigzag.parser.onnx.utils.unroll_branches ( GraphProto  graph)
Here is the caller graph for this function:

Variable Documentation

◆ BRANCH_ATTRIBUTE

string BRANCH_ATTRIBUTE = "branch"

◆ logger

logger = logging.getLogger(__name__)