Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
fbbe59a
[ATOM gRPC] atomesh: an ATOM gRPC client, ATOM's protos in every buil…
Jasen2201 Nov 21, 2026
1379dc9
Merge the Generate review fixes (#3673) into the atomesh client
Jasen2201 Nov 22, 2026
c3a54e9
Merge Abort before submission (#3673) into the atomesh client
Jasen2201 Nov 22, 2026
7bc98d7
Merge the chat-template and top_logprobs review fixes (#3673) into th…
Jasen2201 Nov 22, 2026
0789648
[ATOM gRPC] atomesh: stops go only as token ids; say why a stop strin…
Jasen2201 Nov 22, 2026
32e3370
Merge the step-flush ordering fix (#3673) into the atomesh client
Jasen2201 Nov 22, 2026
72808a8
Merge B's gRPC shutdown, receive-limit and stream fixes (#3673) into …
Jasen2201 Nov 22, 2026
b401205
Merge B's gRPC stop race fix (#3673) into the atomesh client
Jasen2201 Nov 23, 2026
4aa43b1
Merge the Session RPC (#3674) into the atomesh client
Jasen2201 Nov 23, 2026
32704f8
Merge the Session RPC (#3674) into the atomesh client
Jasen2201 Nov 23, 2026
0fb4c64
tests: the stub AtomEngine leaves GetServerInfo's newer fields at the…
Jasen2201 Nov 23, 2026
e2f574e
Merge the Session RPC (#3674) into the atomesh client
Jasen2201 Nov 23, 2026
4c5f86d
Merge the Session RPC (#3674) into the atomesh client
Jasen2201 Nov 23, 2026
c2aab0a
Merge main into the atomesh client
Jasen2201 Nov 23, 2026
9e6c2bd
Merge the Session RPC into the atomesh client
Jasen2201 Nov 23, 2026
9466522
atomesh: build with the new atom.grpc.v1 request and complete fields
Jasen2201 Nov 23, 2026
4f3594b
atomesh: send the DP session headers to ATOM in GenerateRequest
Jasen2201 Nov 23, 2026
277ceb9
atomesh: carry an ATOM Complete's timing in WorkerMeta
Jasen2201 Nov 23, 2026
27bd641
atomesh: read every sibling's Complete from an unstreamed ATOM call
Jasen2201 Nov 23, 2026
f6ed2de
atomesh: refuse a logprobs request to an ATOM worker with 400
Jasen2201 Nov 23, 2026
5f6baee
atomesh: send explicit stop_token_ids to ATOM as one-id stop sequences
Jasen2201 Nov 23, 2026
c27acaf
atomesh: measure an ATOM stream's TTFT from the start of its call
Jasen2201 Nov 23, 2026
7ef98d8
atomesh: measure an unstreamed ATOM call's e2e_latency from its start
Jasen2201 Nov 23, 2026
6ae7d23
atomesh: carry the SourceClock through the P/D stream merger
Jasen2201 Nov 23, 2026
e067d3b
Merge the Session RPC into the atomesh client
Jasen2201 Nov 23, 2026
4a601ea
Test that an ATOM worker's usage_on_finish becomes its label
Jasen2201 Nov 23, 2026
0c6bc63
Merge the Session RPC into the atomesh client
Jasen2201 Nov 23, 2026
564bf66
Merge the Session RPC into the atomesh client
Jasen2201 Nov 23, 2026
ec63bee
Merge the Session RPC into the atomesh client
Jasen2201 Nov 23, 2026
c6b4581
Merge the Session RPC's headers and admission fixes into the atomesh …
Jasen2201 Nov 23, 2026
dcc6d13
Give the atomesh ATOM client's new files the full source header
Jasen2201 Nov 23, 2026
c8ba127
Merge the Session RPC's admission and callback fixes into the atomesh…
Jasen2201 Nov 23, 2026
0910af3
Merge the Session RPC's closed-session admission fix into the atomesh…
Jasen2201 Nov 23, 2026
cd56ba7
Merge the Session RPC's admission-cap fix into the atomesh client
Jasen2201 Nov 23, 2026
c6d53ea
atomesh: a P/D leg that fails cancels the other at once
Jasen2201 Nov 23, 2026
2e6c455
Merge the Session RPC's waiting-bound fix into the atomesh client
Jasen2201 Nov 23, 2026
8018462
atomesh: the leg-refusal test refuses once both calls are open
Jasen2201 Nov 23, 2026
c281b03
Merge the Session RPC's seq_id-reuse fix into the atomesh client
Jasen2201 Nov 24, 2026
e6e0789
Merge the Session RPC's greedy-n fix into the atomesh client
Jasen2201 Nov 24, 2026
3943353
Merge the Session RPC's seq_id-race fixes into the atomesh client
Jasen2201 Nov 24, 2026
688fcac
Merge the Session RPC's structured-stops refusal into the atomesh client
Jasen2201 Nov 24, 2026
acad716
Merge the Session RPC's delivery-time stamping into the atomesh client
Jasen2201 Nov 24, 2026
0726f43
Merge the Session RPC's arrival-on-read stamping into the atomesh client
Jasen2201 Nov 24, 2026
cea0fa9
atomesh: the ATOM client reads replies past 4 MiB
Jasen2201 Nov 24, 2026
2159bdb
Merge the Session RPC's prompt teardown and merge of main into the at…
Jasen2201 Nov 24, 2026
d1a42ed
Merge the Session RPC's double-cancel settlement and close-first tear…
Jasen2201 Nov 24, 2026
3eb4c8a
Merge the Session RPC's merge of main into the atomesh client
Jasen2201 Nov 24, 2026
7fea371
Merge the engine's skip of a turned-off prefix chain store into the a…
Jasen2201 Nov 26, 2026
2c9eabd
Merge main into the atomesh client
Jasen2201 Nov 27, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions .github/scripts/atomesh/build_mesh.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,19 @@ esac
source_commit="${ATOMESH_MESH_SOURCE_COMMIT:-$(git -C "${source_dir}" rev-parse HEAD)}"

# The checkout is mounted read-only. Cargo may need to create a lockfile.
python3 - "${source_dir}" "${build_dir}/source" <<'PY'
# build.rs reads ATOM's protos at their paths from the repository root, two levels up.
mesh_copy="${build_dir}/source/atom/mesh"
python3 - "${source_dir}" "${mesh_copy}" <<'PY'
import shutil
import sys
from pathlib import Path

shutil.copytree(sys.argv[1], sys.argv[2], ignore=shutil.ignore_patterns("target", ".git"))
mesh, copy = Path(sys.argv[1]).resolve(), Path(sys.argv[2])
shutil.copytree(mesh, copy, ignore=shutil.ignore_patterns("target", ".git"))
for proto in ("atom/model_engine/zmq_protocol/engine_v1.proto", "atom/entrypoints/grpc/atom_grpc.proto"):
if (mesh.parents[1] / proto).is_file():
(copy.parents[1] / proto).parent.mkdir(parents=True, exist_ok=True)
shutil.copy2(mesh.parents[1] / proto, copy.parents[1] / proto)
PY

target_dir="${ATOMESH_MESH_TARGET_DIR:-${TMPDIR:-/tmp}/atomesh-mesh-cache-$(id -u)}"
Expand Down Expand Up @@ -48,13 +56,13 @@ if ! cargo --version >/dev/null 2>&1; then
fi
fi
lock_args=()
if [[ -f "${build_dir}/source/Cargo.lock" ]]; then
if [[ -f "${mesh_copy}/Cargo.lock" ]]; then
lock_args+=(--locked)
fi
run_cargo_build() {
cargo build --profile "${profile}" --bin atomesh \
"${lock_args[@]}" \
--manifest-path "${build_dir}/source/Cargo.toml" \
--manifest-path "${mesh_copy}/Cargo.toml" \
--target-dir "${target_dir}" > "${log_dir}/mesh-build.log" 2>&1
}
echo "[build] Mesh commit=${source_commit} profile=${profile}" >&2
Expand All @@ -75,7 +83,7 @@ if ! run_cargo_build; then
exit 1
fi
fi
cp "${build_dir}/source/Cargo.lock" "${log_dir}/mesh-Cargo.lock"
cp "${mesh_copy}/Cargo.lock" "${log_dir}/mesh-Cargo.lock"
cp "${target_dir}/${profile}/atomesh" "${log_dir}/atomesh"
python3 - "${log_dir}" "${source_commit}" "${profile}" <<'PY'
import hashlib
Expand Down
4 changes: 3 additions & 1 deletion .github/scripts/atomesh/setup_mesh.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ if [[ ! -x "${artifact_dir}/atomesh" || ! -f "${artifact_dir}/mesh-build.json" ]
mkdir -p "${artifact_dir}" "${cache_dir}"
source_commit="$(git -C "${repo_root}" rev-parse HEAD)"
source_dirty=false
if [[ -n "$(git -C "${repo_root}" status --porcelain -- atom/mesh)" ]]; then
# The mesh and the ATOM protos its build.rs compiles.
mesh_sources=(atom/mesh atom/model_engine/zmq_protocol/engine_v1.proto atom/entrypoints/grpc/atom_grpc.proto)
if [[ -n "$(git -C "${repo_root}" status --porcelain -- "${mesh_sources[@]}")" ]]; then
source_dirty=true
fi
echo "[setup] Building Mesh before launching services" >&2
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/atomesh-mocker-benchmark.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ on:
branches: [main]
paths:
- 'atom/mesh/**'
- 'atom/model_engine/zmq_protocol/**' # engine_v1.proto, built by --features atom-engine
- 'atom/model_engine/zmq_protocol/**' # engine_v1.proto, compiled by atom/mesh/build.rs
- 'atom/entrypoints/grpc/atom_grpc.proto' # compiled by atom/mesh/build.rs too
- '.github/scripts/atomesh/atomesh_mocker_benchmark.sh'
- '.github/scripts/atomesh/atomesh_mocker_benchmark_summary.py'
- '.github/workflows/atomesh-mocker-benchmark.yaml'
Expand Down Expand Up @@ -63,6 +64,7 @@ jobs:
PATHS_INCLUDE: |
atom/mesh/**
atom/model_engine/zmq_protocol/**
atom/entrypoints/grpc/atom_grpc.proto
.github/scripts/atomesh/atomesh_mocker_benchmark.sh
.github/scripts/atomesh/atomesh_mocker_benchmark_summary.py
.github/workflows/atomesh-mocker-benchmark.yaml
Expand Down
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ include atom/mesh/Cargo.lock
include atom/mesh/build.rs
recursive-include atom/mesh/src *
include atom/model_engine/zmq_protocol/engine_v1.proto
include atom/entrypoints/grpc/atom_grpc.proto
5 changes: 3 additions & 2 deletions atom/mesh/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ edition = "2021"

[features]
default = ["grpc-client"]
grpc-client = []
# ATOM's protos (src/atom_engine): engine_v1, and atom.grpc.v1's client and server.
grpc-client = ["dep:tonic-prost", "dep:tonic-prost-build", "dep:protox"]
ext-proc = ["dep:prost-types", "dep:tonic-prost", "dep:tonic-prost-build", "dep:protox", "tonic/tls-ring"]
# The Rust client of the EngineCores (src/atom_engine), off until a caller exists.
atom-engine = ["dep:zmq", "dep:tonic-prost-build", "dep:protox"]
atom-engine = ["grpc-client", "dep:zmq"]

[lints.rust]
unused_qualifications = "warn"
Expand Down
23 changes: 18 additions & 5 deletions atom/mesh/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,29 @@ macro_rules! set_env {
fn main() -> Result<(), Box<dyn std::error::Error>> {
// This crate's .protos are compiled by protox, but the smg-grpc-client
// dependency's build script still runs protoc, so builds need it.
#[cfg(feature = "atom-engine")]
#[cfg(feature = "grpc-client")]
{
// The EngineCore's wire protocol, kept beside the EngineCore.
const ENGINE_PROTO_DIR: &str = "../model_engine/zmq_protocol";
let engine_proto = protox::compile(["engine_v1.proto"], [ENGINE_PROTO_DIR])?;
// ATOM's protos at their repository paths, by which atom_grpc.proto imports
// engine_v1.proto; its engine_v1 fields take atom_engine::wire::pb's types.
const REPO_ROOT: &str = "../..";
const ENGINE_PROTO: &str = "atom/model_engine/zmq_protocol/engine_v1.proto";
const GRPC_PROTO: &str = "atom/entrypoints/grpc/atom_grpc.proto";
let engine_proto = protox::compile([ENGINE_PROTO], [REPO_ROOT])?;
tonic_prost_build::configure()
.build_client(false)
.build_server(false)
.compile_fds(engine_proto)?;
println!("cargo:rerun-if-changed={ENGINE_PROTO_DIR}");
let grpc_proto = protox::compile([GRPC_PROTO], [REPO_ROOT])?;
tonic_prost_build::configure()
.extern_path(".atom.engine.v1", "crate::atom_engine::wire::pb")
.type_attribute(
".atom.grpc.v1.GetModelInfoResponse",
"#[derive(serde::Serialize)]",
)
.compile_fds(grpc_proto)?;
for proto in [ENGINE_PROTO, GRPC_PROTO] {
println!("cargo:rerun-if-changed={REPO_ROOT}/{proto}");
}
}
#[cfg(feature = "ext-proc")]
{
Expand Down
16 changes: 11 additions & 5 deletions atom/mesh/src/atom_engine/mod.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
//! The ATOM engine runtime: Rust as the one client of every EngineCore.
//!
//! Python spawns the Cores and hands over an `EngineSpec`; Rust then drives
//! them over the engine_v1 protocol. `spec` is that hand-over, `wire` is the
//! protocol's encoding, `link` is one Core's sockets. Nothing here knows HTTP.
//! ATOM's protocols: `wire` (engine_v1) and `grpc` (atom.grpc.v1). Under
//! `atom-engine`, Rust drives EngineCores: `spec` is the launch hand-over, `link` one Core.

/// ATOM's gRPC service, `AtomEngine`: its messages, client and server.
#[allow(clippy::all, unused_qualifications)]
pub mod grpc {
include!(concat!(env!("OUT_DIR"), "/atom.grpc.v1.rs"));
}
#[cfg(feature = "atom-engine")]
pub mod link;
#[cfg(feature = "atom-engine")]
pub mod spec;
#[cfg(test)]
mod tests;
pub mod wire;

#[cfg(feature = "atom-engine")]
pub use link::{CoreLink, Interrupted};
#[cfg(feature = "atom-engine")]
pub use spec::{CoreSpec, EngineSpec};
Loading
Loading