Commit f7a1016
committed
Add Mooncake store support for vLLM backend
Extends mooncake_master orchestration (previously SGLang-only) to the
vLLM backend so vLLM workers can use the in-process MooncakeStore
connector for cross-process KV sharing.
What's new
----------
* `VLLMMooncakeKVStoreConfig` schema (`backends/vllm.py`): mirrors the
SGLang `mooncake_kv_store:` block, plus a vLLM-specific
`store_config:` section. srtslurm renders that section into the
`MOONCAKE_CONFIG_PATH` JSON file vLLM's `MooncakeStoreConnector`
reads on startup (`MooncakeStoreConfig.load_from_env()`); the
`env:` map is injected on every vLLM worker for the in-process
`MC_*` knobs (e.g. `MC_ENABLE_DEST_DEVICE_AFFINITY`,
`MC_STORE_CLIENT_METRIC`, `MC_TE_METRIC`).
* `start_mooncake_master` in `cli/do_sweep.py` now fires for vLLM as
well as SGLang, writes the per-job store JSON next to the other
log artifacts, and stamps the master RPC + HTTP-metadata endpoints
on each worker. Shared launch constants moved to a new
`backends/mooncake.py` (the SGLang module re-exports them so
downstream imports keep working).
* Mooncake admin HTTP server (`/metrics`, `/health`, `/role`,
`/ha_status`, `/leader`, `/query_key`) is now wired up explicitly:
the master srun passes `--enable_metric_reporting=true
--metrics_port=9003` (upstream default in master.cpp), and
`start_mooncake_master` waits on the metrics port like it already
waits on RPC + HTTP-metadata. The flag toggles a periodic stdout
log thread only — `MasterAdminServer` listens unconditionally —
the new constant's comment documents that to prevent future
reordering.
* Docs (`docs/mooncake-kv-store.md`): adds a vLLM quick start, a
vLLM-specific configuration reference (including `store_config`),
expands the ownership table for the auto-stamped vars, and
documents the new master metrics endpoint.
Validation
----------
* Manual: launched a 1P/1D disagg job; master came up with
`enable_metric_reporting=1, metrics_port=9003`; vLLM workers
picked up `MOONCAKE_CONFIG_PATH` and registered RDMA segments.
`curl :9003/metrics` returned a full Prometheus dump.
* Tests: `make check` (ruff + pytest). New cases in
`tests/test_e2e.py` cover the vLLM mooncake env injection and JSON
rendering; `tests/test_dry_run.py` cases cover the new config
surface in `srtctl dry-run` output.
Signed-off-by: inf-yasong <yasong.wang@inferact.ai>1 parent 9cd8fe8 commit f7a1016
9 files changed
Lines changed: 686 additions & 46 deletions
File tree
- docs
- src/srtctl
- backends
- cli
- core
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
| 12 | + | |
11 | 13 | | |
12 | 14 | | |
13 | 15 | | |
| |||
30 | 32 | | |
31 | 33 | | |
32 | 34 | | |
33 | | - | |
| 35 | + | |
34 | 36 | | |
35 | 37 | | |
36 | 38 | | |
| |||
63 | 65 | | |
64 | 66 | | |
65 | 67 | | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
66 | 96 | | |
67 | 97 | | |
68 | 98 | | |
69 | 99 | | |
70 | | - | |
| 100 | + | |
71 | 101 | | |
| 102 | + | |
72 | 103 | | |
| 104 | + | |
| 105 | + | |
73 | 106 | | |
74 | | - | |
75 | | - | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
76 | 110 | | |
77 | 111 | | |
78 | 112 | | |
| 113 | + | |
| 114 | + | |
79 | 115 | | |
80 | 116 | | |
81 | 117 | | |
| |||
93 | 129 | | |
94 | 130 | | |
95 | 131 | | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
96 | 152 | | |
97 | 153 | | |
98 | | - | |
99 | | - | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
100 | 171 | | |
101 | 172 | | |
102 | 173 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
25 | 29 | | |
26 | 30 | | |
27 | 31 | | |
| |||
30 | 34 | | |
31 | 35 | | |
32 | 36 | | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | 37 | | |
37 | 38 | | |
38 | 39 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
27 | 32 | | |
28 | 33 | | |
29 | 34 | | |
30 | | - | |
| 35 | + | |
31 | 36 | | |
32 | 37 | | |
33 | 38 | | |
34 | 39 | | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
35 | 99 | | |
36 | 100 | | |
37 | 101 | | |
| |||
91 | 155 | | |
92 | 156 | | |
93 | 157 | | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
94 | 163 | | |
95 | 164 | | |
96 | 165 | | |
| |||
132 | 201 | | |
133 | 202 | | |
134 | 203 | | |
| 204 | + | |
135 | 205 | | |
| 206 | + | |
| 207 | + | |
136 | 208 | | |
137 | 209 | | |
138 | 210 | | |
139 | 211 | | |
140 | 212 | | |
| 213 | + | |
141 | 214 | | |
142 | 215 | | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
143 | 263 | | |
144 | 264 | | |
145 | 265 | | |
| |||
193 | 313 | | |
194 | 314 | | |
195 | 315 | | |
196 | | - | |
197 | 316 | | |
198 | 317 | | |
199 | 318 | | |
| |||
207 | 326 | | |
208 | 327 | | |
209 | 328 | | |
210 | | - | |
| 329 | + | |
211 | 330 | | |
212 | 331 | | |
213 | 332 | | |
214 | 333 | | |
215 | | - | |
216 | | - | |
| 334 | + | |
217 | 335 | | |
218 | 336 | | |
219 | 337 | | |
| |||
0 commit comments