PR Test (NPU) / single-node-poc (map[name:qwen3_6_27b_w8a8_1p_in64k_out1k_50ms runner:linux-aarch64-a3-2 test_case:test/registered/ascend/performance/qwen3_6_27b/test_npu_qwen3_6_27b_w8a8_1p_in64k_out1k_50ms.py test_type:perf]) (push) Has been cancelled
This document describes how to use LMCache as KV Cache Management Backend for SGLang engine.
For more details about LMCache, please refer to: https://lmcache.ai
Install LMCache
Method 1: with pip
pip install lmcache
Method 2: from source
Clone LMCache project:
git clone https://github.com/LMCache/LMCache
Install:
cd LMCache
pip install -e . --no-build-isolation
Use LMCache
LMCache supports two transport modes. MP (multi-process, default) issues a single blocking retrieve over ZMQ to a standalone daemon that owns the KV store and survives SGLang restarts. IP (in-process) uses an embedded layerwise connector — the cache lives and dies with the SGLang process. Mode selection is currently a code-level setting in LMCRadixCache.__init__ (self._mode); only MP is reachable by default.
MP mode (default): multi-process daemon
Uses LMCacheMPConnector. Daemon host/port come from the LMCache YAML config (mp_host, mp_port).
Uses LMCacheLayerwiseConnector. KV transfer happens per layer inside the SGLang process; the cache lives and dies with the server. To enable, edit LMCRadixCache.__init__ and set self._mode = LMCacheMode.IP.
The LMCache config still controls chunk_size and storage; mp_host / mp_port are ignored on this path. Use the bundled example_config_ip.yaml: