Skip to content

Commit

Permalink
remove broken energy tracker reset method
Browse files Browse the repository at this point in the history
  • Loading branch information
baptistecolle committed Oct 14, 2024
1 parent 5efae05 commit 5d98048
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions optimum_benchmark/scenarios/energy_star/scenario.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ def run(self, backend: Backend[BackendConfigT]) -> BenchmarkReport:
preprocessor=backend.pretrained_processor,
)
self.preprocessing_energy = self.energy_tracker.get_energy()
self.energy_tracker.reset()

LOGGER.info("\t+ Initialising dataloader")
self.dataloader = DataLoader(self.dataset, batch_size=self.config.input_shapes["batch_size"])
Expand Down Expand Up @@ -197,7 +196,6 @@ def run_text_generation_energy_tracking(self, backend: Backend[BackendConfigT]):
self.report.prefill.efficiency = Efficiency.from_energy(
self.report.prefill.energy, self.text_generation_prefill_volume, unit=TEXT_GENERATION_EFFICIENCY_UNIT
)
self.energy_tracker.reset()

with self.energy_tracker.track():
for inputs in tqdm(self.dataloader):
Expand All @@ -207,7 +205,6 @@ def run_text_generation_energy_tracking(self, backend: Backend[BackendConfigT]):
self.report.decode.efficiency = Efficiency.from_energy(
self.report.decode.energy, self.text_generation_decode_volume, unit=TEXT_GENERATION_EFFICIENCY_UNIT
)
self.energy_tracker.reset()

def run_image_diffusion_energy_tracking(self, backend: Backend[BackendConfigT]):
LOGGER.info("\t+ Running energy tracking")
Expand All @@ -221,7 +218,6 @@ def run_image_diffusion_energy_tracking(self, backend: Backend[BackendConfigT]):
self.report.call.efficiency = Efficiency.from_energy(
self.report.call.energy, self.image_diffusion_volume, unit=IMAGE_DIFFUSION_EFFICIENCY_UNIT
)
self.energy_tracker.reset()

def run_inference_energy_tracking(self, backend: Backend[BackendConfigT]):
LOGGER.info("\t+ Running energy tracking")
Expand All @@ -235,7 +231,6 @@ def run_inference_energy_tracking(self, backend: Backend[BackendConfigT]):
self.report.forward.efficiency = Efficiency.from_energy(
self.report.forward.energy, self.inference_volume, unit=INFERENCE_EFFICIENCY_UNIT
)
self.energy_tracker.reset()

@property
def inference_volume(self) -> int: # in samples
Expand Down

0 comments on commit 5d98048

Please sign in to comment.