Skip to content

Commit 686a3a8

Browse files
committed
wip: reviewer fixes
Signed-off-by: Deep Shah <deep@socratic.co>
1 parent 5bb7cca commit 686a3a8

2 files changed

Lines changed: 15 additions & 17 deletions

File tree

tests/e2e/features/fullduplex/engine/test_duplex_deploy_config.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
import pytest
1010

11+
from tests.helpers.stage_config import get_deploy_duplex_max_sessions
1112
from vllm_omni.config.stage_config import (
1213
DuplexSessionRuntimeConfig,
1314
load_deploy_config,
@@ -66,3 +67,9 @@ def test_duplex_session_runtime_rejects_non_positive_values(tmp_path, name: str,
6667

6768
with pytest.raises(ValueError, match=rf"duplex_session\.{name} must be positive"):
6869
load_deploy_config(deploy_path)
70+
71+
72+
def test_deploy_duplex_max_sessions_tracks_the_shipping_config() -> None:
73+
# Guards the admission probe: a capacity edit must surface here, not as a
74+
# nightly duplex admission timeout.
75+
assert get_deploy_duplex_max_sessions("minicpmo_4_5.yaml") == 4

tests/helpers/stage_config.py

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212
import yaml
1313

14+
from vllm_omni.config.stage_config import load_deploy_config
15+
1416

1517
def modify_stage_config(
1618
yaml_path: str,
@@ -669,25 +671,14 @@ def get_deploy_config_stage(rel_path: str, stage_id: int) -> dict[str, Any]:
669671
raise KeyError(f"No stage_id={stage_id} in deploy config {rel_path!r}")
670672

671673

672-
def get_deploy_duplex_max_sessions(rel_path: str, default: int = 1) -> int:
673-
"""Return ``duplex_session.max_sessions`` from a deploy yaml.
674+
def get_deploy_duplex_max_sessions(rel_path: str) -> int:
675+
"""Return the duplex session capacity a deploy yaml admits.
674676
675-
``default`` mirrors ``DuplexSessionConfig.max_sessions`` so a deploy config
676-
that declares no capacity resolves to the limit the server itself applies.
677-
A declared but invalid capacity raises instead of silently falling back to a
678-
limit the server would never use, matching the runtime validation.
677+
Loads through ``load_deploy_config`` so ``base_config`` merging and
678+
``DuplexSessionRuntimeConfig`` defaults stay in lockstep with the server
679+
instead of being re-implemented here.
679680
"""
680-
with open(get_deploy_config_path(rel_path), encoding="utf-8") as f:
681-
cfg = yaml.safe_load(f) or {}
682-
683-
duplex_session = cfg.get("duplex_session")
684-
if not isinstance(duplex_session, dict) or "max_sessions" not in duplex_session:
685-
return default
686-
687-
max_sessions = duplex_session["max_sessions"]
688-
if not isinstance(max_sessions, int) or isinstance(max_sessions, bool) or max_sessions <= 0:
689-
raise ValueError(f"duplex_session.max_sessions must be a positive int in {rel_path!r}, got {max_sessions!r}")
690-
return max_sessions
681+
return load_deploy_config(get_deploy_config_path(rel_path)).duplex_session.max_sessions
691682

692683

693684
def _stage_ids_from_deploy_yaml(stage_config_path: str) -> list[int]:

0 commit comments

Comments
 (0)