[Bugfix][CI]Fix HSDP regional compile boundary (#4668)
Signed-off-by: bjf-frz <frz123db@gmail.com>
This commit is contained in:
1 parent
f6e8b77642
commit
d612233bef
6 files changed
+176
-6
No files matched your search
@@ -109,6 +109,37 @@ def _make_runner(cache_backend, cache_backend_name: str, enable_cache_dit_summar
|
||||
return runner
|
||||
|
||||
|
||||
def _make_compile_runner(*, use_hsdp: bool):
|
||||
runner = object.__new__(DiffusionModelRunner)
|
||||
runner.pipeline = SimpleNamespace(transformer=SimpleNamespace())
|
||||
runner.od_config = SimpleNamespace(parallel_config=SimpleNamespace(use_hsdp=use_hsdp))
|
||||
return runner
|
||||
|
||||
|
||||
@pytest.mark.core_model
|
||||
@pytest.mark.cpu
|
||||
@pytest.mark.parametrize("use_hsdp", [False, True])
|
||||
def test_compile_transformer_regionally_compiles_blocks(monkeypatch, use_hsdp):
|
||||
runner = _make_compile_runner(use_hsdp=use_hsdp)
|
||||
compile_calls = []
|
||||
|
||||
def _regionally_compile(model, *args, **kwargs):
|
||||
compile_calls.append((model, args, kwargs))
|
||||
return model
|
||||
|
||||
monkeypatch.setattr(model_runner_module, "regionally_compile", _regionally_compile)
|
||||
|
||||
DiffusionModelRunner._compile_transformer(runner, "transformer")
|
||||
|
||||
assert compile_calls == [
|
||||
(
|
||||
runner.pipeline.transformer,
|
||||
(),
|
||||
{"dynamic": True},
|
||||
)
|
||||
]
|
||||
|
||||
|
||||
@pytest.mark.core_model
|
||||
@pytest.mark.cpu
|
||||
def test_execute_stepwise_streaming_returns_chunks_at_boundaries(monkeypatch):
|
||||
|
||||
Reference in new issue
Block a user