[Misc] Fix Current vLLM config is not set. warnings, assert to avoid issues in the future (#31747)
Signed-off-by: Lucas Wilkinson <lwilkins@redhat.com> Signed-off-by: Lucas Wilkinson <LucasWilkinson@users.noreply.github.com> Co-authored-by: Luka Govedič <ProExpertProg@users.noreply.github.com>
This commit is contained in:
co-authored by
Luka Govedič
parent
5d3b6097ad
commit
6cdf015c3c
@@ -6,14 +6,14 @@ import torch
|
||||
from vllm.v1.worker.utils import bind_kv_cache
|
||||
|
||||
|
||||
def test_bind_kv_cache():
|
||||
def test_bind_kv_cache(default_vllm_config):
|
||||
from vllm.attention.layer import Attention
|
||||
|
||||
ctx = {
|
||||
"layers.0.self_attn": Attention(32, 128, 0.1),
|
||||
"layers.1.self_attn": Attention(32, 128, 0.1),
|
||||
"layers.2.self_attn": Attention(32, 128, 0.1),
|
||||
"layers.3.self_attn": Attention(32, 128, 0.1),
|
||||
"layers.0.self_attn": Attention(32, 128, 0.1, prefix="layers.0.self_attn"),
|
||||
"layers.1.self_attn": Attention(32, 128, 0.1, prefix="layers.1.self_attn"),
|
||||
"layers.2.self_attn": Attention(32, 128, 0.1, prefix="layers.2.self_attn"),
|
||||
"layers.3.self_attn": Attention(32, 128, 0.1, prefix="layers.3.self_attn"),
|
||||
}
|
||||
kv_cache = {
|
||||
"layers.0.self_attn": torch.zeros((1,)),
|
||||
@@ -34,13 +34,13 @@ def test_bind_kv_cache():
|
||||
assert runner_kv_caches[3] is kv_cache["layers.3.self_attn"]
|
||||
|
||||
|
||||
def test_bind_kv_cache_non_attention():
|
||||
def test_bind_kv_cache_non_attention(default_vllm_config):
|
||||
from vllm.attention.layer import Attention
|
||||
|
||||
# example from Jamba PP=2
|
||||
ctx = {
|
||||
"model.layers.20.attn": Attention(32, 128, 0.1),
|
||||
"model.layers.28.attn": Attention(32, 128, 0.1),
|
||||
"model.layers.20.attn": Attention(32, 128, 0.1, prefix="model.layers.20.attn"),
|
||||
"model.layers.28.attn": Attention(32, 128, 0.1, prefix="model.layers.28.attn"),
|
||||
}
|
||||
kv_cache = {
|
||||
"model.layers.20.attn": torch.zeros((1,)),
|
||||
|
||||
Reference in New Issue
Block a user