[Perf][Cosmos3] Add SeaCache support for Cosmos3 (#6922)
Signed-off-by: Yuliya Zhautouskaya <yzhautouskay@nvidia.com>
This commit is contained in:
1 parent
c17126c219
commit
6040bb97e2
18 files changed
+1966
-160
No files matched your search
+9
-2
@@ -1,8 +1,12 @@
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-FileCopyrightText: Copyright contributors to the vLLM-Omni project
|
||||
|
||||
from typing import Any
|
||||
|
||||
from vllm_omni.diffusion.cache.base import CacheBackend
|
||||
from vllm_omni.diffusion.cache.cachedit import CacheDiTBackend
|
||||
from vllm_omni.diffusion.cache.magcache import MagCacheBackend
|
||||
from vllm_omni.diffusion.cache.seacache import SeaCacheBackend
|
||||
from vllm_omni.diffusion.cache.stepcache import StepCacheBackend
|
||||
from vllm_omni.diffusion.cache.teacache import TeaCacheBackend
|
||||
from vllm_omni.diffusion.data import DiffusionCacheConfig
|
||||
@@ -15,11 +19,12 @@ def get_cache_backend(cache_backend: str | None, cache_config: Any) -> CacheBack
|
||||
- cache_dit: Uses CacheDiTBackend with enable()/refresh() interface
|
||||
- tea_cache: Uses TeaCacheBackend with enable()/refresh() interface
|
||||
- mag_cache: Uses MagCacheBackend with enable()/refresh() interface
|
||||
- sea_cache: Uses SeaCacheBackend for spectral residual caching
|
||||
- step_cache: Uses StepCacheBackend for DreamZero velocity step skip
|
||||
|
||||
Args:
|
||||
cache_backend: Cache backend name ("cache_dit", "tea_cache",
|
||||
"mag_cache", "step_cache", or None).
|
||||
"mag_cache", "sea_cache", "step_cache", or None).
|
||||
cache_config: Cache configuration (dict or DiffusionCacheConfig instance).
|
||||
|
||||
Returns:
|
||||
@@ -40,10 +45,12 @@ def get_cache_backend(cache_backend: str | None, cache_config: Any) -> CacheBack
|
||||
return TeaCacheBackend(cache_config)
|
||||
elif cache_backend == "mag_cache":
|
||||
return MagCacheBackend(cache_config)
|
||||
elif cache_backend == "sea_cache":
|
||||
return SeaCacheBackend(cache_config)
|
||||
elif cache_backend in ("step_cache", "stepcache", "step_cache_dit"):
|
||||
return StepCacheBackend(cache_config)
|
||||
else:
|
||||
raise ValueError(
|
||||
f"Unsupported cache backend: {cache_backend}. "
|
||||
"Supported: 'cache_dit', 'tea_cache', 'mag_cache', 'step_cache'"
|
||||
"Supported: 'cache_dit', 'tea_cache', 'mag_cache', 'sea_cache', 'step_cache'"
|
||||
)
|
||||
Reference in new issue
Block a user