[CI/Build] Reorganize models tests (#7820)

This commit is contained in:
Cyrus Leung
2024-09-13 10:20:06 -07:00
committed by GitHub
parent 0a4806f0a9
commit a84e598e21
55 changed files with 415 additions and 498 deletions
+3 -1
View File
@@ -10,7 +10,6 @@ import pytest
import torch
from vllm.attention import AttentionBackend, AttentionMetadata, AttentionType
from vllm.attention.backends.xformers import XFormersBackend
from vllm.utils import (STR_BACKEND_ENV_VAR, STR_XFORMERS_ATTN_VAL,
make_tensor_with_pad)
@@ -521,6 +520,9 @@ def make_backend(backend_name: str) -> AttentionBackend:
* Backend instance
'''
if backend_name == STR_XFORMERS_ATTN_VAL:
# NOTE: xFormers backend cannot be imported for CPU and AMD GPUs.
from vllm.attention.backends.xformers import XFormersBackend
return XFormersBackend()
raise AssertionError(
f"Unrecognized backend_name {backend_name} for unit test")