[Bugfix] Normalize slashes in Helion GPU names (#46101)
Signed-off-by: cyq <15000851237@163.com>
cyq committed
Jun 25, 2026 at 07:22 UTC
e06a83445c0be30b0dc874dccb059c3e0d8dea5e
2 files changed
+4
-4
tests/kernels/helion/test_utils.py
+1
@@ -17,6 +17,7 @@ from vllm.kernels.helion.utils import canonicalize_gpu_name
17
("NVIDIA H100 SXM5", "nvidia_h100"),
18
("NVIDIA GeForce RTX 4090", "nvidia_geforce_rtx_4090"),
19
("AMD Instinct MI300X", "amd_instinct_mi300x"),
20
+ ("AMD Instinct MI250X / MI250", "amd_instinct_mi250x_mi250"),
21
("Tesla V100-SXM2-32GB", "tesla_v100"),
22
],
23
)
vllm/kernels/helion/utils.py
+3
-4
@@ -2,6 +2,7 @@
2
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3
"""Utility functions for Helion kernel management."""
4
5
+import regex as re
6
import torch
7
8
from vllm.logger import init_logger
@@ -62,7 +63,7 @@ def canonicalize_gpu_name(name: str) -> str:
63
"""
64
Canonicalize GPU name for use as a platform identifier.
65
65
- Converts to lowercase, replaces spaces and hyphens with underscores,
66
+ Converts to lowercase, replaces separators with underscores,
67
and maps known variant names to their canonical form via _GPU_NAME_ALIASES.
68
e.g., "NVIDIA H100 80GB HBM3" -> "nvidia_h100"
69
"NVIDIA A100-SXM4-80GB" -> "nvidia_a100"
@@ -70,9 +71,7 @@ def canonicalize_gpu_name(name: str) -> str:
71
"""
72
if not name or not name.strip():
73
raise ValueError("GPU name cannot be empty")
73
- name = name.lower()
74
- name = name.replace(" ", "_")
75
- name = name.replace("-", "_")
74
+ name = re.sub(r"[\s/-]+", "_", name.lower())
75
if name in _GPU_NAME_ALIASES:
76
return _GPU_NAME_ALIASES[name]
77
return name