From 36b74f99f6d6fd7aa42838f5e87c3ac1d54c4721 Mon Sep 17 00:00:00 2001 From: andyluo7 <43718156+andyluo7@users.noreply.github.com> Date: Mon, 28 Sep 2026 12:33:40 +0800 Subject: [PATCH] test: keep Hunyuan LoRA CPU path on native linear (#8166) Signed-off-by: andyluo7 Co-authored-by: wangyu <53896905+yenuo26@users.noreply.github.com> --- tests/diffusion/lora/test_lora_manager.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/diffusion/lora/test_lora_manager.py b/tests/diffusion/lora/test_lora_manager.py index 7b68b2558..3c91c40bf 100644 --- a/tests/diffusion/lora/test_lora_manager.py +++ b/tests/diffusion/lora/test_lora_manager.py @@ -1158,6 +1158,18 @@ def test_hunyuan_image3_peft_qkv_forward(tmp_path, monkeypatch, tp_size): from vllm.model_executor import parameter from vllm.model_executor.layers import linear + def cpu_unquantized_gemm(_layer, inputs, weight, bias=None): + return torch.nn.functional.linear(inputs, weight, bias) + + # This numerical contract intentionally runs on CPU. Accelerator builds + # select the unquantized GEMM from the process-wide platform, which would + # otherwise dispatch CPU tensors to the ROCm-only custom operator. + monkeypatch.setattr( + linear, + "dispatch_unquantized_gemm", + lambda *_args, **_kwargs: cpu_unquantized_gemm, + ) + adapter_dir = tmp_path / "adapter" adapter_dir.mkdir() rank = 2