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.
|
Class that represents a memory hierarchy as a directed networkx graph. More...
Public Member Functions | |
def | __init__ (self, OperationalArrayABC operational_array, str name="Memory Hierarchy", **Any attr) |
Initialize the memory hierarchy graph. More... | |
None | add_memory (self, MemoryInstance memory_instance, list[MemoryOperand] operands, PortAllocation port_alloc, ServedMemDimensions served_dimensions) |
Adds a memory to the memory hierarchy graph. More... | |
list[MemoryLevel] | get_memory_levels (self, MemoryOperand mem_op) |
Returns a list of memories in the memory hierarchy for the memory operand. More... | |
set[MemoryOperand] | get_operands (self) |
Returns all the memory operands this memory hierarchy graph contains as a set. More... | |
list[MemoryLevel] | get_inner_memories (self) |
Returns the inner-most memory levels for all memory operands. More... | |
list[MemoryLevel] | get_outer_memories (self) |
Returns the outer-most memory levels for all memory operands. More... | |
tuple[list[MemoryLevel], int] | get_top_memories (self) |
Returns the 'top'-most MemoryLevels, where 'the' level of MemoryLevel is considered to be the largest level it has across its assigned operands. More... | |
tuple[list[MemoryLevel], int] | get_operator_top_level (self, MemoryOperand operand) |
Finds the highest level of memories that have the given operand assigned to it, and returns the MemoryLevel instance on this level that have the operand assigned to it. More... | |
MemoryLevel | get_operand_top_level (self, MemoryOperand operand) |
Finds the highest level of memory that have the given operand assigned to, and returns the MemoryLevel. More... | |
def | __jsonrepr__ (self) |
JSON Representation of this object to save it to a json file. More... | |
bool | __eq__ (self, object other) |
def | has_same_performance (self, "MemoryHierarchy" other) |
![]() | |
list[tuple[T, T]] | in_edges (self, T node, Literal[False] data) |
list[tuple[T, T, dict[str, Any]]] | in_edges (self, T node, Literal[True] data) |
list[tuple[T, T]] | in_edges (self, T node) |
list[tuple[T, T]]|list[tuple[T, T, dict[str, Any]]] | in_edges (self, T node, bool data=False) |
list[tuple[T, T, dict[str, Any]]] | out_edges (self, T node, Literal[True] data) |
list[tuple[T, T]] | out_edges (self, T node, Literal[False] data) |
list[tuple[T, T]] | out_edges (self, T node) |
list[tuple[T, T]]|list[tuple[T, T, dict[str, Any]]] | out_edges (self, T node, bool data=False) |
Iterator[tuple[T, int]] | in_degree (self) |
Iterator[tuple[T, int]] | out_degree (self, Literal[None] node) |
Iterator[tuple[T, int]] | out_degree (self) |
int | out_degree (self, T node) |
int|Iterator[tuple[T, int]] | out_degree (self, T|None node=None) |
Iterator[T] | successors (self, T node) |
Iterator[T] | predecessors (self, T node) |
Iterator[T] | topological_sort (self) |
None | add_node (self, T node) |
None | add_nodes_from (self, Sequence[T] node) |
None | remove_nodes_from (self, Iterator[T] nodes) |
None | add_edge (self, T edge_from, T edge_to) |
None | add_edges_from (self, Sequence[tuple[T, T]|tuple[T, T, Any]] edges) |
Iterator[list[T]] | all_simple_paths (self, T producer, T consumer) |
list[T] | shortest_path (self, T producer, T consumer) |
list[T] | node_list (self) |
T | get_node_with_id (self, int node_id) |
Public Attributes | |
name | |
operational_array | |
memory_level_id | |
nb_levels | |
Class that represents a memory hierarchy as a directed networkx graph.
The memory hierarchy graph is directed, with the root nodes representing the lowest level in the memory hierarchy.
def __init__ | ( | self, | |
OperationalArrayABC | operational_array, | ||
str | name = "Memory Hierarchy" , |
||
**Any | attr | ||
) |
Initialize the memory hierarchy graph.
The initialization sets the operational array this memory hierarchy will connect to. The graph nodes are the given nodes. The edges are extracted from the operands the memory levels store.
nodes | a list of MemoryLevels. Entries need to be provided from lowest to highest memory level. |
bool __eq__ | ( | self, | |
object | other | ||
) |
def __jsonrepr__ | ( | self | ) |
JSON Representation of this object to save it to a json file.
None add_memory | ( | self, | |
MemoryInstance | memory_instance, | ||
list[MemoryOperand] | operands, | ||
PortAllocation | port_alloc, | ||
ServedMemDimensions | served_dimensions | ||
) |
Adds a memory to the memory hierarchy graph.
NOTE: memory level need to be added from bottom level (e.g., Reg) to top level (e.g., DRAM) for each operand !!!
Internally a MemoryLevel object is built, which represents the memory node.
Edges are added from all sink nodes in the graph to this node if the memory operands match
memory_instance | The MemoryInstance containing the different memory characteristics. |
operands | The memory operands the memory level stores. |
served_dimensions | The operational array dimensions this memory level serves. Default: no served dimensions -> unroll over |
list[MemoryLevel] get_inner_memories | ( | self | ) |
Returns the inner-most memory levels for all memory operands.
list[MemoryLevel] get_memory_levels | ( | self, | |
MemoryOperand | mem_op | ||
) |
Returns a list of memories in the memory hierarchy for the memory operand.
The first entry in the returned list is the innermost memory level.
MemoryLevel get_operand_top_level | ( | self, | |
MemoryOperand | operand | ||
) |
Finds the highest level of memory that have the given operand assigned to, and returns the MemoryLevel.
set[MemoryOperand] get_operands | ( | self | ) |
Returns all the memory operands this memory hierarchy graph contains as a set.
tuple[list[MemoryLevel], int] get_operator_top_level | ( | self, | |
MemoryOperand | operand | ||
) |
Finds the highest level of memories that have the given operand assigned to it, and returns the MemoryLevel instance on this level that have the operand assigned to it.
'The' level of a MemoryLevel is considered to be the largest level it has across its assigned operands.
list[MemoryLevel] get_outer_memories | ( | self | ) |
Returns the outer-most memory levels for all memory operands.
tuple[list[MemoryLevel], int] get_top_memories | ( | self | ) |
Returns the 'top'-most MemoryLevels, where 'the' level of MemoryLevel is considered to be the largest level it has across its assigned operands.
def has_same_performance | ( | self, | |
"MemoryHierarchy" | other | ||
) |
memory_level_id |
name |
nb_levels |
operational_array |