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
e5043a3e
Unverified
Commit
e5043a3e
authored
Apr 04, 2024
by
Cade Daniel
Committed by
GitHub
Apr 04, 2024
Browse files
[Misc] Add pytest marker to opt-out of global test cleanup (#3863)
parent
d03d64fd
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
4 deletions
+11
-4
tests/conftest.py
tests/conftest.py
+5
-1
tests/spec_decode/test_batch_expansion.py
tests/spec_decode/test_batch_expansion.py
+3
-0
tests/spec_decode/test_spec_decode_worker.py
tests/spec_decode/test_spec_decode_worker.py
+3
-3
No files found.
tests/conftest.py
View file @
e5043a3e
...
...
@@ -56,11 +56,15 @@ def cleanup():
@
pytest
.
fixture
()
def
should_do_global_cleanup_after_test
()
->
bool
:
def
should_do_global_cleanup_after_test
(
request
)
->
bool
:
"""Allow subdirectories to skip global cleanup by overriding this fixture.
This can provide a ~10x speedup for non-GPU unit tests since they don't need
to initialize torch.
"""
if
request
.
node
.
get_closest_marker
(
"skip_global_cleanup"
):
return
False
return
True
...
...
tests/spec_decode/test_batch_expansion.py
View file @
e5043a3e
...
...
@@ -7,6 +7,7 @@ from .utils import create_seq_group_metadata_from_prompts, mock_worker
@
pytest
.
mark
.
parametrize
(
'num_target_seq_ids'
,
[
100
])
@
pytest
.
mark
.
skip_global_cleanup
def
test_create_target_seq_id_iterator
(
num_target_seq_ids
:
int
):
"""Verify all new sequence ids are greater than all input
seq ids.
...
...
@@ -27,6 +28,7 @@ def test_create_target_seq_id_iterator(num_target_seq_ids: int):
@
pytest
.
mark
.
parametrize
(
'k'
,
[
1
,
2
,
6
])
@
pytest
.
mark
.
skip_global_cleanup
def
test_get_token_ids_to_score
(
k
:
int
):
"""Verify correct tokens are selected for scoring.
"""
...
...
@@ -53,6 +55,7 @@ def test_get_token_ids_to_score(k: int):
@
pytest
.
mark
.
parametrize
(
'k'
,
[
1
,
2
,
6
])
@
pytest
.
mark
.
skip_global_cleanup
def
test_create_single_target_seq_group_metadata
(
k
:
int
):
"""Verify correct creation of a batch-expanded seq group metadata.
"""
...
...
tests/spec_decode/test_spec_decode_worker.py
View file @
e5043a3e
...
...
@@ -487,7 +487,7 @@ def test_empty_input_batch(k: int, batch_size: int):
**
execute_model_data
.
to_dict
())
@
torch
.
inference_mode
()
@
pytest
.
mark
.
skip_global_cleanup
def
test_init_device
():
"""Verify SpecDecodeWorker invokes proposer/scorer worker init_device, as
well as other GPU initialization.
...
...
@@ -537,7 +537,7 @@ def test_init_cache_engine():
@
pytest
.
mark
.
parametrize
(
'available_cpu_blocks'
,
[
500
])
@
pytest
.
mark
.
parametrize
(
'target_cache_block_size_bytes'
,
[
2
*
2
*
4096
])
@
pytest
.
mark
.
parametrize
(
'draft_kv_size_bytes'
,
[
0
,
2
*
2
*
768
,
2
*
2
*
4096
])
@
torch
.
inference_mode
()
@
pytest
.
mark
.
skip_global_cleanup
def
test_profile_num_available_blocks
(
available_gpu_blocks
:
int
,
available_cpu_blocks
:
int
,
target_cache_block_size_bytes
:
int
,
...
...
@@ -584,7 +584,7 @@ def test_profile_num_available_blocks(available_gpu_blocks: int,
@
pytest
.
mark
.
parametrize
(
'target_cache_block_size_bytes'
,
[
2
*
2
*
4096
,
2
*
2
*
8192
])
@
pytest
.
mark
.
parametrize
(
'draft_kv_size_bytes'
,
[
0
,
2
*
2
*
768
,
2
*
2
*
4096
])
@
torch
.
inference_mode
()
@
pytest
.
mark
.
skip_global_cleanup
def
test_split_num_cache_blocks_evenly
(
available_gpu_blocks
:
int
,
target_cache_block_size_bytes
:
int
,
draft_kv_size_bytes
:
int
):
...
...
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