A high-throughput and memory-efficient inference and serving engine for LLMs
Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git
Synced Nov 11, 22:30 UTC
[CI]: Remove unnecessary imports from test_lmache_integration (#30157)
Signed-off-by: Samuel Shen <slshen@uchicago.edu> Co-authored-by: Samuel Shen <slshen@uchicago.edu>
Samuel Shen committed
Dec 5, 2025 at 20:53 UTC
7e31c3a3f699b2ec4bf18cb195edaf7270c1434c
1 file changed
+2
-60
tests/v1/kv_connector/unit/test_lmcache_integration.py
+2
-60
@@ -64,22 +64,6 @@ def test_multimodal_interface():
64
assumes(PlaceholderRange, "offset")
65
assumes(PlaceholderRange, "length")
66
67
- # test a minimal case
68
- import torch
69
-
70
- from vllm.distributed.kv_transfer.kv_connector.v1.lmcache_integration.utils import (
71
- apply_mm_hashes_to_token_ids,
72
- )
73
-
74
- token_ids = torch.arange(10, dtype=torch.long)
75
- mm_hashes = ["0000", "1111"] # hex repr of 0 and 4369
76
- mm_positions = [
77
- PlaceholderRange(offset=0, length=4),
78
- PlaceholderRange(offset=5, length=4),
79
- ]
80
- apply_mm_hashes_to_token_ids(token_ids, mm_hashes, mm_positions)
81
- assert token_ids.tolist() == [0, 0, 0, 0, 4, 4369, 4369, 4369, 4369, 9]
82
-
67
68
@pytest.mark.skipif(
69
current_platform.is_rocm(), reason="Requires libcudart.so, not available on ROCm"
@@ -122,16 +106,6 @@ def test_config_interface():
106
assumes(CacheConfig, "block_size")
107
assumes(CacheConfig, "gpu_memory_utilization")
108
125
- # mla metadata minimal cases
126
- from vllm.distributed.kv_transfer.kv_connector.v1.lmcache_integration.utils import (
127
- mla_enabled,
128
- )
129
-
130
- model_config = ModelConfig(model="deepseek-ai/DeepSeek-R1")
131
- assert mla_enabled(model_config)
132
- model_config = ModelConfig(model="Qwen/Qwen3-0.6B")
133
- assert not mla_enabled(model_config)
134
-
109
# kv metadata minimal case
110
from vllm.utils.torch_utils import get_kv_cache_torch_dtype
111
@@ -139,7 +113,7 @@ def test_config_interface():
113
parallel_config = ParallelConfig()
114
cache_config = CacheConfig(cache_dtype="bfloat16")
115
kv_dtype = get_kv_cache_torch_dtype(cache_config.cache_dtype, model_config.dtype)
142
- use_mla = mla_enabled(model_config)
116
+ use_mla = False
117
chunk_size = 256
118
num_layer = model_config.get_num_layers(parallel_config)
119
num_kv_head = model_config.get_num_kv_heads(parallel_config)
@@ -184,43 +158,11 @@ def test_request_interface():
158
assumes(req, "num_tokens")
159
assumes(req, "kv_transfer_params", is_instance_of=(dict, NoneType))
160
187
- from vllm.multimodal.inputs import MultiModalFeatureSpec, MultiModalKwargsItem
161
+ from vllm.multimodal.inputs import MultiModalFeatureSpec
162
163
assumes(MultiModalFeatureSpec, "identifier")
164
assumes(MultiModalFeatureSpec, "mm_position")
165
192
- # minimal case:
193
- from vllm.multimodal.inputs import PlaceholderRange
194
-
195
- request = Request(
196
- request_id="test_request",
197
- prompt_token_ids=[1, 2, 3],
198
- sampling_params=SamplingParams(max_tokens=10),
199
- pooling_params=None,
200
- eos_token_id=100,
201
- lora_request=None,
202
- mm_features=[
203
- MultiModalFeatureSpec(
204
- modality="image",
205
- identifier="0000",
206
- data=MultiModalKwargsItem.dummy("dummy_m"),
207
- mm_position=PlaceholderRange(offset=0, length=10),
208
- )
209
- ],
210
- )
211
-
212
- from vllm.distributed.kv_transfer.kv_connector.v1.lmcache_integration.utils import (
213
- extract_mm_features,
214
- )
215
-
216
- mm_hashes, mm_positions = extract_mm_features(request)
217
- assert isinstance(mm_hashes, list)
218
- assert len(mm_hashes) == 1
219
- assert isinstance(mm_positions, list)
220
- assert len(mm_positions) == 1
221
- assert mm_positions[0].offset == 0
222
- assert mm_positions[0].length == 10
223
-
166
167
def test_new_request_interface():
168
# protect against interface changes