Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
IlyasMoutawwakil committed Dec 9, 2024
1 parent 026ddcd commit 501c42d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
1 change: 0 additions & 1 deletion optimum_benchmark/backends/ipex/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ def _load_ipexmodel_from_pretrained(self) -> None:
self.pretrained_model = self.ipexmodel_class.from_pretrained(
self.config.model,
export=self.config.export,
device=self.config.device,
**self.config.model_kwargs,
**self.automodel_kwargs,
)
Expand Down
18 changes: 8 additions & 10 deletions tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,10 +229,10 @@ def test_api_dataset_generator(library, task, model):
def test_api_latency_tracker(device, backend):
tracker = LatencyTracker(device=device, backend=backend)

tracker.reset()
while tracker.elapsed() < 2:
with tracker.track():
time.sleep(1)
with tracker.session():
while tracker.elapsed() < 2:
with tracker.track():
time.sleep(1)

latency = tracker.get_latency()
latency.log()
Expand All @@ -241,10 +241,10 @@ def test_api_latency_tracker(device, backend):
assert latency.mean > 0.9
assert len(latency.values) == 2

tracker.reset()
while tracker.count() < 2:
with tracker.track():
time.sleep(1)
with tracker.session():
while tracker.count() < 2:
with tracker.track():
time.sleep(1)

latency = tracker.get_latency()
latency.log()
Expand Down Expand Up @@ -273,15 +273,13 @@ def test_api_memory_tracker(device, backend):

tracker = MemoryTracker(device=device, backend=backend, device_ids=device_ids)

tracker.reset()
with tracker.track():
time.sleep(1)
pass

initial_memory = tracker.get_max_memory()
initial_memory.log()

tracker.reset()
with tracker.track():
array = torch.randn((10000, 10000), dtype=torch.float64, device=device)
expected_memory = array.nbytes / 1e6
Expand Down

0 comments on commit 501c42d

Please sign in to comment.