Repository navigation
[ATOM gRPC] The Session's step delivery: Completions without ids, atomesh's Session on its own thread (14/14) - #3671
Closed
Jasen2201 wants to merge 1 commit into
Conversation
…mesh's Session on its own thread (14/14) ATOM's Session sends each Completions item without the request's ids, which its StreamBatch entries already carried. At DP4 and 1,024 concurrent requests, ranks that finish 14 or 15 requests together resent about 1 MB of ids at once on the Session's one HTTP/2 stream, and every later step queued behind it. atomesh builds a non-streaming request's output from its StreamBatch entries, and each atomesh Session runs on a connection, thread and runtime of its own. 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 14/14 of the stack proposed in #3657. No blocking issues.
Why
Each Completions item resent all of its request's ids, which its StreamBatch entries had already carried. At DP4 and 1,024 concurrent requests, ranks finishing 14 or 15 requests together put about 1 MB on the Session's one HTTP/2 stream at once, and every later step queued behind it.
What changed
session.py).Routes::step).session.rsrun), off the router's runtime.Review focus
Session.flush: the client id read back from the engine's id, and the Completions item it builds.Testing
A non-streaming request over the Session completes with the ids its entries carried, and relay, chunked and a reopened Session complete as before. Measured on CPU instances with a stub model runner, the step lag p99 at 1,024 concurrent requests fell from 2.6 to 1.2 ms at DP1 and from 42 to 5.4 ms at DP4.
jasen/atom-grpc-14-session-step-delivery@ fb4f090: withatom-engine, 1413 lib and 303 integration tests passed;tests/entrypointsand the stack's Python tests, 3,390 passed. ruff, black, 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 fb4f090:Clippy against main cccc96a (warnings matched by message and file):
Against the PR below (part 13):
Python, at fb4f090: ruff check and black --check (26.10.1) on the 2 changed .py files, clean;
pytest tests/entrypoints tests/test_grpc_proto.py tests/test_token_prefix_chains.py tests/test_engine_core_idle_wait.py tests/test_ci_latency_reports.py: 3,390 passed, 100 skipped, 0 failed.The full CPU suite on this Python code against main cccc96a, on a host at load average 50 to 70: 14,947 passed and 13 failed, against main's 14,936 and 10.
The integration branch's end-to-end tests, not part of this stack, ran against the same code on CPU instances with a stub model runner, with atomesh built from it (single, P/D relay and chunked, DP P/D, 22 DP ranks, structured output, stops, refusals, Session): 290 passed and 2 failed. One is a timing case that reads an atomesh debug event this stack does not carry; the other, a P/D client-cancel case, passed 4 of 4 on a rerun.
🤖 Generated with Claude Code