Skip to content

multinode: ATOM backend and atomesh router (provided + generated P/D) - #650

Open
zhaoan12-prc wants to merge 4 commits into
AMD-AGI:mainfrom
zhaoan12-prc:atom-multinode
Open

zhaoan12-prc wants to merge 4 commits into
AMD-AGI:mainfrom
zhaoan12-prc:atom-multinode

Conversation

@zhaoan12-prc

Copy link
Copy Markdown
Contributor

Summary

Adds the ATOM backend to the multinode serving path that #530 introduced. ATOM P/D engines behind the atomesh router now run through the existing multinode lifecycle (check → launch → supervise → profile → teardown) in both provided and generated modes. The multinode phases and control flow are unchanged; single-node behaviour is unchanged.

Before this PR the multinode path accepted only sglang / vLLM engines and the sglang router: an ATOM launch_command was refused by engine_facts, atomesh was never started, and ATOM's multinode traces were not found.

Split out of #648 (now draft). The AgentX side of the ATOM work is in the follow-up PR, which builds on this one.

What changes

  • Recognise and manage ATOM / atomesh (mn.py)
    • Reads an ATOM engine command: model, TP, P/D role from --kv-transfer-config, and the HTTP port from --server-port (--port is the engine's internal port).
    • Reconciles the atomesh router's --prefill / --decode URLs with the engines, like the sglang router.
    • Teardown, health and the stack check know atomesh launch, ATOM:: engine children and the atom package.
  • Both launch modes
    • Provided: Hyperloom's per-pod commands run as given.
    • Generated (adapters/atom.sh): renders each role's Mooncake --kv-transfer-config and starts atomesh launch --pd-disaggregation, as in ATOM's pd_disaggregation_guide.md.
  • Multinode profiling and the trace gate (multinode.sh, mn_traces.py)
    • Each role gets its own profile dir; /start_profile is sent without a body; both engines are stopped at once; the window is capped at ATOM_PROFILE_WINDOW_MAX_SEC (default 6 s, as on one node).
    • Traces are found under rank_<N>/ and the rank is read from the directory.
    • Provided and generated launches profile the same way: shapes on, Python stacks and memory off.
  • Docs: the ATOM notes are folded into the existing sections of docs/multi_node.md.

Testing

  • Unit tests: test_mn.py and interface/test_run_e2e_multinode.py pass, including real launcher shell against fake HTTP engines for the profile window.
  • GPU: 2× MI308X (gfx942), ATOM prefill TP8 + decode TP8, atomesh router, Mooncake RDMA.
    • DeepSeek-R1-0528, fixed-length (ISL/OSL 1024/1024, conc 128, 1280 prompts), full GEAK e2e run, Director validated_win:

      metric baseline final Δ
      output throughput 2765.0 tok/s 2904.2 tok/s +5.03%
      total token throughput 5530.9 tok/s 5809.3 tok/s +5.03%
      TPOT p50 44.82 ms 42.55 ms −5.1%

      Accuracy: gsm8k 5-shot 0.9538 (reference 0.9553 ± 0.02).

    • The two AgentX workloads in the follow-up PR also run on this multinode path.

Known limitations

  • Provided mode has not run on real hardware yet: Hyperloom's multinode is not ready. It is covered by unit tests and CPU simulation; a hardware run follows once Hyperloom is.

zhaoan12-prc and others added 4 commits November 25, 2026 04:04
A Hyperloom node_state.json with backend=atom was refused at the first
check (engine_facts knew only sglang and vllm), and an ATOM P/D pair
could not have been profiled or torn down. This lets the DeepSeek-R1 1P1D
case in ATOM's own pd_disaggregation_guide.md (two nodes, TP8/TP8,
Mooncake, atomesh in front) go through the provided-mode path.

Recognising ATOM:
- engine_facts: an ATOM command's HTTP port is --server-port (8000 when
  absent); --port is the engine's internal port and never the HTTP port.
  The PD role is read from --kv-transfer-config like vllm's.
- structural flags the command owns now include --server-port and --port.
- teardown and health: atom.entrypoints.openai_server, the ATOM::<name>
  process titles ATOM gives its engine children (setproctitle), and
  `atomesh launch`; a defunct ATOM:: child counts as a dead engine.
- SW_PACKAGES: ranks must agree on the atom version.
- replicas of one role may differ in their HTTP port.

Profiling ATOM engines:
- ATOM writes <dir>/rank_<N>/<name>.pt.trace.json.gz (dp<D>_tp<N> under
  DP) and names no rank in the file, so the gate reads the rank from the
  directory and looks one level down.
- /start_profile takes no body: its directory is fixed at launch. Under
  PD each role gets <profile>/<role>/ at launch (both engines would
  otherwise write rank_0/ into one directory); the wait for the traces
  looks one directory deeper. ATOM_PROFILER_MORE=1 under PROFILE=1.

generated mode (adapters/atom.sh dist/pd hooks) is not added: Hyperloom
hands over provided commands.

Tests: AtomProvidedSpecTest, AtomDeepseekR1CaseTest (the guide's commands, at the mn and
node_state levels), AtomTraceLayoutTest, AtomProfileDirTest, AtomProfileLaunchTest, and
PdProfileWindowTest, which runs multinode.sh's real pd_disagg profile window against two fake
engines (ATOM: no request body, traces found one directory down, gate passes; sglang: unchanged;
an engine launched without a profiler is named). All of them fail on the previous code except the
sglang and the rejected-window cases, which guard the existing behaviour.
adapters/atom.sh gains adapter_pd_mode / adapter_pd_args / adapter_pd_lb_launch, so a
pd_disagg launch with no launch_command renders ATOM engines (Mooncake kv-transfer-config
with the node's own IP as proxy_ip, the pd bootstrap port as handshake_port) and an
`atomesh launch --pd-disaggregation` router, with the flags of ATOM's
pd_disaggregation_guide.md. tp_span stays refused: ATOM's server has no --nnodes.

mn.py exports GEAK_NODE_IP in the rank head and gives the generated rank its per-role
profile dir, as the provided path already does.
adapters/atom.sh asks ATOM's profiler for shapes without Python stacks or
memory, the same env mn.py sets on a provided launch, so both modes write the
same traces. Drops two assertions on patterns main no longer has.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The standalone "ATOM engines and the atomesh router" section is split into the
sections that already cover each topic for sglang and vLLM: how a backend runs
on several nodes, what check reads from a launch command, the version check,
the environment reference and the trace gate. Docs only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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.

1 participant