Repository navigation
Conversation
A pair of ATOM gRPC workers goes to `AtomPairs` (`engine/atom/pair.rs`), which keeps ATOM's HTTP P/D flow. Relay runs P with streaming off and max_tokens 1, releases P's load when P completes, and sends D the enriched kv_transfer_params; chunked starts P and D together and returns D's stream only after P completes, a failure on either side cancelling the other. P's transfer info comes from GetServerInfo through the shared `parse_atom_prefill_info`, P is picked by the shared rank mapping, and `Dispatcher::holds_load` keeps the pipeline from taking a second pair. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 21, 2026
Closed
Closed
Collaborator
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part 9/14 of the stack proposed in #3657. No blocking issues.
Why
atomesh's gRPC P/D router sent every pair through SGLang's dual dispatch: an ATOM P and D each got a plain Generate at once, with no kv_transfer_params, so D could not receive P's KV.
What changed
sequenceDiagram participant R as GrpcPDRouter participant A as AtomPairs (new) participant P as ATOM P participant D as ATOM D R->>A: dispatch, a newly planned pair per attempt Note over A: rank mapping, both loads taken, AtomAdapter alt relay A->>P: Generate, stream off, max_tokens 1 P-->>A: Complete with kv_transfer_params A->>D: Generate with the enriched params else chunked A->>P: Generate A->>D: Generate with P's template params Note over A: D's stream returned once P completes end A-->>R: D's stream, holding D's loadGrpcEngine::dispatchhands a pair of ATOM workers toAtomPairs(engine/atom/pair.rs), which keeps ATOM's HTTP P/D flow; SGLang and vLLM pairs keep the dual dispatch.AtomPairsrunsAtomAdapterunchanged on a JSON view, releases P's load when P completes, and in chunked mode cancels either side when the other fails.GrpcPDRouter::newreads each ATOM P's transfer info from GetServerInfo throughparse_atom_prefill_info; P is picked by the shared rank mapping.Dispatcher::holds_loadkeeps the pipeline from taking a second pair of loads.Review focus
Where the loads live, and the status each failure answers.
Testing
Against in-process ATOM stubs, relay sends D once P completes with its params enriched, and chunked sends both at once and answers once P completes. A failure on either side ends or cancels the other as over HTTP, each retry plans a new pair, and idx2idx runs P on D's rank.
jasen/atom-grpc-09-mesh-pd-pair@ 79214f3: withatom-engine, 1388 lib and 303 integration tests passed. cargo fmt clean; clippy adds no warning of this PR's code.Follow-ups
none
Stack
ATOM serves
atom.grpc.v1.AtomEnginebeside its HTTP server (token ids in, token ids out, ATOM's P/D flow unchanged), and atomesh routes to ATOM gRPC workers, over a Generate call per request or one Session per instance. Bottom to top:1 and 2 stand alone; 6 to 13 need only part 3 of the Python side; 14 changes both sides of the Session.
Evidence
In
atom/mesh(rustc and clippy 1.100.0), at 79214f3:Clippy against main cccc96a (warnings matched by message and file):
Against the PR below (part 8):
🤖 Generated with Claude Code