Skip to content

Commit

Permalink
remove dead code
Browse files Browse the repository at this point in the history
  • Loading branch information
RobinGeens committed May 15, 2024
1 parent 52906d5 commit 8dc1011
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 223 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import matplotlib.pyplot as plt
from matplotlib.offsetbox import AnchoredText
import numpy


Expand Down Expand Up @@ -29,13 +28,9 @@ def plot_evolution(self):

for individual in pop:
if len(self.fitness_evaluator.metrics) == 1:
first_metric = second_metric = self.fitness_evaluator.get_fitness(
individual
)
first_metric = second_metric = self.fitness_evaluator.get_fitness(individual)
elif len(self.fitness_evaluator.metrics) == 2:
first_metric, second_metric = self.fitness_evaluator.get_fitness(
individual
)
first_metric, second_metric = self.fitness_evaluator.get_fitness(individual)
elif len(self.fitness_evaluator.metrics) == 3:
(
first_metric,
Expand Down Expand Up @@ -109,9 +104,7 @@ def plot_population(self, pop):

for individual in pop:
if len(self.fitness_evaluator.metrics) == 2:
first_metric, second_metric = self.fitness_evaluator.get_fitness(
individual
)
first_metric, second_metric = self.fitness_evaluator.get_fitness(individual)
third_metirc = first_metric # unrelevant assignment
elif len(self.fitness_evaluator.metrics) == 3:
(
Expand Down Expand Up @@ -166,10 +159,6 @@ def plot_population(self, pop):
plt.show()

else:
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
import numpy as np

plt.clf()
fig = plt.figure()
ax = fig.add_subplot(111, projection="3d")
Expand All @@ -196,9 +185,7 @@ def get_avg(self, x):
means = numpy.mean(x, axis=0).tolist()

for i in range(len(means)):
means[i] = numpy.format_float_scientific(
means[i], precision=2, min_digits=2
)
means[i] = numpy.format_float_scientific(means[i], precision=2, min_digits=2)

return means

Expand Down
6 changes: 2 additions & 4 deletions stream/classes/opt/splitting/splitting.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
from typing import List, Dict

from stream.classes.opt.splitting.TemporalLoop import TemporalLoop
from stream.classes.workload.computation_node import ComputationNode
from zigzag.datatypes import LayerDim

import logging

from zigzag.datatypes import LayerDim

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -63,7 +61,7 @@ def convert_inner_cn_loops(inner_cn_loops: list, layer: ComputationNode):
new_loop_size = find_the_closest_divisible_factor_within_a_range(
layer.layer_dim_sizes[loop_name], loop_size, 50
)
outer_loops.append(TemporalLoop(loop_name, new_loop_size))
inner_loops.append(TemporalLoop(loop_name, new_loop_size))
logger.info(
f"For layer {int(layer.id)}, the inner CN dimension {loop_name} size is adjusted from {loop_size} to {new_loop_size}."
)
Expand Down
200 changes: 0 additions & 200 deletions stream/classes/stages/CustomSpatialMappingGeneratorStage.py

This file was deleted.

3 changes: 1 addition & 2 deletions stream/classes/stages/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
from .IntraCoreMappingStage import IntraCoreMappingStage
from .ModelParserStage import ONNXModelParserStage as StreamONNXModelParserStage
from .ModelParserStage import UserDefinedModelParserStage
from .CustomSpatialMappingGeneratorStage import CustomSpatialMappingGeneratorStage
from .LayerSplittingStage import LayerSplittingStage
from .DetermineLayerStacksStage import DetermineLayerStacksStage
from .DetermineHintLoopsStage import DetermineHintLoopsStage
from .DetermineSchedulingOrderStage import DetermineSchedulingOrderStage
from .DetermineSchedulingOrderStage import DetermineSchedulingOrderStage

0 comments on commit 8dc1011

Please sign in to comment.