[ci][test] adjust max wait time for cpu offloading test (#7709)
This commit is contained in:
@@ -56,16 +56,14 @@ VLLM_PATH = Path(__file__).parent.parent
|
||||
|
||||
class RemoteOpenAIServer:
|
||||
DUMMY_API_KEY = "token-abc123" # vLLM's OpenAI server does not need API key
|
||||
MAX_START_WAIT_S = 240 # wait for server to start for 240 seconds
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
model: str,
|
||||
cli_args: List[str],
|
||||
*,
|
||||
env_dict: Optional[Dict[str, str]] = None,
|
||||
auto_port: bool = True,
|
||||
) -> None:
|
||||
def __init__(self,
|
||||
model: str,
|
||||
cli_args: List[str],
|
||||
*,
|
||||
env_dict: Optional[Dict[str, str]] = None,
|
||||
auto_port: bool = True,
|
||||
max_wait_seconds: Optional[float] = None) -> None:
|
||||
if auto_port:
|
||||
if "-p" in cli_args or "--port" in cli_args:
|
||||
raise ValueError("You have manually specified the port"
|
||||
@@ -90,8 +88,9 @@ class RemoteOpenAIServer:
|
||||
env=env,
|
||||
stdout=sys.stdout,
|
||||
stderr=sys.stderr)
|
||||
max_wait_seconds = max_wait_seconds or 240
|
||||
self._wait_for_server(url=self.url_for("health"),
|
||||
timeout=self.MAX_START_WAIT_S)
|
||||
timeout=max_wait_seconds)
|
||||
|
||||
def __enter__(self):
|
||||
return self
|
||||
@@ -145,7 +144,8 @@ def compare_two_settings(model: str,
|
||||
arg1: List[str],
|
||||
arg2: List[str],
|
||||
env1: Optional[Dict[str, str]] = None,
|
||||
env2: Optional[Dict[str, str]] = None):
|
||||
env2: Optional[Dict[str, str]] = None,
|
||||
max_wait_seconds: Optional[float] = None) -> None:
|
||||
"""
|
||||
Launch API server with two different sets of arguments/environments
|
||||
and compare the results of the API calls.
|
||||
@@ -164,7 +164,10 @@ def compare_two_settings(model: str,
|
||||
token_ids = tokenizer(prompt)["input_ids"]
|
||||
results = []
|
||||
for args, env in ((arg1, env1), (arg2, env2)):
|
||||
with RemoteOpenAIServer(model, args, env_dict=env) as server:
|
||||
with RemoteOpenAIServer(model,
|
||||
args,
|
||||
env_dict=env,
|
||||
max_wait_seconds=max_wait_seconds) as server:
|
||||
client = server.get_client()
|
||||
|
||||
# test models list
|
||||
|
||||
Reference in New Issue
Block a user