#14536·dynamo

[FEATURE]: Add dynamic-load validation for subagent group affinity

Author: JasperChan929Created Sep 9, 2026Updated Sep 30, 2026
Labelsenhancementdynamo-runtimerouter

Feature request

Add a controlled real-GPU validation for the subagent-group-affinity policy in draft PR #14521, focusing on the trade-off between retaining a sibling group on a worker with a reusable KV prefix and rebinding it to a less-loaded worker that may need to recompute the prefix.

This issue is intended to establish evidence and acceptance criteria before proposing a more complex routing mechanism. It does not assume that the current policy is incorrect, and it does not initially request multi-worker replication or eager prefix warming.

Describe the problem you're encountering

PR #14521 keeps a policy-local binding from parent_session_id to one worker/DP rank. A bound group remains on that worker while its active_requests value is at or below max_active_requests. Once the threshold is exceeded, the policy selects a strictly less-loaded eligible worker and updates the group binding. Requiring a strictly lower load prevents movement between equally loaded workers.

The remaining question is how this behaves when worker load changes between sibling arrivals. A possible sequence is:

child 1: parent P binds to worker A
child 2: A is above the threshold, so P rebinds to B
child 3: B becomes busy and A becomes less loaded, so P rebinds to A
child 4: A becomes busy, so P rebinds to C

Because KV state is normally local to a worker/cache domain, each transition to a cold worker may require another full shared-prefix prefill. The strict load comparison prevents equal-load oscillation, but the current tests do not cover repeated transitions caused by alternating, strictly lower loads.

active_requests is also only a coarse proxy for queueing delay under continuous batching. Several nearly completed requests can be cheaper than one long decode, while recomputing a 16K or 32K prefix may cost more than waiting a short time for a worker that already has the prefix.

The routing trade-off can be expressed conceptually as:

stay_cost = estimated queueing cost on the worker with reusable KV
move_cost = target queueing cost + cold-prefix recomputation cost

An exact online estimate may not be available. The immediate goal is therefore to measure the end-to-end result of the current threshold policy rather than to introduce an unvalidated cost model.

Existing evidence

I built an agent-tree measurement harness and ran 350 trials / 1,700 requests using Dynamo 1.4.1, vLLM 0.26.0, exact 16,384- and 32,768-token prefixes, and one worker per physical GPU on dual-RTX-4090 and eight-RTX-4090D systems.

  • 115/115 physical-GPU KV-aware trials placed cold sibling groups across workers and computed one full prefix per worker touched.
  • 50/50 physical-GPU session-affinity controls co-located the siblings and computed one full prefix per group.
  • 120/120 strict single-worker trials computed one shared prefix, with no observed same-worker duplicate full prefill.
  • For fan-out 8 with a 32K prefix, the eight-worker rows computed 262,152 prefill tokens per trial, compared with 32,776 for the one-worker affinity control.

This supports a first-hop placement diagnosis for the tested single-host, idle configuration, but it does not validate #14521 under background load and does not establish that hard one-worker affinity is the production solution.

Related artifacts:

Proposed validation

Run the same exact-prefix sibling workload with the parent-aware policy disabled and enabled, using identical capacity and background-load schedules.

Initial scope

  • one frontend and eight physical-GPU workers;
  • fan-out 2/4/8;
  • exact 16K/32K shared prefixes and one-token child suffixes;
  • burst plus deterministic small-jitter arrival;
  • cold unique prefix per trial;
  • no background load as a control;
  • balanced steady background load;
  • one deliberately hot worker;
  • an alternating-hotspot schedule that crosses the configured threshold between sibling decisions;
  • the #14521 example threshold, followed by a small threshold sensitivity sweep only if the first comparison shows rebinding.

Comparisons

  1. Existing KV-aware routing without the parent-aware policy.
  2. PR #14521 subagent-group-affinity with soft session affinity.
  3. Shared-session affinity as a co-location/lower-bound-compute control, not as a proposed production policy.

Every child must have its own session ID and the siblings must carry one common parent session ID in the policy-enabled row.

Required observations

  • ordered first-hop worker/DP-rank sequence for each parent;
  • distinct physical-GPU workers touched per parent;
  • full-prefix computations and duplicate-prefix copies per parent;
  • prompt tokens, cached tokens, and computed prefill tokens;
  • TTFT distribution, including tail latency;
  • request completion and send skew;
  • background-load schedule and worker/GPU topology;
  • group transitions inferred from ordered worker selections;
  • load observed at the routing decision, if exposed; otherwise mark it TBD.

Questions the experiment should answer

  1. Does #14521 continue to reduce physical cache domains and full-prefix copies under changing load?
  2. How often does one parent group rebind, and can it return to a previously used worker?
  3. Does a load-triggered move improve TTFT enough to offset cold-prefix recomputation?
  4. How sensitive are the result and hotspot risk to max_active_requests?
  5. Does the policy preserve completion and fallback behavior when its bound worker becomes ineligible?

How the result would guide follow-up work

  • If groups normally remain on one worker and prefix copies stay near one, retain the simple policy and avoid adding more routing state.
  • If groups move occasionally and those moves improve latency, document the operating range and threshold sensitivity.
  • If alternating load causes repeated rebinding and prefix recomputation, evaluate the smallest stabilizer first: a cooldown, hysteresis, or a bounded number of rebinds.
  • Consider a small stable affinity set (for example, one primary and one standby) only if measurements show that a parent otherwise touches many cache domains. Preselecting a standby does not reserve its capacity or give it the prefix, so it should not be treated as zero-cost failover.
  • Do not eagerly prefill every standby unless a separate experiment shows that the resilience benefit justifies deliberate duplicate computation and KV occupancy.
  • After the single-frontend behavior is understood, test multiple frontends and multiple hosts separately because #14521's group map is policy-local.

Alternatives considered

Hard affinity

It minimizes duplicate prefix computation but can concentrate a wide fan-out on one worker. The existing idle measurements do not show a TTFT improvement and should not be interpreted as a production policy comparison.

Immediate cost-aware routing

Comparing predicted queueing time with prefix recomputation cost is a promising direction, but exact queue position and drain rate are not directly available under continuous batching. Adding such a model before measuring the current policy would introduce prediction error and additional scope without first showing that threshold-triggered rebinding is a material problem.

Multiple preselected workers

A bounded affinity set could cap the number of cache domains touched, but a preselected worker may be busy by the time it is needed. Without reservation or prefix warming it does not guarantee fast failover; with reservation or eager warming it consumes capacity and intentionally creates extra prefix copies. This should remain a measurement-driven follow-up rather than part of the initial validation.