Prefix-Caching

Shared KV Cache Across Two DGX Spark Units: Valkey Cluster, Local SSD, and P2P Options

Shared KV Cache Across Two DGX Spark Units: Valkey Cluster, Local SSD, and P2P Options

10 min read

Two NVIDIA DGX Spark units running independent vLLM instances have a blind spot: vLLM’s prefix cache is per-node. A request landing on spark-2 cannot reuse the KV cache blocks that spark-1 already computed for the same prompt prefix. Every node cold-starts its own KV cache, so repeated prompts and multi-turn conversations pay the prefill penalty on every hop.

This post documents how to share KV cache across both DGX Spark nodes using LMCache, a standalone KV cache layer for LLM inference. It compares three native storage backends — a Valkey cluster on both nodes, local SSD per node, and direct P2P transfer over the ConnectX-7 NIC — with no custom Python or dispatcher code required.