[Model][Feat] Support Minimax-H3 quality grading requests through dynamic loading/unloading with Cache-DiT (#5853)
Signed-off-by: mglyn <1203789601@qq.com>
This commit is contained in:
1 parent
e906f41dc8
commit
d8c35663b4
28 files changed
+1183
-18
No files matched your search
@@ -17,6 +17,7 @@ if TYPE_CHECKING:
|
||||
|
||||
import torch
|
||||
|
||||
from vllm_omni.diffusion.cache.cachedit import CacheDiTBackend
|
||||
from vllm_omni.diffusion.data import DiffusionOutput
|
||||
from vllm_omni.diffusion.worker.input_batch import InputBatch
|
||||
from vllm_omni.diffusion.worker.utils import StepRequestState
|
||||
@@ -131,3 +132,31 @@ def supports_prompt_update(pipeline: object) -> bool:
|
||||
"""Return whether ``pipeline`` implements :class:`SupportsPromptUpdate`."""
|
||||
|
||||
return isinstance(pipeline, SupportsPromptUpdate)
|
||||
|
||||
|
||||
@runtime_checkable
|
||||
class SupportsRequestScopedCacheDiT(Protocol):
|
||||
"""Optional protocol for pipelines that own Cache-DiT hook transitions."""
|
||||
|
||||
def adopt_cache_dit_backend(self, backend: CacheDiTBackend) -> None:
|
||||
"""Assume ownership of an enabled Cache-DiT backend."""
|
||||
...
|
||||
|
||||
def is_cache_dit_enabled(self) -> bool:
|
||||
"""Return whether this pipeline currently has Cache-DiT installed."""
|
||||
...
|
||||
|
||||
|
||||
def adopt_request_scoped_cache_dit(pipeline: object, backend: CacheDiTBackend) -> bool:
|
||||
"""Transfer an enabled Cache-DiT backend to an opted-in pipeline."""
|
||||
|
||||
if not isinstance(pipeline, SupportsRequestScopedCacheDiT):
|
||||
return False
|
||||
pipeline.adopt_cache_dit_backend(backend)
|
||||
return True
|
||||
|
||||
|
||||
def is_request_scoped_cache_dit_enabled(pipeline: object) -> bool:
|
||||
"""Read Cache-DiT state from a pipeline that owns its lifecycle."""
|
||||
|
||||
return isinstance(pipeline, SupportsRequestScopedCacheDiT) and pipeline.is_cache_dit_enabled()
|
||||
Reference in new issue
Block a user