Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bugfix / Core] Prefix Caching Guards #3903

Closed
24 changes: 23 additions & 1 deletion tests/test_config.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,27 @@
import pytest

from vllm.config import ModelConfig

MODEL_IDS = ["Qwen/Qwen1.5-7B", "mistralai/Mistral-7B-v0.1"]


@pytest.mark.parametrize("model_id", MODEL_IDS)
def test_disable_sliding_window(model_id):
model_config = ModelConfig(
model_id,
model_id,
tokenizer_mode="auto",
trust_remote_code=False,
download_dir=None,
load_format="dummy",
seed=0,
dtype="float16",
revision=None,
disable_sliding_window=True,
)

assert model_config.max_model_len <= model_config.hf_config.sliding_window


def test_get_sliding_window():
TEST_SLIDING_WINDOW = 4096
Expand Down Expand Up @@ -40,4 +62,4 @@ def test_get_sliding_window():
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
assert mistral_model_config.get_sliding_window() == TEST_SLIDING_WINDOW
Loading
Loading