Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[k8s] Fix GKELabelFormatter for H100s #3627

Merged
merged 2 commits into from
Jun 4, 2024
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
9 changes: 8 additions & 1 deletion sky/provision/kubernetes/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ def get_gke_accelerator_name(accelerator: str) -> str:
Uses the format - nvidia-tesla-<accelerator>.
A100-80GB, H100-80GB and L4 are an exception. They use nvidia-<accelerator>.
"""
if accelerator == 'H100':
# H100 is named as H100-80GB in GKE.
accelerator = 'H100-80GB'
if accelerator in ('A100-80GB', 'L4', 'H100-80GB'):
# A100-80GB, L4 and H100-80GB have a different name pattern.
return 'nvidia-{}'.format(accelerator.lower())
Expand Down Expand Up @@ -183,7 +186,11 @@ def get_accelerator_from_label_value(cls, value: str) -> str:
if value.startswith('nvidia-tesla-'):
return value.replace('nvidia-tesla-', '').upper()
elif value.startswith('nvidia-'):
return value.replace('nvidia-', '').upper()
acc = value.replace('nvidia-', '').upper()
if acc == 'H100-80GB':
# H100 is named as H100-80GB in GKE.
return 'H100'
return acc
else:
raise ValueError(
f'Invalid accelerator name in GKE cluster: {value}')
Expand Down
Loading