@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / 97d6c30cc9
Fork 0

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 14, 23:45 UTC

[BugFix] Fix shared storage connector load kv only load attention layer (#21428)

Signed-off-by: David Chen <530634352@qq.com>

WeiQing Chen committed Jul 26, 2025 at 22:07 UTC 97d6c30cc965e70579bfdad27e7514592752096e
1 file changed +10 -2
vllm/distributed/kv_transfer/kv_connector/v1/shared_storage_connector.py
+10 -2
@@ -156,8 +156,16 @@ class SharedStorageConnector(KVConnectorBase_V1):
156 logger.info("Inject KV cache of %d tokens to the paged memory",
157 len(request.slot_mapping))
158 for layer_name in forward_context.no_compile_layers:
159 - attn_layer = forward_context.no_compile_layers[layer_name]
160 - kv_cache_layer = attn_layer.kv_cache[\
159 + layer = forward_context.no_compile_layers[layer_name]
160 +
161 + # Only process layers that have kv_cache
162 + # attribute (attention layers) Skip non-attention
163 + # layers like FusedMoE/MLP etc.
164 + kv_cache_attr = getattr(layer, 'kv_cache', None)
165 + if kv_cache_attr is None:
166 + continue
167 +
168 + kv_cache_layer = kv_cache_attr[ \
169 forward_context.virtual_engine]
170
171 filename = self._generate_filename_debug(