[diffusion] fix: optimize text encoder CPU offload initialization to address OOM (#17064)

Signed-off-by: Lancer <maruxiang6688@gmail.com>
Co-authored-by: Lancer <maruxiang6688@gmail.com>
This commit is contained in:
Lancer
2026-01-15 21:28:57 +08:00
committed by GitHub
co-authored by Lancer
parent 6586f44ad4
commit e997995037
4 changed files with 94 additions and 4 deletions
@@ -165,6 +165,7 @@ class DiffusionServerArgs:
dit_layerwise_offload: bool = False
enable_cache_dit: bool = False
text_encoder_cpu_offload: bool = False
@dataclass(frozen=True)
@@ -435,6 +436,19 @@ ONE_GPU_CASES_B: list[DiffusionTestCase] = [
prompt=T2V_PROMPT,
),
),
DiffusionTestCase(
"wan2_1_t2v_1.3b_text_encoder_cpu_offload",
DiffusionServerArgs(
model_path="Wan-AI/Wan2.1-T2V-1.3B-Diffusers",
modality="video",
warmup=0,
custom_validator="video",
text_encoder_cpu_offload=True,
),
DiffusionSamplingParams(
prompt=T2V_PROMPT,
),
),
# LoRA test case for single transformer + merge/unmerge API test
# Note: Uses dynamic_lora_path instead of lora_path to test LayerwiseOffload + set_lora interaction
# Server starts WITHOUT LoRA, then set_lora is called after startup (Wan models auto-enable layerwise offload)