From 6b5a12c0f843f10aec5fd5e439a1b8091dd66b8c Mon Sep 17 00:00:00 2001 From: Andreas Karatzas Date: Mon, 7 Sep 2026 20:55:44 -0500 Subject: [PATCH] [ROCm][CI] Enable HY-V4 model initialization on ROCm (#54405) Signed-off-by: Andreas Karatzas --- tests/models/test_registry.py | 4 ++-- vllm/models/hy_v4/__init__.py | 9 ++++----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/tests/models/test_registry.py b/tests/models/test_registry.py index d271cb677c..3bcb0dc433 100644 --- a/tests/models/test_registry.py +++ b/tests/models/test_registry.py @@ -60,9 +60,9 @@ def test_registry_imports(model_arch): pytest.skip("Dots3 NOTE is only supported on CUDA") if model_arch in ("HYV4ForCausalLM", "HYV4MTPModel") and not ( - current_platform.is_cuda() + current_platform.is_cuda() or current_platform.is_rocm() ): - pytest.skip("HY V4 is only supported on CUDA") + pytest.skip("HY V4 is only supported on CUDA and ROCm") if model_arch == "DeepseekV4ForConditionalGeneration" and not ( current_platform.is_cuda() diff --git a/vllm/models/hy_v4/__init__.py b/vllm/models/hy_v4/__init__.py index 9fe80d568c..f09f25bfb2 100644 --- a/vllm/models/hy_v4/__init__.py +++ b/vllm/models/hy_v4/__init__.py @@ -14,19 +14,18 @@ The package is organized like `vllm.models.deepseek_v32`: this module is the only public entry point and dispatches on the current platform, so registry entries never reach into a platform subpackage. -Only NVIDIA is supported for now. The port also drops the reference +NVIDIA and ROCm are supported. The port also drops the reference implementation's HPC/TPCP fusion paths, which depend on infrastructure that does not exist in this tree. """ from vllm.platforms import current_platform -if current_platform.is_rocm(): - raise NotImplementedError("hy_v4 does not yet support ROCm.") -elif current_platform.is_xpu(): +if current_platform.is_xpu(): raise NotImplementedError("hy_v4 does not yet support XPU.") else: - # Covers Blackwell (sm100) and all other CUDA devices. + # The implementation is shared by CUDA and ROCm; platform-specific + # attention behavior is selected by the normal attention backend router. from .nvidia.model import HYV4ForCausalLM from .nvidia.mtp import HYV4MTP