[Diffusion] Make DLO host weight cache opt-in

Signed-off-by: Hongsheng Liu <liuhongsheng4@huawei.com>
This commit is contained in:
Hongsheng Liu committed 2026-08-19 11:23:36 +08:00
1 parent 75af33a76f
commit 16642dc2e8
12 files changed
+85 -20

No files matched your search

@@ -375,7 +375,7 @@ def test_dlo_plan_loads_component_sources_outside_planned_dit(monkeypatch):
assert loader.take_host_weight_plan() is plan
def test_dlo_plan_fallback_runs_ordinary_loader_then_cache(monkeypatch):
def test_dlo_plan_fallback_retains_ordinary_loader_weights_by_default(monkeypatch):
import vllm_omni.diffusion.model_loader.diffusers_loader as loader_mod
import vllm_omni.diffusion.model_loader.host_weight_cache as cache_mod
@@ -402,14 +402,13 @@ def test_dlo_plan_fallback_runs_ordinary_loader_then_cache(monkeypatch):
lambda *_args, **_kwargs: HostWeightPlanResult(None, "not direct-compatible"),
)
def build_cache(_pipeline, **_kwargs):
calls.append("cache")
return HostWeightPlanResult(None, "unsupported test layout", "unsupported_layout")
def build_cache(*_args, **_kwargs):
pytest.fail("host weight cache must require explicit selection")
monkeypatch.setattr(cache_mod, "build_host_weight_cache_plan", build_cache)
assert loader.load_model(load_device="cpu") is model
assert calls == ["load", "process", "cache"]
assert calls == ["load", "process"]
assert loader.take_host_weight_plan() is None
@@ -434,6 +433,7 @@ def test_dlo_host_weight_cache_is_built_after_final_post_load_mutation(monkeypat
quantization_config=None,
enable_distributed_layerwise_offload=True,
dlo_use_allgather=False,
dlo_use_host_weight_cache=True,
dlo_host_weight_cache_dir=str(tmp_path),
dlo_host_weight_cache_lock_timeout=1.0,
model="unused",
@@ -567,6 +567,7 @@ def test_dlo_host_weight_cache_failure_retains_ordinary_weights(monkeypatch, tmp
quantization_config=None,
enable_distributed_layerwise_offload=True,
dlo_use_allgather=False,
dlo_use_host_weight_cache=True,
dlo_host_weight_cache_dir=str(tmp_path),
model="unused",
)