forked from vllm-project/vllm
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Bugfix] Make spec. decode respect per-request seed. (vllm-project#6034)
Signed-off-by: Thomas Parnell <[email protected]> Co-authored-by: Nick Hill <[email protected]>
- Loading branch information
1 parent
4f9680e
commit c5aa35c
Showing
8 changed files
with
293 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import pytest | ||
|
||
from .conftest import run_equality_correctness_test | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"common_llm_kwargs", | ||
[{ | ||
"model": "JackFram/llama-68m", | ||
# Skip cuda graph recording for fast test. | ||
"enforce_eager": True, | ||
# Required for spec decode. | ||
"use_v2_block_manager": True, | ||
# speculative model | ||
"speculative_model": "JackFram/llama-160m", | ||
# num speculative tokens | ||
"num_speculative_tokens": 3, | ||
}]) | ||
@pytest.mark.parametrize("per_test_common_llm_kwargs", [{}]) | ||
@pytest.mark.parametrize("baseline_llm_kwargs", [{}]) | ||
@pytest.mark.parametrize("batch_size", [1, 8, 32]) | ||
@pytest.mark.parametrize("temperature", [0.1, 1.0]) | ||
@pytest.mark.parametrize( | ||
"output_len", | ||
[ | ||
# Use smaller output len for fast test. | ||
10, | ||
]) | ||
@pytest.mark.parametrize("seed", [1]) | ||
def test_seeded_consistency(baseline_llm_generator, batch_size: int, | ||
temperature: float, output_len: int): | ||
"""Verify outputs are consistent across multiple runs with same seed | ||
""" | ||
run_equality_correctness_test(baseline_llm_generator, | ||
baseline_llm_generator, | ||
batch_size, | ||
max_output_len=output_len, | ||
temperature=temperature, | ||
seeded=True, | ||
force_output_len=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.