[bugfix][CI] Fix qwen image performance degradation w/ vllm 0.20 & CUDA 13.0 (#3352)
Signed-off-by: Huang, Zeyu <11222265+fhfuih@users.noreply.github.com>
This commit is contained in:
1 parent
282e0b6642
commit
28558cc374
7 files changed
+209
-4
No files matched your search
@@ -3,6 +3,7 @@ from __future__ import annotations
|
||||
from contextlib import contextmanager
|
||||
from dataclasses import dataclass
|
||||
|
||||
import vllm.ir
|
||||
from vllm.config import VllmConfig
|
||||
|
||||
from vllm_omni.diffusion.attention.backends.abstract import (
|
||||
@@ -145,6 +146,7 @@ def set_forward_context(
|
||||
)
|
||||
# vLLM CustomOp dispatch (e.g. QKVParallelLinear) requires a global
|
||||
# vLLM config set via set_current_vllm_config().
|
||||
# Also set priority for vLLM IR ops (e.g. RMSNorm), copied from vllm/forward_context.py
|
||||
with override_forward_context(forward_context):
|
||||
if vllm_config is None:
|
||||
yield
|
||||
@@ -152,5 +154,9 @@ def set_forward_context(
|
||||
# Local import to avoid importing vllm.config.vllm at module import time.
|
||||
from vllm.config.vllm import set_current_vllm_config
|
||||
|
||||
with set_current_vllm_config(vllm_config):
|
||||
with (
|
||||
set_current_vllm_config(vllm_config),
|
||||
vllm_config.kernel_config.ir_op_priority.set_priority(),
|
||||
vllm.ir.enable_torch_wrap(vllm_config.compilation_config.ir_enable_torch_wrap),
|
||||
):
|
||||
yield
|
||||
@@ -136,6 +136,12 @@ class DiffusionWorker:
|
||||
enable_return_routed_experts=False,
|
||||
)
|
||||
vllm_config.quant_config = self.od_config.quantization_config
|
||||
# Since vLLM v0.20.0, IR wraps GPU ops. Set IR op priority preference to enforce GPU op fusion during wrapping.
|
||||
# Also need to log, because vLLM internally logs another line in VllmConfig.__post_init__. Avoid confusion.
|
||||
vllm_config.kernel_config.ir_op_priority = current_omni_platform.get_default_ir_op_priority(vllm_config)
|
||||
logger.info(
|
||||
"Final IR op priority after setting vLLM-Omni overrides: %s", vllm_config.kernel_config.ir_op_priority
|
||||
)
|
||||
self.vllm_config = vllm_config
|
||||
|
||||
# Initialize distributed environment
|
||||
|
||||
Reference in new issue
Block a user