test: keep Hunyuan LoRA CPU path on native linear (#8166)

Signed-off-by: andyluo7 <andy.luo@amd.com>
Co-authored-by: wangyu <53896905+yenuo26@users.noreply.github.com>
This commit is contained in:
andyluo7andwangyu authored and GitHub committed 2026-09-28 04:33:40 +00:00
1 parent c8a1419e02
commit 36b74f99f6
1 file changed
+12
+12
View File
@@ -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