[Bugfix] Normalize slashes in Helion GPU names (#46101)

Signed-off-by: cyq <15000851237@163.com>
This commit is contained in:
cyq
2026-06-24 18:22:49 -05:00
committed by GitHub
parent d7ab9be775
commit e06a83445c
2 changed files with 4 additions and 4 deletions
+3 -4
View File
@@ -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