[Feature] Transfer AR-to-diffusion payloads over NIXL (#6264)
Signed-off-by: yuanwu <yuan.wu@intel.com> Co-authored-by: Hongsheng Liu <liuhongsheng4@huawei.com>
This commit is contained in:
1 parent
8953d082c0
commit
cb5f508212
60 files changed
+4397
-641
No files matched your search
@@ -150,6 +150,7 @@ class OmniServerParams(NamedTuple):
|
||||
use_stage_cli: bool = False
|
||||
init_timeout: int | None = None
|
||||
stage_init_timeout: int | None = None # None: fixture supplies default (600 s)
|
||||
startup_timeout: int = SERVER_STARTUP_TIMEOUT_S
|
||||
|
||||
|
||||
class OmniServer:
|
||||
@@ -163,8 +164,10 @@ class OmniServer:
|
||||
port: int | None = None,
|
||||
env_dict: dict[str, str] | None = None,
|
||||
use_omni: bool = True,
|
||||
startup_timeout: int = SERVER_STARTUP_TIMEOUT_S,
|
||||
) -> None:
|
||||
cleanup_test_environment()
|
||||
self.startup_timeout = startup_timeout
|
||||
self.model = model
|
||||
args = list(serve_args)
|
||||
self.serve_args = args
|
||||
@@ -248,7 +251,7 @@ class OmniServer:
|
||||
cwd=_omni_subprocess_cwd(),
|
||||
)
|
||||
|
||||
max_wait = SERVER_STARTUP_TIMEOUT_S
|
||||
max_wait = self.startup_timeout
|
||||
# System clock corrections must not shorten or extend startup waits.
|
||||
start_time = time.monotonic()
|
||||
while time.monotonic() - start_time < max_wait:
|
||||
@@ -442,8 +445,11 @@ class OmniServerStageCli(OmniServer):
|
||||
stage_ids: list[int] | None = None,
|
||||
port: int | None = None,
|
||||
env_dict: dict[str, str] | None = None,
|
||||
startup_timeout: int = SERVER_STARTUP_TIMEOUT_S,
|
||||
) -> None:
|
||||
super().__init__(model, serve_args or [], port=port, env_dict=env_dict, use_omni=True)
|
||||
super().__init__(
|
||||
model, serve_args or [], port=port, env_dict=env_dict, use_omni=True, startup_timeout=startup_timeout
|
||||
)
|
||||
self.stage_config_path = stage_config_path
|
||||
self.master_port = get_open_port()
|
||||
resolved_cfg = resolve_deploy_yaml(stage_config_path)
|
||||
@@ -553,7 +559,7 @@ class OmniServerStageCli(OmniServer):
|
||||
for replica_id in range(self.stage_replica_counts.get(stage_id, 1)):
|
||||
self._launch_stage(stage_id, headless=True, replica_id=replica_id)
|
||||
|
||||
max_wait = SERVER_STARTUP_TIMEOUT_S
|
||||
max_wait = self.startup_timeout
|
||||
# System clock corrections must not shorten or extend startup waits.
|
||||
start_time = time.monotonic()
|
||||
while time.monotonic() - start_time < max_wait:
|
||||
@@ -1033,6 +1039,7 @@ def iter_omni_server(
|
||||
server_args,
|
||||
port=port,
|
||||
env_dict=params.env_dict,
|
||||
startup_timeout=params.startup_timeout,
|
||||
) as server:
|
||||
if model != original_model:
|
||||
server.model = original_model
|
||||
@@ -1050,6 +1057,7 @@ def iter_omni_server(
|
||||
port=port,
|
||||
env_dict=params.env_dict,
|
||||
use_omni=params.use_omni,
|
||||
startup_timeout=params.startup_timeout,
|
||||
)
|
||||
if port
|
||||
else OmniServer(
|
||||
@@ -1057,6 +1065,7 @@ def iter_omni_server(
|
||||
server_args,
|
||||
env_dict=params.env_dict,
|
||||
use_omni=params.use_omni,
|
||||
startup_timeout=params.startup_timeout,
|
||||
)
|
||||
) as server:
|
||||
if model != original_model:
|
||||
|
||||
@@ -38,7 +38,11 @@ def startup_server(request, tmp_path, monkeypatch):
|
||||
|
||||
@pytest.mark.parametrize("wall_clock_jump", [3600, -3600])
|
||||
@pytest.mark.parametrize("becomes_ready", [True, False], ids=["ready", "timeout"])
|
||||
def test_startup_deadline_ignores_wall_clock_changes(startup_server, monkeypatch, wall_clock_jump, becomes_ready):
|
||||
@pytest.mark.parametrize("startup_timeout", [runtime.SERVER_STARTUP_TIMEOUT_S, 2100])
|
||||
def test_startup_deadline_ignores_wall_clock_changes(
|
||||
startup_server, monkeypatch, wall_clock_jump, becomes_ready, startup_timeout
|
||||
):
|
||||
startup_server.startup_timeout = startup_timeout
|
||||
elapsed = 0.0
|
||||
wall_offset = 0.0
|
||||
first_probe_at = None
|
||||
@@ -66,7 +70,7 @@ def test_startup_deadline_ignores_wall_clock_changes(startup_server, monkeypatch
|
||||
if first_probe_at is None:
|
||||
first_probe_at = elapsed
|
||||
# Even a backwards clock correction must not extend the deadline.
|
||||
assert elapsed - first_probe_at < runtime.SERVER_STARTUP_TIMEOUT_S, "startup exceeded its elapsed-time budget"
|
||||
assert elapsed - first_probe_at < startup_timeout, "startup exceeded its elapsed-time budget"
|
||||
probes += 1
|
||||
if probes == 1:
|
||||
wall_offset += wall_clock_jump
|
||||
@@ -84,7 +88,7 @@ def test_startup_deadline_ignores_wall_clock_changes(startup_server, monkeypatch
|
||||
assert first_probe_at is not None
|
||||
assert elapsed - first_probe_at == 2
|
||||
else:
|
||||
with pytest.raises(RuntimeError, match=f"failed to start within {runtime.SERVER_STARTUP_TIMEOUT_S} seconds"):
|
||||
with pytest.raises(RuntimeError, match=f"failed to start within {startup_timeout} seconds"):
|
||||
startup_server._start_server()
|
||||
assert first_probe_at is not None
|
||||
assert elapsed - first_probe_at == runtime.SERVER_STARTUP_TIMEOUT_S
|
||||
assert elapsed - first_probe_at == startup_timeout
|
||||
Reference in new issue
Block a user