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
308cc5e2
Unverified
Commit
308cc5e2
authored
Nov 27, 2024
by
youkaichao
Committed by
GitHub
Nov 27, 2024
Browse files
[ci] fix slow tests (#10698)
Signed-off-by:
youkaichao
<
youkaichao@gmail.com
>
parent
9e0a147d
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
15 deletions
+39
-15
tests/entrypoints/llm/test_lazy_outlines.py
tests/entrypoints/llm/test_lazy_outlines.py
+17
-5
tests/test_lazy_torch_compile.py
tests/test_lazy_torch_compile.py
+17
-5
tests/vllm_test_utils/vllm_test_utils/blame.py
tests/vllm_test_utils/vllm_test_utils/blame.py
+5
-5
No files found.
tests/entrypoints/llm/test_lazy_outlines.py
View file @
308cc5e2
import
sys
from
contextlib
import
nullcontext
from
vllm_test_utils
import
blame
from
vllm_test_utils
import
BlameResult
,
blame
from
vllm
import
LLM
,
SamplingParams
from
vllm.distributed
import
cleanup_dist_env_and_memory
...
...
@@ -56,9 +57,20 @@ def test_lazy_outlines(sample_regex):
"""
# make sure outlines is not imported
module_name
=
"outlines"
with
blame
(
lambda
:
module_name
in
sys
.
modules
)
as
result
:
# In CI, we only check finally if the module is imported.
# If it is indeed imported, we can rerun the test with `use_blame=True`,
# which will trace every function call to find the first import location,
# and help find the root cause.
# We don't run it in CI by default because it is slow.
use_blame
=
False
context
=
blame
(
lambda
:
module_name
in
sys
.
modules
)
if
use_blame
else
nullcontext
()
with
context
as
result
:
run_normal
()
run_lmfe
(
sample_regex
)
assert
not
result
.
found
,
(
f
"Module
{
module_name
}
is already imported, the"
f
" first import location is:
\n
{
result
.
trace_stack
}
"
)
if
use_blame
:
assert
isinstance
(
result
,
BlameResult
)
print
(
f
"the first import location is:
\n
{
result
.
trace_stack
}
"
)
assert
module_name
not
in
sys
.
modules
,
(
f
"Module
{
module_name
}
is imported. To see the first"
f
" import location, run the test with `use_blame=True`."
)
tests/test_lazy_torch_compile.py
View file @
308cc5e2
...
...
@@ -2,15 +2,27 @@
# The utility function cannot be placed in `vllm.utils`
# this needs to be a standalone script
import
sys
from
contextlib
import
nullcontext
from
vllm_test_utils
import
blame
from
vllm_test_utils
import
BlameResult
,
blame
module_name
=
"torch._inductor.async_compile"
with
blame
(
lambda
:
module_name
in
sys
.
modules
)
as
result
:
# In CI, we only check finally if the module is imported.
# If it is indeed imported, we can rerun the test with `use_blame=True`,
# which will trace every function call to find the first import location,
# and help find the root cause.
# We don't run it in CI by default because it is slow.
use_blame
=
False
context
=
blame
(
lambda
:
module_name
in
sys
.
modules
)
if
use_blame
else
nullcontext
()
with
context
as
result
:
import
vllm
# noqa
assert
not
result
.
found
,
(
f
"Module
{
module_name
}
is already imported, the"
f
" first import location is:
\n
{
result
.
trace_stack
}
"
)
if
use_blame
:
assert
isinstance
(
result
,
BlameResult
)
print
(
f
"the first import location is:
\n
{
result
.
trace_stack
}
"
)
print
(
f
"Module
{
module_name
}
is not imported yet"
)
assert
module_name
not
in
sys
.
modules
,
(
f
"Module
{
module_name
}
is imported. To see the first"
f
" import location, run the test with `use_blame=True`."
)
tests/vllm_test_utils/vllm_test_utils/blame.py
View file @
308cc5e2
...
...
@@ -46,8 +46,8 @@ def blame(func: Callable) -> Generator[BlameResult, None, None]:
pass
return
_trace_calls
try
:
sys
.
settrace
(
_trace_calls
)
yield
result
finally
:
sys
.
settrace
(
None
)
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