Skip to content

Commit

Permalink
Restructure Codebase (#40)
Browse files Browse the repository at this point in the history
* move all classes subfolders out and remove unused code

* update sphinx build and deploy workflows triggers

* fix name of sphinx-build workflow

* fix workflow job name

* fix formatting
  • Loading branch information
asyms authored Sep 4, 2024
1 parent 5055d7e commit c5e6bd9
Show file tree
Hide file tree
Showing 82 changed files with 289 additions and 580 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/sphinx-build-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@ name: Sphinx CD

# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the "master" branch
# Triggers the workflow on push events but only for the "master" branch
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
branches:
- master

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
Expand Down
37 changes: 37 additions & 0 deletions .github/workflows/sphinx-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# This is a basic workflow to help you get started with Actions

name: Sphinx Build

# Controls when the workflow will run
on:
# Triggers the workflow on pull request events but only for the "master" branch
pull_request:
branches:
- master

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

permissions:
contents: write

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3

# Runs a set of commands using the runners shell
- name: directly build sphinx
run: |
cd docs
pip install -r requirements.txt
sphinx-build --version
sphinx-build -b html source build
cp source/images/interactive-plotly-visualization.html build/
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
Loading

0 comments on commit c5e6bd9

Please sign in to comment.