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
32c9d7f7
Unverified
Commit
32c9d7f7
authored
Jul 14, 2024
by
Simon Mo
Committed by
GitHub
Jul 14, 2024
Browse files
Report usage for beam search (#6404)
parent
ccb20db8
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
2 deletions
+18
-2
vllm/sampling_params.py
vllm/sampling_params.py
+5
-0
vllm/usage/usage_lib.py
vllm/usage/usage_lib.py
+13
-2
No files found.
vllm/sampling_params.py
View file @
32c9d7f7
...
@@ -189,6 +189,10 @@ class SamplingParams:
...
@@ -189,6 +189,10 @@ class SamplingParams:
self
.
_verify_args
()
self
.
_verify_args
()
if
self
.
use_beam_search
:
if
self
.
use_beam_search
:
# Lazy import to avoid circular imports.
from
vllm.usage.usage_lib
import
set_runtime_usage_data
set_runtime_usage_data
(
"use_beam_search"
,
True
)
if
not
envs
.
VLLM_NO_DEPRECATION_WARNING
:
if
not
envs
.
VLLM_NO_DEPRECATION_WARNING
:
logger
.
warning
(
logger
.
warning
(
"[IMPORTANT] We plan to discontinue the support for beam "
"[IMPORTANT] We plan to discontinue the support for beam "
...
@@ -196,6 +200,7 @@ class SamplingParams:
...
@@ -196,6 +200,7 @@ class SamplingParams:
"https://github.com/vllm-project/vllm/issues/6226 for "
"https://github.com/vllm-project/vllm/issues/6226 for "
"more information. Set VLLM_NO_DEPRECATION_WARNING=1 to "
"more information. Set VLLM_NO_DEPRECATION_WARNING=1 to "
"suppress this warning."
)
"suppress this warning."
)
self
.
_verify_beam_search
()
self
.
_verify_beam_search
()
else
:
else
:
self
.
_verify_non_beam_search
()
self
.
_verify_non_beam_search
()
...
...
vllm/usage/usage_lib.py
View file @
32c9d7f7
...
@@ -7,7 +7,7 @@ import time
...
@@ -7,7 +7,7 @@ import time
from
enum
import
Enum
from
enum
import
Enum
from
pathlib
import
Path
from
pathlib
import
Path
from
threading
import
Thread
from
threading
import
Thread
from
typing
import
Any
,
Dict
,
Optional
from
typing
import
Any
,
Dict
,
Optional
,
Union
from
uuid
import
uuid4
from
uuid
import
uuid4
import
cpuinfo
import
cpuinfo
...
@@ -25,6 +25,13 @@ _USAGE_STATS_DO_NOT_TRACK_PATH = os.path.join(_config_home,
...
@@ -25,6 +25,13 @@ _USAGE_STATS_DO_NOT_TRACK_PATH = os.path.join(_config_home,
_USAGE_STATS_ENABLED
=
None
_USAGE_STATS_ENABLED
=
None
_USAGE_STATS_SERVER
=
envs
.
VLLM_USAGE_STATS_SERVER
_USAGE_STATS_SERVER
=
envs
.
VLLM_USAGE_STATS_SERVER
_GLOBAL_RUNTIME_DATA
:
Dict
[
str
,
Union
[
str
,
int
,
bool
]]
=
{}
def
set_runtime_usage_data
(
key
:
str
,
value
:
Union
[
str
,
int
,
bool
])
->
None
:
"""Set global usage data that will be sent with every usage heartbeat."""
_GLOBAL_RUNTIME_DATA
[
key
]
=
value
def
is_usage_stats_enabled
():
def
is_usage_stats_enabled
():
"""Determine whether or not we can send usage stats to the server.
"""Determine whether or not we can send usage stats to the server.
...
@@ -187,7 +194,11 @@ class UsageMessage:
...
@@ -187,7 +194,11 @@ class UsageMessage:
"""
"""
while
True
:
while
True
:
time
.
sleep
(
600
)
time
.
sleep
(
600
)
data
=
{
"uuid"
:
self
.
uuid
,
"log_time"
:
_get_current_timestamp_ns
()}
data
=
{
"uuid"
:
self
.
uuid
,
"log_time"
:
_get_current_timestamp_ns
(),
}
data
.
update
(
_GLOBAL_RUNTIME_DATA
)
self
.
_write_to_file
(
data
)
self
.
_write_to_file
(
data
)
self
.
_send_to_server
(
data
)
self
.
_send_to_server
(
data
)
...
...
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