Repository navigation
fix(router): direct-dispatch migration, decode-first engagement, embedded selection default, EPP runtime-mode deprecation - #30
Conversation
A decode engine that dies mid-stream surfaces to tonic as Unknown/Internal with h2 transport text. status_to_dynamo mapped that to Backend(Unknown), which the migration layer treats as fatal, so the request failed with a 500 instead of moving to another worker. Map mid-stream transport failures to Backend(Disconnected), report a stream that ends without a terminal response as Backend(StreamIncomplete), and include Backend(Disconnected) and Backend(CannotConnect) in the migratable set (direct engines report connection loss under the backend taxonomy). Validated on a zero-infra disaggregated deployment (file discovery, TCP, ZMQ, embedded selection, direct dispatch; one prefill and two decode sidecars over mock vLLM gRPC engines): killing a decode engine and its sidecar mid-stream now logs a migration retry (reason backend_disconnected, 22 tokens completed) and both 400-token streams finish; before the change the stream on the killed worker ended in an error chunk. Signed-off-by: Ishan Dhanani <[email protected]>
The decode RoutingHost was only handed to PrefillRouter when conditional disaggregation was on, so --router-disagg-decode-first silently fell back to the prefill-first path (plan_decode_first saw no decode host). Install it whenever either feature needs it. Signed-off-by: Ishan Dhanani <[email protected]>
DYN_EPP_MODE=dynamo now logs a deprecation warning at startup; the standalone EPP covers aggregated and disaggregated routing without a Dynamo runtime. Runtime mode remains available for this release. Signed-off-by: Ishan Dhanani <[email protected]>
|
Decode-first confirmation (same zero-infra disagg deployment, |
|
Offline KV replay byte-parity, stack tip (this PR's head) vs baseline
This covers the runtime-free |
KvWorkerMonitor's prefill-token overload detection reads the scheduler's own load snapshots through SchedulerLoadSender. The embedded selection partition never published them, so --active-prefill-tokens-threshold could not trigger 529 under --router-embedded-selection (tests/router test_mocker_kv_router_overload_529[prefill-tokens] failed only on that path; decode-blocks worked because it uses worker-published metrics). Add SelectionHostHooks.scheduler_load_sink (a SchedulerLoadSink) that the partition's ScopedSequencePublisher forwards publish_scheduler_load(_batch) into; the embedded host bridges it to the router's SchedulerLoadSender. tests/router overload_529 (agg + disagg, prefill-tokens + decode-blocks) now pass on the embedded path. Signed-off-by: Ishan Dhanani <[email protected]>
|
Router e2e (Phase 1 exit gate "tests/router e2e green on both paths"):
The 3 failures are identical on both paths and environmental: Before c1aa868 the embedded path also failed |
c1aa868 to
beb6ddc
Compare
Phase 1 exit gates now pass: the frontend A/B benchmark (+6% req/s, lower p50/p99), offline KV replay byte-parity against main on four rows, and tests/router e2e green on both scheduler paths. Flip router_embedded_selection to default true (serde default/skip updated, PyO3 constructor, .pyi, --router-embedded-selection default, docs). The runtime-bound KvScheduler path stays reachable through --no-router-embedded-selection for one release as a rollback and logs a deprecation warning at startup; deleting it is the follow-up. A caller-injected custom WorkerSelector type (not DefaultWorkerSelector) cannot run on the partition, so KvRouter::new keeps the runtime scheduler for it with a warning instead of silently changing selection semantics. Signed-off-by: Ishan Dhanani <[email protected]>
|
Added (Phase 1 "then delete the old wiring"): embedded selection is now the default scheduler ( |
|
Kubernetes half of the Phase 4 exit ("full sidecar-backed deployment (frontend + P + D workers) ... on k8s with zero etcd/NATS processes"), run on a local kind cluster (
Manifest and smoke script: single-pod |
|
Why the runtime
Deleting |
--router-replica-sync previously logged that it was not carried over to the embedded partition. Add SelectionHostHooks.replica_sync, a per-partition factory returning HostReplicaChannels (outbound events, inbound peer events, this replica's id); when the service runs no ZMQ peer mesh the partition's publisher forwards to the host's outbound channel and its replica consumer reads the host's inbound channel. The embedded host builds those channels over the runtime event plane (ACTIVE_SEQUENCES_SUBJECT, same wire formats and subscriber as the runtime scheduler used), so multi-replica frontends keep active-sequence sync on the default scheduler path. Signed-off-by: Ishan Dhanani <[email protected]>
|
Added: replica sync on the embedded partition (d586893). Verified on the default (embedded) path: |
…d partition Install the process-wide WorkerSelectionPolicyRegistry (the linked custom policy catalog the Python bindings register under --features custom-policy) through dynamo_llm::kv_router::install_worker_selection_policy_registry; embedded partitions and the static frontend resolve KvRouterConfig policy instances against it instead of the built-in default registry. A KvRouter built with Sel = WorkerSelectionPolicy therefore runs on the embedded partition too; only an arbitrary caller-injected WorkerSelector type (unit test fakes) still selects the runtime scheduler. Signed-off-by: Ishan Dhanani <[email protected]>
|
Added: linked worker-selection policies resolve on the embedded partition ( |
|
DEP for this stack: #33. |
|
The four scheduler-parity commits here (scheduler-load feed, embedded default, replica sync, linked-policy registry) now live in #35, rebased onto #18. This PR stays open for the two commits not yet carried onto the new stack: the sidecar direct-dispatch migration mapping (stack 3) and the EPP dynamo-mode deprecation (EPP follow-up after #40). |
Stacked on the NATS-feature PR. Closes roadmap exit gates that were open: Phase 2 "worker-shutdown migration tests pass" over direct dispatch, Phase 4 "full sidecar-backed deployment (frontend + P + D workers) on a bare VM with zero etcd/NATS processes", and the Phase 3 "deprecate EPP dynamo-mode" item.
Summary
Unknown/Internalwith h2 transport text;status_to_dynamomapped that toBackend(Unknown), which the migration layer treats as fatal. It now maps toBackend(Disconnected); a stream ending without a terminal response isBackend(StreamIncomplete); andBackend(Disconnected)/Backend(CannotConnect)join the migratable set.RoutingHostwas only installed onPrefillRouterwhen conditional disagg was on, so--router-disagg-decode-firstsilently used the prefill-first path. It is installed whenever either feature needs it.DYN_EPP_MODE=dynamologs a deprecation warning at startup; docs updated. It remains available this release.Validation
Zero-infra disaggregated deployment on this host, no etcd or NATS process running:
DYN_DISCOVERY_BACKEND=file,DYN_REQUEST_PLANE=tcp,DYN_EVENT_PLANE=zmq,DYN_ROUTER_EMBEDDED_SELECTION=1,DYN_ROUTER_DIRECT_DISPATCH=vllm; one prefill sidecar and two decode sidecars (dynamo-vllm-sidecar --disaggregation-mode prefill|decode --advertise-grpc-endpoint ...) overdynamo-vllm-mocker-serverengines;dynamo.frontend --router-mode kv --migration-limit 3.migration retry scheduled ... reason="backend_disconnected" ... tokens_completed=22, and both streams finish with 400 content chunks,finish_reason=length, no error chunks.DYN_ROUTER_DISAGG_DECODE_FIRST=1: 3/3 completions and both streams complete through the kill (decode-first path engaged; see final comment for the debug-log confirmation).cargo test -p dynamo-sidecar-common --lib(newmid_stream_transport_failures_are_disconnects),cargo test -p dynamo-llm --lib migration::tests::stall...(Backend(Disconnected)/CannotConnect migratable), clippy on sidecar-common, vllm-sidecar, ext-proc, llm: clean.Still not done: Kubernetes half of the Phase 4 exit (no cluster deployment of the sidecar images), replay-parity campaigns (multi-node Mooncake protocol), and the
backend-commonsplit.