[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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user