-
-
Notifications
You must be signed in to change notification settings - Fork 5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix assertion failure in Qwen 1.5 with prefix caching enabled (#3373)
Co-authored-by: Cade Daniel <[email protected]>
- Loading branch information
1 parent
dfc7740
commit 54be8a0
Showing
2 changed files
with
55 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
from vllm.config import ModelConfig | ||
|
||
|
||
def test_get_sliding_window(): | ||
TEST_SLIDING_WINDOW = 4096 | ||
# Test that the sliding window is correctly computed. | ||
# For Qwen1.5/Qwen2, get_sliding_window() should be None | ||
# when use_sliding_window is False. | ||
qwen2_model_config = ModelConfig( | ||
"Qwen/Qwen1.5-7B", | ||
"Qwen/Qwen1.5-7B", | ||
tokenizer_mode="auto", | ||
trust_remote_code=False, | ||
download_dir=None, | ||
load_format="dummy", | ||
seed=0, | ||
dtype="float16", | ||
revision=None, | ||
) | ||
|
||
qwen2_model_config.hf_config.use_sliding_window = False | ||
qwen2_model_config.hf_config.sliding_window = TEST_SLIDING_WINDOW | ||
assert qwen2_model_config.get_sliding_window() is None | ||
|
||
qwen2_model_config.hf_config.use_sliding_window = True | ||
assert qwen2_model_config.get_sliding_window() == TEST_SLIDING_WINDOW | ||
|
||
mistral_model_config = ModelConfig( | ||
"mistralai/Mistral-7B-v0.1", | ||
"mistralai/Mistral-7B-v0.1", | ||
tokenizer_mode="auto", | ||
trust_remote_code=False, | ||
download_dir=None, | ||
load_format="dummy", | ||
seed=0, | ||
dtype="float16", | ||
revision=None, | ||
) | ||
mistral_model_config.hf_config.sliding_window = None | ||
assert mistral_model_config.get_sliding_window() is None | ||
|
||
mistral_model_config.hf_config.sliding_window = TEST_SLIDING_WINDOW | ||
assert mistral_model_config.get_sliding_window() == TEST_SLIDING_WINDOW |
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