fix: adding teacache.params back to sampling params as intended (#20665)

This commit is contained in:
Douglas Yang
2026-03-16 11:27:06 -07:00
committed by GitHub
parent a4528a5737
commit 061ec582bf
3 changed files with 25 additions and 0 deletions

View File

@@ -156,6 +156,9 @@ class SamplingParams:
# TeaCache parameters
enable_teacache: bool = False
teacache_params: Any = (
None # TeaCacheParams or WanTeaCacheParams, set by model-specific subclass
)
# Profiling
profile: bool = False

View File

@@ -212,6 +212,11 @@ class Wan2_2_Base_SamplingParams(SamplingParams):
"色调艳丽过曝静态细节模糊不清字幕风格作品画作画面静止整体发灰最差质量低质量JPEG压缩残留丑陋的残缺的多余的手指画得不好的手部画得不好的脸部畸形的毁容的形态畸形的肢体手指融合静止不动的画面杂乱的背景三条腿背景人很多倒着走"
)
# TODO(Wan2.2): TeaCache coefficients need to be calibrated for Wan2.2 by
# profiling L1 distances across timesteps. Until then, teacache_params is None
# and enable_teacache will be accepted but silently no-op.
# Consider using Cache-DiT (SGLANG_CACHE_DIT_ENABLED=1) as an alternative.
@dataclass
class Wan2_2_TI2V_5B_SamplingParam(Wan2_2_Base_SamplingParams):

View File

@@ -768,6 +768,23 @@ TWO_GPU_CASES_A = [
prompt=T2V_PROMPT,
),
),
# TeaCache smoke test for Wan2.2 T2V A14B — verifies enable_teacache=True
# doesn't crash. Perf check disabled because Wan2.2-specific TeaCache
# coefficients are not yet calibrated (teacache_params=None, so no speedup).
DiffusionTestCase(
"wan2_2_t2v_a14b_teacache_2gpu",
DiffusionServerArgs(
model_path=DEFAULT_WAN_2_2_T2V_A14B_MODEL_NAME_FOR_TEST,
modality="video",
custom_validator="video",
num_gpus=2,
),
DiffusionSamplingParams(
prompt=T2V_PROMPT,
extras={"enable_teacache": True},
),
run_perf_check=False,
),
# LoRA test case for transformer_2 support
DiffusionTestCase(
"wan2_2_t2v_a14b_lora_2gpu",