Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

[k8s] Fix GPU labelling nomenclature #3274

Merged
merged 1 commit into from
Mar 5, 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
12 changes: 8 additions & 4 deletions sky/utils/kubernetes/k8s_gpu_labeler_setup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ data:

canonical_gpu_names = [
'A100-80GB', 'A100', 'A10G', 'H100', 'K80', 'M60', 'T4g', 'T4', 'V100',
'A10', 'P100', 'P40', 'P4', 'L4', 'A6000'
'A10', 'P100', 'P40', 'P4', 'L4'
]


Expand Down Expand Up @@ -108,9 +108,13 @@ data:
labelled = True
break
if not labelled:
# If we didn't find a canonical name, just use the GPU name
# with spaces replaced by dashes
gpu_label = gpu_name.lower().replace(' ', '-')
# If we didn't find a canonical name:
# 1. remove 'NVIDIA ' if present (e.g., 'NVIDIA RTX A6000' -> 'RTX A6000')
# 2. remove 'GeForce ' if present (e.g., 'NVIDIA GeForce RTX 3070' -> 'RTX 3070')
# 3. replace 'RTX ' with 'RTX' (without spaces) (e.g., 'RTX 6000' -> 'RTX6000')
# 4. replace any other spaces with dashes (e.g. 'RTX 2080 Ti' -> 'RTX2080-Ti')
gpu_name = gpu_name.lower().replace('nvidia ', '').replace('geforce ', '').replace('rtx ', 'rtx').replace(' ', '-')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to make the gpu name in the label uppercase to keep it align with the other parts?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally kubernetes labels and values are lowercase, so keeping in line with convention. Also since label matching is case-sensitive, changing now would require deeper backward compatibility changes

gpu_label = gpu_name
label_node(gpu_label)
labelled = True
else:
Expand Down
Loading