Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions tests/evaluation/test_memory_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ def test_disk_memory_metric(model_fixture: tuple[Any, SmashConfig], device: str)
model, smash_config = model_fixture
disk_memory_metric = DiskMemoryMetric()
pruna_model = PrunaModel(model, smash_config=smash_config)
pruna_model.move_to_device("cuda")
disk_memory_results = disk_memory_metric.compute(pruna_model, smash_config.test_dataloader())
assert disk_memory_results.result > 0

Expand All @@ -34,6 +35,7 @@ def test_inference_memory_metric(model_fixture: tuple[Any, SmashConfig], device:
model, smash_config = model_fixture
inference_memory_metric = InferenceMemoryMetric()
pruna_model = PrunaModel(model, smash_config=smash_config)
pruna_model.move_to_device("cuda")
inference_memory_results = inference_memory_metric.compute(pruna_model, smash_config.test_dataloader())
assert inference_memory_results.result > 0

Expand All @@ -50,5 +52,6 @@ def test_training_memory_metric(model_fixture: tuple[Any, SmashConfig], device:
model, smash_config = model_fixture
training_memory_metric = TrainingMemoryMetric()
pruna_model = PrunaModel(model, smash_config=smash_config)
pruna_model.move_to_device("cuda")
training_memory_results = training_memory_metric.compute(pruna_model, smash_config.test_dataloader())
assert training_memory_results.result > 0