Skip to content

Commit

Permalink
failing test_power_limit_optimizer
Browse files Browse the repository at this point in the history
  • Loading branch information
parthraut committed Mar 19, 2024
1 parent d91a2c5 commit f357411
Show file tree
Hide file tree
Showing 4 changed files with 571 additions and 2 deletions.
3 changes: 2 additions & 1 deletion tests/optimizer/test_power_limit_optimizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,8 @@ def test_power_limit_optimizer(
tmp_path: Path,
):
# Mock PyNVML.
pynvml_mock = mocker.patch("zeus.optimizer.power_limit.pynvml", autospec=True)
# pynvml_mock = mocker.patch("zeus.optimizer.power_limit.pynvml", autospec=True)
pynvml_mock = mocker.patch("zeus.device.gpu.pynvml", autospec=True)
pynvml_mock.nvmlDeviceGetHandleByIndex.side_effect = lambda i: f"handle{i}"
pynvml_mock.nvmlDeviceGetPowerManagementLimitConstraints.side_effect = \
lambda _: (min(replay_log.power_limits) * 1000, max(replay_log.power_limits) * 1000)
Expand Down
4 changes: 3 additions & 1 deletion zeus/device/gpu.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,15 @@
"""

from __future__ import annotations
from typing import TYPE_CHECKING

import abc
import pynvml
import os

# from exception import ZeusBaseGPUError
import contextlib
if TYPE_CHECKING:
import pynvml


# import amdsmi
Expand Down
Loading

0 comments on commit f357411

Please sign in to comment.