[Rebase] Rebase to vllm 0.27.0 (#5976)
Signed-off-by: tzhouam <tzhouam@connect.ust.hk> Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
584d78c673
commit
2ce15ab7a0
55 files changed
+1335
-93
No files matched your search
@@ -42,10 +42,31 @@ from tests.e2e.accuracy.helpers import (
|
||||
from tests.helpers.env import run_post_test_cleanup, run_pre_test_cleanup
|
||||
from tests.helpers.mark import hardware_test
|
||||
from tests.helpers.runtime import OmniServer, OpenAIClientHandler
|
||||
from vllm_omni.diffusion.models.diffusers_adapter.pipeline_diffusers_adapter import (
|
||||
CUDA_FLASH_ATTENTION_BACKEND_ATTEMPTS,
|
||||
)
|
||||
|
||||
pytestmark = [pytest.mark.full_model, pytest.mark.diffusion]
|
||||
|
||||
|
||||
def _set_matched_attention_backend(pipe: DiffusionPipeline) -> None:
|
||||
"""Walk the same backend chain the omni server's diffusers adapter walks.
|
||||
|
||||
The server side (--diffusion-load-format diffusers) resolves its attention
|
||||
backend through the adapter's preference chain, skipping backends that are
|
||||
unavailable on the image (e.g. the FA3 hub kernel has no build variant for
|
||||
the image's torch — build 2953). The reference run must resolve to the
|
||||
same backend or the similarity comparison measures kernel differences.
|
||||
"""
|
||||
for backend in CUDA_FLASH_ATTENTION_BACKEND_ATTEMPTS:
|
||||
try:
|
||||
pipe.transformer.set_attention_backend(backend)
|
||||
return
|
||||
except Exception:
|
||||
continue
|
||||
pipe.transformer.set_attention_backend("native")
|
||||
|
||||
|
||||
PROMPT = "A photo of a cat sitting on a laptop keyboard, digital art style."
|
||||
NEGATIVE_PROMPT = "blurry, low quality"
|
||||
WIDTH = 512
|
||||
@@ -235,7 +256,7 @@ def _run_diffusers_qwen_image(*, model: str, output_path: Path) -> tuple[Image.I
|
||||
torch_dtype=torch.bfloat16,
|
||||
trust_remote_code=True,
|
||||
).to("cuda")
|
||||
pipe.transformer.set_attention_backend("_flash_3_hub")
|
||||
_set_matched_attention_backend(pipe)
|
||||
_diffusers_dummy_run(pipe)
|
||||
|
||||
latencies: list[float] = []
|
||||
|
||||
Reference in new issue
Block a user