-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* incorporate changes in ZigZag's Workload class, re-enable support for SIMD, transpose and reshape node parsing * support for gather ONNX nodes * fix bug in gather node * LomaStage -> TemporalMappingGeneratorStage * remove old input files (.py) * fix core allocation of some nodes * Show shortened layer name in html schedule * allow for 1st node with non-constant operands + typehints * typehing CN workload * fix bug in core_ids in scheduler * more typehint fixes * tensor node: n-D tensor of sets -> (n+1)-D tensor * upgrade zigzag version * fix bug in nb_unique_data_seen * optimize get_inter_edges * pre-allocate tensor_cns * add Concat node * add dataflow to tpu_like core * fix testing files * use proper equality for Cn in IntraNodeMapping * fix user-defined workload for testing
- Loading branch information
1 parent
6ac8877
commit 5055d7e
Showing
97 changed files
with
1,427 additions
and
2,876 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
zigzag_repo | ||
zigzag | ||
*.out | ||
|
||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
zigzag-dse==3.1.3 | ||
zigzag-dse==3.6.1 | ||
rtree | ||
deap | ||
matplotlib | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import logging | ||
from typing import TypeAlias | ||
|
||
from stream.classes.workload.computation_node import ComputationNode, LoopRanges | ||
|
||
logger = logging.getLogger(__name__) | ||
|
||
GroupAllocation: TypeAlias = dict[tuple[tuple[int, int], ...], int] | ||
|
||
|
||
class GroupIdManager: | ||
def __init__(self): | ||
self.__id_count = 0 | ||
self.groups: GroupAllocation = {} | ||
|
||
def __get_and_raise_id(self): | ||
curr_id = self.__id_count | ||
self.__id_count += 1 | ||
return curr_id | ||
|
||
def get_group_id(self, node: ComputationNode, loop_ranges: LoopRanges) -> int: | ||
"""Return the group id for the given loop ranges. | ||
The group id is determined based on the relevant constant operand dimension loop ranges. | ||
If there is no constant operand, we return 0. | ||
If there is more than one constant operand, we only consider the last one's loop ranges. | ||
If those loop ranges are already contained within 'groups' we return that group id. | ||
Else we add it to the groups dict with an incremented group id. | ||
Args: | ||
node (ComputationNode): The original (layer) CN. | ||
loop_ranges (dict): A dictionary containing the loop range for each dimension | ||
Returns: | ||
int: The group id for the given loop ranges | ||
""" | ||
# No constant operand | ||
if not node.constant_operands: | ||
return self.__get_and_raise_id() | ||
|
||
# Constant operand and known ranges | ||
constant_operand = node.constant_operands[-1] | ||
relevant_dims = node.loop_relevancy_info.get_r_layer_dims(constant_operand) | ||
relevant_ranges = tuple([loop_ranges[dim] for dim in relevant_dims]) | ||
if relevant_ranges in self.groups: | ||
return self.groups[relevant_ranges] | ||
|
||
# Constant operand and new ranges | ||
new_group_id = self.__get_and_raise_id() | ||
self.groups[relevant_ranges] = new_group_id | ||
return new_group_id |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.