Skip to content

feat: support the LMCache server on ATOM and SGLang - #32

Closed
cquil11 wants to merge 9 commits into
mainfrom
feat/lmcache-server-atom
Closed

cquil11 wants to merge 9 commits into
mainfrom
feat/lmcache-server-atom

Conversation

@cquil11

@cquil11 cquil11 commented Sep 28, 2026 •

Copy link
Copy Markdown

Adds the out-of-process LMCache server from NVIDIA/srt-slurm#507 and extends LMCache support to SGLang and ATOM.

  • services[].type: lmcache-server runs lmcache server on every worker node by default, starts before workers, and waits for GET /healthcheck. The service is critical: a failed server fails the job. srtctl sets RPC port 8750 and HTTP port 8751; recipe args pass through to LMCache for settings such as cache size and chunk size.
  • vLLM: connector: lmcache-mp uses LMCacheMPConnector at tcp://localhost:8750, so each rank connects to the server on its own node. KVConnector gains optional static extra_config for these defaults. A direct vllm serve aggregate worker (frontend.type: vllm) now runs the connector its role names under roles.agg.args.connector; it still skips the engine-wide default, which stays a prefill/decode setting. The disaggregated example combines LMCache MP with NIXL through MultiConnector.
  • SGLang: roles with enable-lmcache: true get LMCACHE_MP_HOST and LMCACHE_MP_PORT set to the local server. Recipes can supply their own connection settings through lmcache-config-file or LMCACHE_MP_HOST in the role environment.
  • ATOM: extra-kv-connectors supports in-process CPU offload (lmcache_offload) and the LMCache server client (lmcache_mp) on any role. Prefill/decode roles combine extras with the generated Mooncake connector using ATOM's multi connector, preserving the Mooncake handshake port. Aggregate roles use a single connector directly or wrap several in multi. lmcache_mp defaults to port 8750 and preserves recipe overrides.

For vLLM:

engine:
  type: vllm
  connector: lmcache-mp
services:
  - name: lmcache
    type: lmcache-server
    args: [--l1-size-gb, "180", --chunk-size, "256", --max-workers, "4"]

For ATOM CPU offload alongside Mooncake:

roles:
  prefill:
    env:
      PYTHONHASHSEED: "0"
    args:
      extra-kv-connectors:
        - kv_connector: lmcache_offload
          kv_role: offload

Includes aggregated and disaggregated vLLM examples, an aggregated SGLang example, and ATOM configuration docs. LMCache must be installed in the job container, either in the image or through the recipe's setup_script.

Validation

Tested on hardware through InferenceX, applied as a patch:

