Skip to content

[Fix] Skip cross-node probe in MultimemAllGatherer on single-node runs (fixes mooncake EP segfault) - #30139

Merged
ch-wan merged 1 commit into
mainfrom
fix/multimem-ag-skip-node-probe-single-node
Jul 4, 2026
Merged

ch-wan merged 1 commit into
mainfrom
fix/multimem-ag-skip-node-probe-single-node

Conversation

@ch-wan

@ch-wan ch-wan commented Jul 4, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

test/registered/ep/test_mooncake_ep_small.py crashes the server at startup with a segmentation fault in today's scheduled run:

Current thread (most recent call first):
  File ".../torch/distributed/distributed_c10d.py", line 3068 in all_reduce
  ...
  File ".../srt/distributed/parallel_state.py", line 2681 in in_the_same_node_as
  File ".../srt/distributed/device_communicators/triton_symm_mem_ag.py", line 472 in __init__
  File ".../srt/layers/logits_processor.py", line 297 in __init__

→ Server process exited with code 1 → FAILED (errors=1, skipped=6).

Root cause

PR #29881 ("Avoid logits multimem all-gather on cross-node TP groups") added an in_the_same_node_as(tp_group.cpu_group, source_rank=0) probe to MultimemAllGatherer.__init__. That probe runs a gloo all_reduce during logits-processor construction, and it segfaults under the mooncake EP + DP-attention config (tp4 / dp2 / ep4, DeepEP, nnodes=1).

Timeline for this test: it last passed on 0702_23; broke on 0703 with the router NaN crash (#29771, fixed by #30079); and now fails on 0704 with this segfault from #29881. Both fixes are needed for it to go green — #30079 is already merged, this PR is the second half.

Fix

On a single-node deployment every TP rank is trivially co-located, so the cross-node probe is unnecessary. Gate it on nnodes > 1:

This unblocks CI and sidesteps the deeper question of why that gloo all_reduce segfaults under mooncake/DeepEP (worth a follow-up with the #29881 author). Needs a 4-GPU mooncake-EP run to confirm green (I can't run that locally).

🤖 Generated with Claude Code


CI States

Latest PR Test (Base): 🚫 Run #28721778107
Latest PR Test (Extra): ❌ Run #28721778022

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@ch-wan

ch-wan commented Jul 4, 2026

Copy link
Copy Markdown
Collaborator Author

/rerun-test test_mooncake_ep_small.py

@github-actions

github-actions Bot commented Jul 4, 2026 •

Copy link
Copy Markdown
Contributor

Results for /rerun-test test_mooncake_ep_small.py:

🚀 4-gpu-h100 (1 test): ❌ View workflow run

cd test/ && python3 registered/ep/test_mooncake_ep_small.py

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5ec8e2f401

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

# in_the_same_node_as() all-reduce, which can segfault under some
# EP/mooncake setups, and keep multimem enabled.
if (
get_global_server_args().nnodes > 1

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Avoid adding a legacy server-args accessor

This new get_global_server_args() call grows the ratcheted legacy accessor count in python/sglang/srt from 346 to 347, so test/registered/unit/test_legacy_global_ratchet.py will fail with “New code must use the sglang.srt.runtime_context accessors”. Use sglang.srt.runtime_context.get_server_args() here instead of adding another legacy call-site.

Useful? React with 👍 / 👎.

@ch-wan
ch-wan force-pushed the fix/multimem-ag-skip-node-probe-single-node branch from 5ec8e2f to f84b15d Compare July 4, 2026 22:26
@ch-wan

ch-wan commented Jul 4, 2026

Copy link
Copy Markdown
Collaborator Author

/rerun-test test_mooncake_ep_small.py

@ch-wan

ch-wan commented Jul 4, 2026

Copy link
Copy Markdown
Collaborator Author

/tag-and-rerun-ci

@github-actions

github-actions Bot commented Jul 4, 2026 •

Copy link
Copy Markdown
Contributor

Results for /rerun-test test_mooncake_ep_small.py:

🚀 4-gpu-h100 (1 test): ✅ View workflow run

cd test/ && python3 registered/ep/test_mooncake_ep_small.py

@github-actions github-actions Bot added the run-ci CI: run the baseline test suite on this PR label Jul 4, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f84b15dd42

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

PR #29881 added an in_the_same_node_as(tp_group.cpu_group) probe to
MultimemAllGatherer.__init__ to disable the logits multimem all-gather on
cross-node TP groups. That probe does a gloo all_reduce during logits-processor
construction, which segfaults under the mooncake EP + DP-attention config
(tp4/dp2/ep4, DeepEP, single node), crashing the server at startup
(test/registered/ep/test_mooncake_ep_small.py, scheduled full run).

On a single-node deployment every TP rank is trivially co-located, so the probe
is unnecessary. Gate it on nnodes > 1: single-node runs skip the fragile
all_reduce and keep multimem enabled (pre-#29881 behavior), while genuine
multi-node deployments still get #29881's cross-node guard.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@ch-wan
ch-wan force-pushed the fix/multimem-ag-skip-node-probe-single-node branch from f84b15d to e2bdfb2 Compare July 4, 2026 22:32
@ch-wan
ch-wan merged commit 754524d into main Jul 4, 2026
56 of 83 checks passed
@ch-wan
ch-wan deleted the fix/multimem-ag-skip-node-probe-single-node branch July 4, 2026 22:36
@ch-wan
ch-wan restored the fix/multimem-ag-skip-node-probe-single-node branch July 5, 2026 10:06
Chronostasys pushed a commit to MindLab-Research/sglang that referenced this pull request Aug 24, 2026
@Jiminator
Jiminator deleted the fix/multimem-ag-skip-node-probe-single-node branch September 14, 2026 04:42
@alexnails
alexnails restored the fix/multimem-ag-skip-node-probe-single-node branch September 14, 2026 05:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

run-ci CI: run the baseline test suite on this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant