Skip to content

Commit

Permalink
move all classes subfolders out and remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
asyms committed Sep 4, 2024
1 parent 5055d7e commit 169c362
Show file tree
Hide file tree
Showing 80 changed files with 249 additions and 576 deletions.
22 changes: 12 additions & 10 deletions main_stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,16 @@

from zigzag.stages.MainStage import MainStage

from stream.classes.stages.AcceleratorParserStage import (
from stream.stages.allocation.genetic_algorithm_allocation import GeneticAlgorithmAllocationStage
from stream.stages.estimation.zigzag_core_mapping_estimation import ZigZagCoreMappingEstimationStage
from stream.stages.generation.hint_loops_partitioned_workload_generation import (
HintLoopsPartitionedWorkloadGenerationStage,
)
from stream.stages.generation.scheduling_order_generation import SchedulingOrderGenerationStage
from stream.stages.parsing.accelerator_parser import (
AcceleratorParserStage as AcceleratorParserStage_,
)
from stream.classes.stages.DetermineSchedulingOrderStage import DetermineSchedulingOrderStage
from stream.classes.stages.GenerateCNWorkloadHybridStage import GenerateCNWorkloadHybridStage
from stream.classes.stages.InterCoreMappingStage import InterCoreMappingStage
from stream.classes.stages.IntraCoreMappingStage import IntraCoreMappingStage
from stream.classes.stages.ModelParserStage import ONNXModelParserStage as StreamONNXModelParserStage
from stream.stages.parsing.onnx_model_parser import ONNXModelParserStage as StreamONNXModelParserStage
from stream.visualization.memory_usage import plot_memory_usage
from stream.visualization.schedule import (
plot_timeline_brokenaxes,
Expand Down Expand Up @@ -70,10 +72,10 @@
AcceleratorParserStage_, # Parses the accelerator
StreamONNXModelParserStage, # Parses the ONNX Model into the workload
# UserDefinedModelParserStage, # Parses the user-defined Model into the workload
GenerateCNWorkloadHybridStage,
IntraCoreMappingStage,
DetermineSchedulingOrderStage,
InterCoreMappingStage,
HintLoopsPartitionedWorkloadGenerationStage,
ZigZagCoreMappingEstimationStage,
SchedulingOrderGenerationStage,
GeneticAlgorithmAllocationStage,
],
accelerator=accelerator, # required by AcceleratorParserStage
workload_path=workload_path, # required by ModelParserStage
Expand Down
18 changes: 10 additions & 8 deletions main_stream_layer_splitting.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@

from zigzag.stages.MainStage import MainStage

from stream.classes.stages.AcceleratorParserStage import AcceleratorParserStage as AcceleratorParserStage_
from stream.classes.stages.GenerateCNWorkloadHybridStage import GenerateCNWorkloadHybridStage
from stream.classes.stages.InterCoreMappingStage import InterCoreMappingStage
from stream.classes.stages.IntraCoreMappingStage import IntraCoreMappingStage
from stream.classes.stages.ModelParserStage import ONNXModelParserStage as StreamONNXModelParserStage
from stream.stages.allocation.genetic_algorithm_allocation import GeneticAlgorithmAllocationStage
from stream.stages.estimation.zigzag_core_mapping_estimation import ZigZagCoreMappingEstimationStage
from stream.stages.generation.hint_loops_partitioned_workload_generation import (
HintLoopsPartitionedWorkloadGenerationStage,
)
from stream.stages.parsing.accelerator_parser import AcceleratorParserStage as AcceleratorParserStage_
from stream.stages.parsing.onnx_model_parser import ONNXModelParserStage as StreamONNXModelParserStage
from stream.visualization.memory_usage import plot_memory_usage
from stream.visualization.schedule import (
plot_timeline_brokenaxes,
Expand Down Expand Up @@ -69,9 +71,9 @@
AcceleratorParserStage_, # Parses the accelerator
StreamONNXModelParserStage, # Parses the ONNX Model into the workload
# UserDefinedModelParserStage, # Parses the user-defined Model into the workload
GenerateCNWorkloadHybridStage,
IntraCoreMappingStage,
InterCoreMappingStage,
HintLoopsPartitionedWorkloadGenerationStage,
ZigZagCoreMappingEstimationStage,
GeneticAlgorithmAllocationStage,
],
accelerator=accelerator, # required by AcceleratorParserStage
workload_path=workload_path, # required by ModelParserStage
Expand Down
18 changes: 10 additions & 8 deletions main_stream_mode_3.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@

from zigzag.stages.MainStage import MainStage

from stream.classes.stages.AcceleratorParserStage import AcceleratorParserStage as AcceleratorParserStage_
from stream.classes.stages.GenerateCNWorkloadHybridStage import GenerateCNWorkloadHybridStage
from stream.classes.stages.InterCoreMappingStage import InterCoreMappingStage
from stream.classes.stages.IntraCoreMappingStage import IntraCoreMappingStage
from stream.classes.stages.ModelParserStage import ONNXModelParserStage as StreamONNXModelParserStage
from stream.stages.allocation.genetic_algorithm_allocation import GeneticAlgorithmAllocationStage
from stream.stages.estimation.zigzag_core_mapping_estimation import ZigZagCoreMappingEstimationStage
from stream.stages.generation.hint_loops_partitioned_workload_generation import (
HintLoopsPartitionedWorkloadGenerationStage,
)
from stream.stages.parsing.accelerator_parser import AcceleratorParserStage as AcceleratorParserStage_
from stream.stages.parsing.onnx_model_parser import ONNXModelParserStage as StreamONNXModelParserStage
from stream.visualization.memory_usage import plot_memory_usage
from stream.visualization.schedule import (
plot_timeline_brokenaxes,
Expand Down Expand Up @@ -76,9 +78,9 @@
AcceleratorParserStage_, # Parses the accelerator
StreamONNXModelParserStage, # Parses the ONNX Model into the workload
# UserDefinedModelParserStage, # Parses the user-defined Model into the workload
GenerateCNWorkloadHybridStage,
IntraCoreMappingStage,
InterCoreMappingStage,
HintLoopsPartitionedWorkloadGenerationStage,
ZigZagCoreMappingEstimationStage,
GeneticAlgorithmAllocationStage,
],
accelerator=accelerator, # required by AcceleratorParserStage
workload_path=workload_path, # required by ModelParserStage
Expand Down
18 changes: 10 additions & 8 deletions main_stream_mode_4.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@

from zigzag.stages.MainStage import MainStage

from stream.classes.stages.AcceleratorParserStage import AcceleratorParserStage as AcceleratorParserStage_
from stream.classes.stages.GenerateCNWorkloadHybridStage import GenerateCNWorkloadHybridStage
from stream.classes.stages.InterCoreMappingStage import InterCoreMappingStage
from stream.classes.stages.IntraCoreMappingStage import IntraCoreMappingStage
from stream.classes.stages.ModelParserStage import ONNXModelParserStage as StreamONNXModelParserStage
from stream.stages.allocation.genetic_algorithm_allocation import GeneticAlgorithmAllocationStage
from stream.stages.estimation.zigzag_core_mapping_estimation import ZigZagCoreMappingEstimationStage
from stream.stages.generation.hint_loops_partitioned_workload_generation import (
HintLoopsPartitionedWorkloadGenerationStage,
)
from stream.stages.parsing.accelerator_parser import AcceleratorParserStage as AcceleratorParserStage_
from stream.stages.parsing.onnx_model_parser import ONNXModelParserStage as StreamONNXModelParserStage
from stream.visualization.memory_usage import plot_memory_usage
from stream.visualization.schedule import (
plot_timeline_brokenaxes,
Expand Down Expand Up @@ -75,9 +77,9 @@
AcceleratorParserStage_, # Parses the accelerator
StreamONNXModelParserStage, # Parses the ONNX Model into the workload
# UserDefinedModelParserStage, # Parses the user-defined Model into the workload
GenerateCNWorkloadHybridStage,
IntraCoreMappingStage,
InterCoreMappingStage,
HintLoopsPartitionedWorkloadGenerationStage,
ZigZagCoreMappingEstimationStage,
GeneticAlgorithmAllocationStage,
],
accelerator=accelerator, # required by AcceleratorParserStage
workload_path=workload_path, # required by ModelParserStage
Expand Down
20 changes: 11 additions & 9 deletions main_testing_1_core_with_testing_workload.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@

from zigzag.stages.MainStage import MainStage

from stream.classes.cost_model.cost_model import StreamCostModelEvaluation
from stream.classes.stages.AcceleratorParserStage import AcceleratorParserStage as AcceleratorParserStage_
from stream.classes.stages.GenerateCNWorkloadHybridStage import GenerateCNWorkloadHybridStage
from stream.classes.stages.InterCoreMappingStage import InterCoreMappingStage
from stream.classes.stages.IntraCoreMappingStage import IntraCoreMappingStage
from stream.classes.stages.ModelParserStage import UserDefinedModelParserStage
from stream.cost_model.cost_model import StreamCostModelEvaluation
from stream.stages.allocation.genetic_algorithm_allocation import GeneticAlgorithmAllocationStage
from stream.stages.estimation.zigzag_core_mapping_estimation import ZigZagCoreMappingEstimationStage
from stream.stages.generation.hint_loops_partitioned_workload_generation import (
HintLoopsPartitionedWorkloadGenerationStage,
)
from stream.stages.parsing.accelerator_parser import AcceleratorParserStage as AcceleratorParserStage_
from stream.stages.parsing.onnx_model_parser import UserDefinedModelParserStage
from stream.visualization.memory_usage import plot_memory_usage
from stream.visualization.schedule import visualize_timeline_plotly

Expand Down Expand Up @@ -39,9 +41,9 @@
AcceleratorParserStage_, # Parses the accelerator
# StreamONNXModelParserStage, # Parses the ONNX Model into the workload
UserDefinedModelParserStage, # Parses the user-defined Model into the workload
GenerateCNWorkloadHybridStage,
IntraCoreMappingStage,
InterCoreMappingStage,
HintLoopsPartitionedWorkloadGenerationStage,
ZigZagCoreMappingEstimationStage,
GeneticAlgorithmAllocationStage,
],
accelerator=accelerator, # required by AcceleratorParserStage
workload_path=workload_path, # required by ModelParserStage
Expand Down
18 changes: 10 additions & 8 deletions main_testing_2_cores_shared.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@

from zigzag.stages.MainStage import MainStage

from stream.classes.stages.AcceleratorParserStage import AcceleratorParserStage as AcceleratorParserStage_
from stream.classes.stages.GenerateCNWorkloadHybridStage import GenerateCNWorkloadHybridStage
from stream.classes.stages.InterCoreMappingStage import InterCoreMappingStage
from stream.classes.stages.IntraCoreMappingStage import IntraCoreMappingStage
from stream.classes.stages.ModelParserStage import UserDefinedModelParserStage
from stream.stages.allocation.genetic_algorithm_allocation import GeneticAlgorithmAllocationStage
from stream.stages.estimation.zigzag_core_mapping_estimation import ZigZagCoreMappingEstimationStage
from stream.stages.generation.hint_loops_partitioned_workload_generation import (
HintLoopsPartitionedWorkloadGenerationStage,
)
from stream.stages.parsing.accelerator_parser import AcceleratorParserStage as AcceleratorParserStage_
from stream.stages.parsing.onnx_model_parser import UserDefinedModelParserStage
from stream.visualization.memory_usage import plot_memory_usage
from stream.visualization.schedule import visualize_timeline_plotly

Expand Down Expand Up @@ -48,9 +50,9 @@
AcceleratorParserStage_, # Parses the accelerator
# StreamONNXModelParserStage, # Parses the ONNX Model into the workload
UserDefinedModelParserStage, # Parses the user-defined Model into the workload
GenerateCNWorkloadHybridStage,
IntraCoreMappingStage,
InterCoreMappingStage,
HintLoopsPartitionedWorkloadGenerationStage,
ZigZagCoreMappingEstimationStage,
GeneticAlgorithmAllocationStage,
],
accelerator=accelerator, # required by AcceleratorParserStage
workload_path=workload_path, # required by ModelParserStage
Expand Down
20 changes: 11 additions & 9 deletions main_testing_2_cores_with_testing_workload.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@

from zigzag.stages.MainStage import MainStage

from stream.classes.cost_model.cost_model import StreamCostModelEvaluation
from stream.classes.stages.AcceleratorParserStage import AcceleratorParserStage as AcceleratorParserStage_
from stream.classes.stages.GenerateCNWorkloadHybridStage import GenerateCNWorkloadHybridStage
from stream.classes.stages.InterCoreMappingStage import InterCoreMappingStage
from stream.classes.stages.IntraCoreMappingStage import IntraCoreMappingStage
from stream.classes.stages.ModelParserStage import UserDefinedModelParserStage
from stream.cost_model.cost_model import StreamCostModelEvaluation
from stream.stages.allocation.genetic_algorithm_allocation import GeneticAlgorithmAllocationStage
from stream.stages.estimation.zigzag_core_mapping_estimation import ZigZagCoreMappingEstimationStage
from stream.stages.generation.hint_loops_partitioned_workload_generation import (
HintLoopsPartitionedWorkloadGenerationStage,
)
from stream.stages.parsing.accelerator_parser import AcceleratorParserStage as AcceleratorParserStage_
from stream.stages.parsing.onnx_model_parser import UserDefinedModelParserStage
from stream.visualization.memory_usage import plot_memory_usage
from stream.visualization.schedule import visualize_timeline_plotly

