Skip to content

Commit

Permalink
fixing merge conflicts involving setGpuLockedClocks method
Browse files Browse the repository at this point in the history
  • Loading branch information
parthraut committed Apr 30, 2024
1 parent 5767ae9 commit c91b02f
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions zeus/device/gpu.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ def getName(self) -> str:

@abc.abstractmethod
def setGpuLockedClocks(
self, index: int, minMemClockMHz: int, maxMemClockMHz: int
self, index: int, minGpuClockMHz: int, maxGpuClockMHz: int
) -> None:
"""Lock the GPU clock to a specified range. Units: MHz."""
pass
Expand Down Expand Up @@ -273,7 +273,6 @@ def getTotalEnergyConsumption(self) -> int:


def _handle_nvml_errors(func):

@functools.wraps(func)
def wrapper(*args, **kwargs):
try:
Expand All @@ -298,7 +297,7 @@ def __init__(self, gpu_index: int) -> None:
super().__init__(gpu_index)
self._get_handle()
self._supportsGetTotalEnergyConsumption = None

_exception_map = {
pynvml.NVML_ERROR_UNINITIALIZED: ZeusGPUInitError,
pynvml.NVML_ERROR_INVALID_ARGUMENT: ZeusGPUInvalidArgError,
Expand Down Expand Up @@ -379,9 +378,9 @@ def getName(self) -> str:
return pynvml.nvmlDeviceGetName(self.handle)

@_handle_nvml_errors
def setGpuLockedClocks(self, minMemClockMHz: int, maxMemClockMHz: int) -> None:
def setGpuLockedClocks(self, minGpuClockMHz: int, maxGpuClockMHz: int) -> None:
"""Locks the GPU clock of the specified GPU to a range defined by the minimum and maximum GPU clock frequencies. Units: MHz."""
pynvml.nvmlDeviceSetGpuLockedClocks(self.handle, minMemClockMHz, maxMemClockMHz)
pynvml.nvmlDeviceSetGpuLockedClocks(self.handle, minGpuClockMHz, maxGpuClockMHz)

@_handle_nvml_errors
def resetMemoryLockedClocks(self) -> None:
Expand Down Expand Up @@ -428,7 +427,6 @@ class UnprivilegedNVIDIAGPU(NVIDIAGPU):


def _handle_amdsmi_errors(func):

@functools.wraps(func)
def wrapper(*args, **kwargs):
try:
Expand Down Expand Up @@ -456,7 +454,7 @@ def __init__(self, gpu_index: int) -> None:
super().__init__(gpu_index)
self._get_handle()
self._supportsGetTotalEnergyConsumption = None

_exception_map = {
amdsmi.amdsmi_wrapper.AMDSMI_STATUS_INVAL: ZeusGPUInvalidArgError,
amdsmi.amdsmi_wrapper.AMDSMI_STATUS_NOT_SUPPORTED: ZeusGPUNotSupportedError,
Expand Down

0 comments on commit c91b02f

Please sign in to comment.