[Diffusion] Add native paged KV backend for diffusion workers (#6102)
Signed-off-by: Acerak01-fy <wfy2003324@163.com> Co-authored-by: Hongsheng Liu <liuhongsheng4@huawei.com>
This commit is contained in:
1 parent
c2daa471c3
commit
72ee535fcd
34 files changed
+4595
-71
No files matched your search
@@ -184,6 +184,28 @@ class OmniPlatform(Platform):
|
||||
"""
|
||||
return "vllm_omni.diffusion.worker.diffusion_model_runner.DiffusionModelRunner"
|
||||
|
||||
@classmethod
|
||||
def get_diffusion_kv_block_tables_cls(cls) -> type:
|
||||
"""Return the platform's native paged-KV BlockTables implementation."""
|
||||
from vllm.v1.worker.gpu.block_table import BlockTables
|
||||
|
||||
return BlockTables
|
||||
|
||||
@classmethod
|
||||
def build_diffusion_kv_attn_metadata(cls, **kwargs: Any) -> dict[str, Any]:
|
||||
"""Build native attention metadata for the diffusion paged path.
|
||||
|
||||
The common CUDA/ROCm/XPU path uses vLLM's builder. Platforms with a
|
||||
backend-specific metadata contract can override this hook without
|
||||
making the diffusion adapter import their optional runtime package.
|
||||
``seq_lens_cpu`` is an adapter-only convenience value and is removed
|
||||
before calling the upstream builder.
|
||||
"""
|
||||
from vllm.v1.worker.gpu.attn_utils import build_attn_metadata
|
||||
|
||||
kwargs.pop("seq_lens_cpu", None)
|
||||
return build_attn_metadata(**kwargs)
|
||||
|
||||
@classmethod
|
||||
def init_diffusion_worker_vllm_config(
|
||||
cls,
|
||||
|
||||
Reference in new issue
Block a user