Expand Down Expand Up @@ -40,9 +42,9 @@
AcceleratorParserStage_, # Parses the accelerator
# StreamONNXModelParserStage, # Parses the ONNX Model into the workload
UserDefinedModelParserStage, # Parses the user-defined Model into the workload
GenerateCNWorkloadHybridStage,
IntraCoreMappingStage,
InterCoreMappingStage,
HintLoopsPartitionedWorkloadGenerationStage,
ZigZagCoreMappingEstimationStage,
GeneticAlgorithmAllocationStage,
],
accelerator=accelerator, # required by AcceleratorParserStage
workload_path=workload_path, # required by ModelParserStage
Expand Down
20 changes: 11 additions & 9 deletions main_testing_2_cores_with_testing_workload_3_layers.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@

from zigzag.stages.MainStage import MainStage

from stream.classes.cost_model.cost_model import StreamCostModelEvaluation
from stream.classes.stages.AcceleratorParserStage import AcceleratorParserStage as AcceleratorParserStage_
from stream.classes.stages.GenerateCNWorkloadHybridStage import GenerateCNWorkloadHybridStage
from stream.classes.stages.InterCoreMappingStage import InterCoreMappingStage
from stream.classes.stages.IntraCoreMappingStage import IntraCoreMappingStage
from stream.classes.stages.ModelParserStage import UserDefinedModelParserStage
from stream.cost_model.cost_model import StreamCostModelEvaluation
from stream.stages.allocation.genetic_algorithm_allocation import GeneticAlgorithmAllocationStage
from stream.stages.estimation.zigzag_core_mapping_estimation import ZigZagCoreMappingEstimationStage
from stream.stages.generation.hint_loops_partitioned_workload_generation import (
HintLoopsPartitionedWorkloadGenerationStage,
)
from stream.stages.parsing.accelerator_parser import AcceleratorParserStage as AcceleratorParserStage_
from stream.stages.parsing.onnx_model_parser import UserDefinedModelParserStage
from stream.visualization.memory_usage import plot_memory_usage
from stream.visualization.schedule import visualize_timeline_plotly

Expand Down Expand Up @@ -39,9 +41,9 @@
AcceleratorParserStage_, # Parses the accelerator
# StreamONNXModelParserStage, # Parses the ONNX Model into the workload
UserDefinedModelParserStage, # Parses the user-defined Model into the workload
GenerateCNWorkloadHybridStage,
IntraCoreMappingStage,
InterCoreMappingStage,
HintLoopsPartitionedWorkloadGenerationStage,
ZigZagCoreMappingEstimationStage,
GeneticAlgorithmAllocationStage,
],
accelerator=accelerator, # required by AcceleratorParserStage
workload_path=workload_path, # required by ModelParserStage
Expand Down
20 changes: 11 additions & 9 deletions main_testing_4_cores_with_testing_workload.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@