Path Hardware Run Result
ATOM extra-kv-connectors (Mooncake + lmcache_offload) MI355X 1P1D, conc 256 (InferenceX#3543) 36461236354 Passed
lmcache-server + vLLM LMCacheMPConnector MI300X TP8, conc 16 (InferenceX#3545) 36460859852 Passed
lmcache-server + SGLang enable-lmcache B200 TP8, conc 76 (InferenceX#3554) 36490342974 Passed

Not yet tested on hardware: ATOM lmcache_mp.


Note

Medium Risk
Changes KV connector generation and job startup order for inference workers; misconfiguration could break P/D or prefix-cache behavior, but defaults are additive and covered by snapshot tests.

Overview
Adds services[].type: lmcache-server, which starts the out-of-process LMCache MP server on each worker node (RPC 8750, HTTP 8751) before workers, treats it as critical, and gates on GET /healthcheck.

vLLM gains connector: lmcache-mp (LMCacheMPConnector → node-local server). Direct aggregate vllm serve workers now honor a per-role connector (e.g. lmcache-mp) while still skipping the engine-wide P/D default. SGLang workers with enable-lmcache get LMCACHE_MP_HOST/LMCACHE_MP_PORT unless the recipe sets lmcache-config-file or LMCACHE_MP_HOST. ATOM supports extra-kv-connectors in role args: P/D roles merge extras with the generated Mooncake connector via ATOM’s multi wrapper; aggregate roles use a single extra or multi when several are listed; lmcache_mp defaults to port 8750.

Docs, schema updates, three feature examples (vLLM agg/disagg, SGLang agg), and launch snapshots/tests cover the new paths.

Reviewed by Cursor Bugbot for commit 0f595d2. Bugbot is set up for automated code reviews on this repo. Configure here.

sammshen and others added 2 commits September 28, 2026 11:06
Add services[].type: lmcache-server, which runs the LMCache multiprocess
server on every worker node before workers and gates on GET /healthcheck,
and connector: lmcache-mp, which points vLLM's LMCacheMPConnector at that
node-local server. The kind fixes only the ports srtctl owns; recipe args
are appended verbatim.
A role can list extra-kv-connectors in its args. srtctl keeps generating
the Mooncake P/D connector with its handshake port and wraps it with the
extras in ATOM's multi connector, which is how ATOM runs its in-process
LMCache CPU offload on prefill. A single extra connector on an aggregate
role is passed unwrapped.
…server

SGLang's enable-lmcache flag runs LMCacheUnifiedRadixCache over LMCache's
multiprocess connector, which reads the server address from
LMCACHE_MP_HOST and LMCACHE_MP_PORT. srtctl now sets both to the
lmcache-server service on the worker's own node, unless the recipe passes
lmcache-config-file or sets LMCACHE_MP_HOST in the role env.
@cquil11 cquil11 changed the title feat(atom): add LMCache offload next to Mooncake feat: add LMCache support for ATOM and SGLang Sep 28, 2026
Drop the aggregate-role path, the underscore spelling and per-entry
validation; prefill/decode wrap Mooncake plus the extras in multi and
aggregate roles reject extra-kv-connectors.
ATOM runs lmcache_offload on aggregate servers too, and its lmcache_mp
connector is a client for the same lmcache server that the lmcache-server
service launches. extra-kv-connectors now work on any role: an aggregate
role with one connector runs it alone, and several are wrapped in multi.
lmcache_mp defaults lmcache.mp.port to srtctl's node-local server port
unless the recipe gives an address.
)
if process.endpoint_mode in {"prefill", "decode"}:
command.extend(["--kv-transfer-config", self._kv_transfer_config(process, worker_ip)])
kv_transfer_config = self._kv_transfer_config(process, worker_ip, extra_connectors)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

now agg configs can also go this path

A direct vllm serve aggregate worker dropped every KV connector, so
roles.agg.args.connector (for example lmcache-mp offload to the
lmcache-server service) never reached --kv-transfer-config. It now gets
the connector its role names; the engine-wide default stays a
prefill/decode setting.
cquil11 pushed a commit to SemiAnalysisAI/InferenceX that referenced this pull request Sep 28, 2026
…gate connector

Regenerated from SemiAnalysisAI/srt-slurm#32 at 181b2e4: a direct vllm serve
aggregate worker now keeps the connector its role names (for example
lmcache-mp), instead of dropping it.
cquil11 pushed a commit to SemiAnalysisAI/InferenceX that referenced this pull request Sep 28, 2026
…MCache point

The refreshed lmcache-server patch (SemiAnalysisAI/srt-slurm#32 at 181b2e4)
keeps a role's connector on a direct vllm serve aggregate worker, so the
variant names connector: lmcache-mp instead of hand-writing its
kv-transfer-config. The message queue timeout falls back to LMCache's
default (300 s) instead of 6000 s.
cquil11 pushed a commit to SemiAnalysisAI/InferenceX that referenced this pull request Sep 28, 2026
…slurm v2.30.0

main bumped srt-slurm to v2.30.0 and dropped the 504 patch. The 507 patch
is regenerated on v2.30.0 from SemiAnalysisAI/srt-slurm#32 at 181b2e4, and
the #3545 perf-changelog entry is rewritten to state the benchmark change:
one lmcache-server with 1296 GB L1 instead of 8 per-rank 162 GB servers,
image v0.30.0, LMCacheMPConnector at localhost:8750 with mq_timeout 6000,
re-measured results.
cquil11 pushed a commit to SemiAnalysisAI/InferenceX that referenced this pull request Sep 28, 2026
…ctors

Carry runners/srt-slurm/patches/507-lmcache-server-atom-sglang.patch
(SemiAnalysisAI/srt-slurm#32), which lets ATOM roles list extra KV
connectors that srtctl renders into --kv-transfer-config. The TP2 C20/C25/C30
and TP4 C40/C48 DRAM variants now declare the in-process lmcache_offload
connector there instead of ATOM_KV_OFFLOAD, matching the upstream ATOM
recipe's --kv-transfer-config. The LMCACHE_* settings are unchanged.
Signed-off-by: Cameron Quilici <cjquilici@gmail.com>
Signed-off-by: Cameron Quilici <cjquilici@gmail.com>
@cquil11 cquil11 changed the title feat: add LMCache support for ATOM and SGLang feat: support the LMCache server on ATOM and SGLang Sep 29, 2026
cquil11 added a commit to SemiAnalysisAI/InferenceX that referenced this pull request Sep 29, 2026
…server service (#3545)

* feat(agentx): run the MiniMax-M3 MI300X LMCache point on the lmcache-server service

* chore(agentx): set the perf-changelog pr-link for #3545

* fix(agentx): match the MiniMax-M3 MI300X recipe image to its config

amd-master.yaml moved minimaxm3-fp8-mi300x-vllm-agentic-mtp to
vllm/vllm-openai-rocm:v0.30.0 in #3361, but the recipe still named v0.29.0,
so the single-node adapter rejected every point.

* fix(agentx): name the lmcache-mp connector on the MiniMax-M3 MI300X LMCache point

The refreshed lmcache-server patch (SemiAnalysisAI/srt-slurm#32 at 181b2e4)
keeps a role's connector on a direct vllm serve aggregate worker, so the
variant names connector: lmcache-mp instead of hand-writing its
kv-transfer-config. The message queue timeout falls back to LMCache's
default (300 s) instead of 6000 s.

* fix(agentx): keep the measured LMCache message queue timeout on MI300X

The role connector is now the lmcache-mp preset written out plus
lmcache.mp.mq_timeout 6000, so the point keeps its measured timeout
instead of falling back to LMCache's 300 s default.

* docs(changelog): keep only the perf-affecting changes in the #3545 entry

---------

Co-authored-by: Cameron Quilici <cameron@semianalysis.com>
@cquil11

cquil11 commented Oct 5, 2026

Copy link
Copy Markdown
Author

Closing because the LMCache server and its ATOM/SGLang integration were merged upstream in NVIDIA#507 and NVIDIA#528.

@cquil11 cquil11 closed this Oct 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants