Commit 48e459b
committed
Add MoRI conn.py overlay for sglang v0.5.12.post1 PD-disaggregation
sglang v0.5.12.post1 ships an unmigrated MoRI backend (legacy singular
`state_type` + flat-int wire format) that crashes hybrid-attention
models at PD-disagg startup. Concretely, three sites in
disaggregation/mori/conn.py break for any model whose state_pool is
populated as `state_item_lens: List[List[int]]` (Qwen3.5-MoE,
GLM-5, anything using state_types: List[StateType]):
1. _register_kv_args raises `struct.error: required argument is not
an integer` because it packs state_item_lens with naked
struct.pack("I", item_len), expecting the legacy `List[int]`.
2. send_state raises `state_type is 'none' but state_indices were
provided` because it reads the legacy `kv_args.state_type`
(singular), which the framework no longer populates for these
models. The plural `kv_args.state_types: List[StateType]` -- the
attribute Mooncake (mooncake/conn.py:912) and NIXL
(nixl/conn.py:1381) already use -- is set correctly.
3. The downstream length check at L935 and per-tensor indexing at
L1005/1014/1096 assume flat-int `state_item_lens[i]`, so the
run fails with `local state_item_lens count (1) does not match
state descriptor count (90)` once registration is unblocked.
This commit carries an in-tree overlay of mori/conn.py with three
conservative fixes (flatten on the sender, state_types[0] fallback in
send_state, normalize state_item_lens once at send_state entry). The
overlay is bind-mounted into the container via job.slurm's existing
docker invocation, gated on the affected image tag and an opt-out
env var:
- benchmarks/multi_node/amd_utils/patches/mori_conn.py (new)
- benchmarks/multi_node/amd_utils/patches/README.md (new)
- benchmarks/multi_node/amd_utils/job.slurm (+1 hook,
+1 auto-apply block; both no-op when DOCKER_IMAGE_NAME doesn't
contain "v0.5.12.post1" or MORI_CONN_PATCH=skip is set)
Validated end-to-end on lmsysorg/sglang-rocm:v0.5.12.post1-rocm720-
mi35x-20260523 with Qwen3.5-397B-A17B-FP8 1P+1D TP=8 dp-attn=false:
gsm8k strict-match exact_match: 0.9780 +/- 0.004 PASS
gsm8k flexible-extract exact_match: 0.9780 +/- 0.004 PASS
(Matches and slightly exceeds the 0.970 GSM8K reported by upstream
PR sgl-project/sglang#22665, which introduced state-transfer for
hybrid models but kept MoRI on the legacy singular API.)
The proper upstream fix is to migrate MoRI to the plural state_types
API that Mooncake and NIXL already use; full diff is in
scripts/sglang_disagg/docs/03-upstream-pr-proposal.md (out-of-tree
to keep this PR lean). Tracks sgl-project/sglang#21886.1 parent 9b1260a commit 48e459b
3 files changed
Lines changed: 1735 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 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 | + | |
55 | 81 | | |
56 | 82 | | |
57 | 83 | | |
| |||
387 | 413 | | |
388 | 414 | | |
389 | 415 | | |
| 416 | + | |
390 | 417 | | |
391 | 418 | | |
392 | 419 | | |
| |||
| 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 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 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 | + | |
0 commit comments