From e06a83445c0be30b0dc874dccb059c3e0d8dea5e Mon Sep 17 00:00:00 2001 From: cyq <61975706+cyq1017@users.noreply.github.com> Date: Thu, 25 Jun 2026 07:22:49 +0800 Subject: [PATCH] [Bugfix] Normalize slashes in Helion GPU names (#46101) Signed-off-by: cyq <15000851237@163.com> --- tests/kernels/helion/test_utils.py | 1 + vllm/kernels/helion/utils.py | 7 +++---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/kernels/helion/test_utils.py b/tests/kernels/helion/test_utils.py index 540cc4f8bc..f357fbf647 100644 --- a/tests/kernels/helion/test_utils.py +++ b/tests/kernels/helion/test_utils.py @@ -17,6 +17,7 @@ from vllm.kernels.helion.utils import canonicalize_gpu_name ("NVIDIA H100 SXM5", "nvidia_h100"), ("NVIDIA GeForce RTX 4090", "nvidia_geforce_rtx_4090"), ("AMD Instinct MI300X", "amd_instinct_mi300x"), + ("AMD Instinct MI250X / MI250", "amd_instinct_mi250x_mi250"), ("Tesla V100-SXM2-32GB", "tesla_v100"), ], ) diff --git a/vllm/kernels/helion/utils.py b/vllm/kernels/helion/utils.py index 460fcc8506..f4ace6cff3 100644 --- a/vllm/kernels/helion/utils.py +++ b/vllm/kernels/helion/utils.py @@ -2,6 +2,7 @@ # SPDX-FileCopyrightText: Copyright contributors to the vLLM project """Utility functions for Helion kernel management.""" +import regex as re import torch from vllm.logger import init_logger @@ -62,7 +63,7 @@ def canonicalize_gpu_name(name: str) -> str: """ Canonicalize GPU name for use as a platform identifier. - Converts to lowercase, replaces spaces and hyphens with underscores, + Converts to lowercase, replaces separators with underscores, and maps known variant names to their canonical form via _GPU_NAME_ALIASES. e.g., "NVIDIA H100 80GB HBM3" -> "nvidia_h100" "NVIDIA A100-SXM4-80GB" -> "nvidia_a100" @@ -70,9 +71,7 @@ def canonicalize_gpu_name(name: str) -> str: """ if not name or not name.strip(): raise ValueError("GPU name cannot be empty") - name = name.lower() - name = name.replace(" ", "_") - name = name.replace("-", "_") + name = re.sub(r"[\s/-]+", "_", name.lower()) if name in _GPU_NAME_ALIASES: return _GPU_NAME_ALIASES[name] return name