Skip to content
Draft
Show file tree
Hide file tree
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
3 changes: 2 additions & 1 deletion src/dstack/_internal/core/backends/kubernetes/resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,8 @@ def get_nvidia_gpu_from_node_labels(
gpu_product, _, mig_profile = gpu_product.partition(NVIDIA_MIG_PRODUCT_SEPARATOR)
if mig_resource is not None:
mig_profile = mig_resource.removeprefix(NVIDIA_MIG_RESOURCE_PREFIX)
gpu_product = gpu_product.replace("RTX-", "RTX")
# Join "RTX" with the model, e.g. "RTX-4090" -> "RTX4090", "RTX-PRO-6000" -> "RTXPRO6000"
gpu_product = gpu_product.replace("RTX-PRO-", "RTXPRO").replace("RTX-", "RTX")
for gpu_name in NVIDIA_GPU_NAMES:
if gpu_name.lower() in gpu_product.lower().split("-"):
break
Expand Down
27 changes: 27 additions & 0 deletions src/tests/_internal/core/backends/kubernetes/test_resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,33 @@ def test_returns_correct_memory_for_different_A100(self):
{"nvidia.com/gpu.product": "A100-SXM4-80GB"}
) == Gpu(vendor=AcceleratorVendor.NVIDIA, name="A100", memory_mib=80 * 1024)

@pytest.mark.parametrize(
["product", "expected_name", "expected_memory_gb"],
[
# The label set by GPU Feature Discovery v0.20.1
pytest.param(
"NVIDIA-RTX-PRO-6000-Blackwell-Max-Q-Workstation-Edition",
"RTXPRO6000",
96,
id="rtx-pro-6000-max-q",
),
pytest.param(
"NVIDIA-RTX-PRO-6000-Blackwell-Server-Edition",
"RTXPRO6000",
96,
id="rtx-pro-6000-server",
),
pytest.param("NVIDIA-RTX-PRO-4500-Blackwell", "RTXPRO4500", 32, id="rtx-pro-4500"),
pytest.param("NVIDIA-GeForce-RTX-4090", "RTX4090", 24, id="rtx-4090"),
],
)
def test_returns_rtx_gpu(self, product: str, expected_name: str, expected_memory_gb: int):
assert get_nvidia_gpu_from_node_labels({"nvidia.com/gpu.product": product}) == Gpu(
vendor=AcceleratorVendor.NVIDIA,
name=expected_name,
memory_mib=expected_memory_gb * 1024,
)

@pytest.mark.parametrize(
["product", "expected_name", "expected_memory_gb"],
[
Expand Down