[Bugfix][MLA] Restore DSpark cache-group capability under optimized Python (#55234)
Signed-off-by: Summer Yang <girasoleyang@gmail.com>
This commit is contained in:
@@ -3,8 +3,11 @@
|
||||
import copy
|
||||
import hashlib
|
||||
import importlib
|
||||
import subprocess
|
||||
import sys
|
||||
from collections.abc import Callable
|
||||
from dataclasses import replace
|
||||
from pathlib import Path
|
||||
from types import SimpleNamespace
|
||||
from typing import Any, cast
|
||||
|
||||
@@ -1463,6 +1466,28 @@ def test_is_kv_cache_spec_uniform():
|
||||
}
|
||||
assert not is_kv_cache_spec_uniform(kv_cache_spec)
|
||||
|
||||
script = """
|
||||
import sys
|
||||
|
||||
from vllm.v1.core.kv_cache_utils import is_kv_cache_spec_uniform
|
||||
from vllm.v1.kv_cache_interface import KVCacheSpec
|
||||
|
||||
if sys.flags.optimize < 1:
|
||||
raise RuntimeError("subprocess is not running with optimization enabled")
|
||||
specs = {
|
||||
"a": KVCacheSpec(block_size=1),
|
||||
"b": KVCacheSpec(block_size=2),
|
||||
}
|
||||
if is_kv_cache_spec_uniform(specs):
|
||||
raise RuntimeError("different specs were treated as uniform")
|
||||
"""
|
||||
subprocess.run(
|
||||
[sys.executable, "-O", "-c", script],
|
||||
cwd=Path(__file__).resolve().parents[3],
|
||||
check=True,
|
||||
timeout=60,
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
("model_id", "max_model_len", "want_estimated_max_len"),
|
||||
|
||||
Reference in New Issue
Block a user