Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
vllm_cscc
Commits
ce75e153
Unverified
Commit
ce75e153
authored
Sep 20, 2025
by
samzong
Committed by
GitHub
Sep 19, 2025
Browse files
refactor(benchmarks): add type annotations to wait_for_endpoint parameters (#25218)
Signed-off-by:
samzong
<
samzong.lu@gmail.com
>
parent
aed16879
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
4 deletions
+16
-4
vllm/benchmarks/lib/endpoint_request_func.py
vllm/benchmarks/lib/endpoint_request_func.py
+13
-2
vllm/benchmarks/lib/ready_checker.py
vllm/benchmarks/lib/ready_checker.py
+3
-2
No files found.
vllm/benchmarks/lib/endpoint_request_func.py
View file @
ce75e153
...
@@ -8,8 +8,9 @@ import os
...
@@ -8,8 +8,9 @@ import os
import
sys
import
sys
import
time
import
time
import
traceback
import
traceback
from
collections.abc
import
Awaitable
from
dataclasses
import
dataclass
,
field
from
dataclasses
import
dataclass
,
field
from
typing
import
Optional
,
Union
from
typing
import
Optional
,
Protocol
,
Union
import
aiohttp
import
aiohttp
from
tqdm.asyncio
import
tqdm
from
tqdm.asyncio
import
tqdm
...
@@ -92,6 +93,16 @@ class RequestFuncOutput:
...
@@ -92,6 +93,16 @@ class RequestFuncOutput:
start_time
:
float
=
0.0
start_time
:
float
=
0.0
class
RequestFunc
(
Protocol
):
def
__call__
(
self
,
request_func_input
:
RequestFuncInput
,
session
:
aiohttp
.
ClientSession
,
pbar
:
Optional
[
tqdm
]
=
None
,
)
->
Awaitable
[
RequestFuncOutput
]:
...
async
def
async_request_openai_completions
(
async
def
async_request_openai_completions
(
request_func_input
:
RequestFuncInput
,
request_func_input
:
RequestFuncInput
,
session
:
aiohttp
.
ClientSession
,
session
:
aiohttp
.
ClientSession
,
...
@@ -507,7 +518,7 @@ async def async_request_openai_embeddings(
...
@@ -507,7 +518,7 @@ async def async_request_openai_embeddings(
# TODO: Add more request functions for different API protocols.
# TODO: Add more request functions for different API protocols.
ASYNC_REQUEST_FUNCS
=
{
ASYNC_REQUEST_FUNCS
:
dict
[
str
,
RequestFunc
]
=
{
"vllm"
:
async_request_openai_completions
,
"vllm"
:
async_request_openai_completions
,
"openai"
:
async_request_openai_completions
,
"openai"
:
async_request_openai_completions
,
"openai-chat"
:
async_request_openai_chat_completions
,
"openai-chat"
:
async_request_openai_chat_completions
,
...
...
vllm/benchmarks/lib/ready_checker.py
View file @
ce75e153
...
@@ -8,11 +8,12 @@ import time
...
@@ -8,11 +8,12 @@ import time
import
aiohttp
import
aiohttp
from
tqdm.asyncio
import
tqdm
from
tqdm.asyncio
import
tqdm
from
.endpoint_request_func
import
RequestFuncInput
,
RequestFuncOutput
from
.endpoint_request_func
import
(
RequestFunc
,
RequestFuncInput
,
RequestFuncOutput
)
async
def
wait_for_endpoint
(
async
def
wait_for_endpoint
(
request_func
,
request_func
:
RequestFunc
,
test_input
:
RequestFuncInput
,
test_input
:
RequestFuncInput
,
session
:
aiohttp
.
ClientSession
,
session
:
aiohttp
.
ClientSession
,
timeout_seconds
:
int
=
600
,
timeout_seconds
:
int
=
600
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment