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 handles optimization of temporal mapping given a: More...
Public Member Functions | |
def | __init__ (self, *Accelerator accelerator, LayerNode layer, SpatialMappingInternal spatial_mapping, TemporalMappingType mapping_type, int|None loma_lpf_limit=None, **Any kwargs) |
The memory hierarchy from the correct core is extracted from the accelerator. More... | |
None | set_constraints (self, list[PermutationConstraint] constraints) |
Generator[TemporalMapping, None, None] | run (self) |
Runs the LomaEngine. More... | |
def | get_temporal_loops (self) |
Get all loops that have to be temporally scheduled given layer and spatial mapping. More... | |
def | update_min_lpf_factor (self, dict[LayerDim, UnrollFactor] loop_sizes) |
None | get_prime_factors (self) |
Get the prime factors for all temporal loops. More... | |
def | compute_nb_permutations (self) |
Compute the number of permutations that will have to be considered given the LPF distribution. More... | |
def | reduce_static_fps (self) |
tuple[int, int] | find_smallest_non_static_pf (self, LayerDim layer_dim) |
None | limit_lpfs (self) |
Function to limit the total number of loop prime factors present in this instance. More... | |
Generator[list[tuple[LayerDim, int]], None, None] | ordering_generator (self) |
Generator that yields all orderings of the temporal loops. More... | |
Class that handles optimization of temporal mapping given a:
This optimization is carried out through loop order based memory allocation. For each ordering of the temporal loops, they are allocated bottom-up to the levels in the memory hierarchy.
See https://ieeexplore.ieee.org/document/9458493 for more details.
def __init__ | ( | self, | |
*Accelerator | accelerator, | ||
LayerNode | layer, | ||
SpatialMappingInternal | spatial_mapping, | ||
TemporalMappingType | mapping_type, | ||
int | None | loma_lpf_limit = None , |
||
**Any | kwargs | ||
) |
The memory hierarchy from the correct core is extracted from the accelerator.
accelerator | accelerator to use the memory hierarchy of |
layer | layer to generate temporal mappings for |
spatial_mapping | SpatialMapping to use |
loma_lpf_limit | |
kwargs | further unused, for ease of calling only |
def compute_nb_permutations | ( | self | ) |
Compute the number of permutations that will have to be considered given the LPF distribution.
tuple[int, int] find_smallest_non_static_pf | ( | self, | |
LayerDim | layer_dim | ||
) |
None get_prime_factors | ( | self | ) |
Get the prime factors for all temporal loops.
This is saved in three separate class attributes (temporal_loop_pfs, temporal_loop_pf_counts, temporal_loop_pf_count_sums)
def get_temporal_loops | ( | self | ) |
Get all loops that have to be temporally scheduled given layer and spatial mapping.
LayerDimSizes
methods)None limit_lpfs | ( | self | ) |
Function to limit the total number of loop prime factors present in this instance.
This function scans the lpfs and while the number of lpfs is greater than self.lpf_limit it:
Generator[list[tuple[LayerDim, int]], None, None] ordering_generator | ( | self | ) |
Generator that yields all orderings of the temporal loops.
def reduce_static_fps | ( | self | ) |
Generator[TemporalMapping, None, None] run | ( | self | ) |
Runs the LomaEngine.
None set_constraints | ( | self, | |
list[PermutationConstraint] | constraints | ||
) |
def update_min_lpf_factor | ( | self, | |
dict[LayerDim, UnrollFactor] | loop_sizes | ||
) |
accelerator |
constraints |
has_constraints |
layer |
lpf_limit |
lpfs |
mapping_type |
memory_hierarchy |
nb_permutations |
show_progress_bar |
spatial_mapping |
temporal_loop_dim_size |
temporal_loop_pf_count_sums |
temporal_loop_pf_counts |