from zigzag.stages.MainStage import MainStage

from stream.classes.cost_model.cost_model import StreamCostModelEvaluation
from stream.classes.stages.AcceleratorParserStage import AcceleratorParserStage as AcceleratorParserStage_
from stream.classes.stages.GenerateCNWorkloadHybridStage import GenerateCNWorkloadHybridStage
from stream.classes.stages.InterCoreMappingStage import InterCoreMappingStage
from stream.classes.stages.IntraCoreMappingStage import IntraCoreMappingStage
from stream.classes.stages.ModelParserStage import UserDefinedModelParserStage
from stream.cost_model.cost_model import StreamCostModelEvaluation
from stream.stages.allocation.genetic_algorithm_allocation import GeneticAlgorithmAllocationStage
from stream.stages.estimation.zigzag_core_mapping_estimation import ZigZagCoreMappingEstimationStage
from stream.stages.generation.hint_loops_partitioned_workload_generation import (
HintLoopsPartitionedWorkloadGenerationStage,
)
from stream.stages.parsing.accelerator_parser import AcceleratorParserStage as AcceleratorParserStage_
from stream.stages.parsing.onnx_model_parser import UserDefinedModelParserStage
from stream.visualization.memory_usage import plot_memory_usage
from stream.visualization.schedule import visualize_timeline_plotly

Expand Down Expand Up @@ -39,9 +41,9 @@
AcceleratorParserStage_, # Parses the accelerator
# StreamONNXModelParserStage, # Parses the ONNX Model into the workload
UserDefinedModelParserStage, # Parses the user-defined Model into the workload
GenerateCNWorkloadHybridStage,
IntraCoreMappingStage,
InterCoreMappingStage,
HintLoopsPartitionedWorkloadGenerationStage,
ZigZagCoreMappingEstimationStage,
GeneticAlgorithmAllocationStage,
],
accelerator=accelerator, # required by AcceleratorParserStage
workload_path=workload_path, # required by ModelParserStage
Expand Down
18 changes: 10 additions & 8 deletions stream/api.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
from zigzag.stages.MainStage import MainStage

from stream.classes.stages.AcceleratorParserStage import AcceleratorParserStage
from stream.classes.stages.GenerateCNWorkloadHybridStage import GenerateCNWorkloadHybridStage
from stream.classes.stages.InterCoreMappingStage import InterCoreMappingStage
from stream.classes.stages.IntraCoreMappingStage import IntraCoreMappingStage
from stream.classes.stages.ModelParserStage import UserDefinedModelParserStage
from stream.stages.allocation.genetic_algorithm_allocation import GeneticAlgorithmAllocationStage
from stream.stages.estimation.zigzag_core_mapping_estimation import ZigZagCoreMappingEstimationStage
from stream.stages.generation.hint_loops_partitioned_workload_generation import (
HintLoopsPartitionedWorkloadGenerationStage,
)
from stream.stages.parsing.accelerator_parser import AcceleratorParserStage
from stream.stages.parsing.onnx_model_parser import UserDefinedModelParserStage


def get_hardware_performance_stream(hardware, workload, mapping, CN_define_mode, hint_loops, node_hw_cost_pkl_name):
Expand All @@ -20,9 +22,9 @@ def get_hardware_performance_stream(hardware, workload, mapping, CN_define_mode,
AcceleratorParserStage, # Parses the accelerator
# StreamONNXModelParserStage, # Parses the ONNX Model into the workload
UserDefinedModelParserStage, # Parses the user-defined Model into the workload
GenerateCNWorkloadHybridStage,
IntraCoreMappingStage,
InterCoreMappingStage,
HintLoopsPartitionedWorkloadGenerationStage,
ZigZagCoreMappingEstimationStage,
GeneticAlgorithmAllocationStage,
],
accelerator=hardware, # required by AcceleratorParserStage
workload_path=workload, # required by ModelParserStage
Expand Down
1 change: 0 additions & 1 deletion stream/classes/opt/allocation/README.md

This file was deleted.

Loading

0 comments on commit 169c362

Please sign in to comment.