Skip to content

Commit

Permalink
Rename GPU_DEVICE_LABEL to NVIDIA_GPU_DEVICE_LABEL
Browse files Browse the repository at this point in the history
Signed-off-by: Andrey Velichkevich <[email protected]>
  • Loading branch information
andreyvelich committed Nov 29, 2024
1 parent 9bea4cf commit e9c22b2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions sdk_v2/kubeflow/training/constants/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@
# The default type for CPU.
CPU_DEVICE_TYPE = "cpu"

# The label for GPU device in the container resources.
GPU_DEVICE_LABEL = "nvidia.com/gpu"
# The label for NVIDIA GPU device in the container resources.
NVIDIA_GPU_DEVICE_LABEL = "nvidia.com/gpu"

# The default type for GPU
GPU_DEVICE_TYPE = "gpu"
Expand Down
4 changes: 2 additions & 2 deletions sdk_v2/kubeflow/training/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ def get_container_devices(
return device, device_count

# TODO (andreyvelich): Support other resource labels (e.g. NPUs).
if constants.GPU_DEVICE_LABEL in resources.limits:
if constants.NVIDIA_GPU_DEVICE_LABEL in resources.limits:
device = constants.GPU_DEVICE_TYPE
device_count = resources.limits[constants.GPU_DEVICE_LABEL]
device_count = resources.limits[constants.NVIDIA_GPU_DEVICE_LABEL]
elif constants.TPU_DEVICE_LABEL in resources.limits:
device = constants.TPU_DEVICE_TYPE
device_count = resources.limits[constants.TPU_DEVICE_LABEL]
Expand Down

0 comments on commit e9c22b2

Please sign in to comment.