The AgentX baseline runs with thinking=true/high by default; the Dynamo
frontend only applies a default when the worker publishes
default_thinking_mode. Pass --dyn-default-thinking-mode enabled on both
P and D so the SGLang chat processor matches the sglang baseline.
Document --dyn-chat-processor sglang + --dyn-preprocess-workers +
--tokenizer fastokens, the encoding_dsv4 shim, the fastokens propagation
gap in sglang_processor._load_tokenizer, the v41 thinking opt-in fix, and
the warm/cold smoke numbers.
- SGLANG_DISAGGREGATION_QUEUE_SIZE=16 / THREAD_POOL_SIZE=32 (cw baseline
values; service defaults are 4).
- NCCL all-gather sync-batch env on P; batch spans off until the next
image build carries the TraceNullContext guard.
- FE mounts the encoding_dsv4 shim and the v41 thinking patch.
TraceNullContext forwards every attribute to itself, so the previous
root_span.get_span_context() probe returned the null context itself and
otel's exporter failed with 'expected bytes, TraceNullContext found'.
Gate on tracing_enable before probing.
Dynamo's sglang_post imports upstream sglang.srt.entrypoints.openai.
encoding_dsv4.encode_messages; our fork uses the deepseek-recipe renderer.
Expose the upstream API on top of the recipe (V4.1 spec), returning the
prompt string; tool schemas follow Dynamo's system-message convention.
Use the 1.6.2 frontend tokenizer controls instead of per-worker gateways:
--dyn-chat-processor sglang + --dyn-preprocess-workers N + --tokenizer
fastokens, with explicit deepseekv41 / deepseek-v41 parsers (sglang's
'auto' is not resolved by the frontend parser factory). Also start the
L3 mooncake master from the same image.
Bootstrap completion is discovered at scheduler pass boundaries via
poll_and_all_reduce_attn_cp_tp_group; Dynamo's frontend still waits on it.
Record the measured prefill_bootstrap vs mooncake-send gap and point at
the sglang-side levers.
Dynamo's frontend/PrefillRouter owns P/D selection and bootstrap-info
propagation; the SGLang backend still delegates the KV transfer to
sglang's native disaggregation (mooncake + our NVLink patches).
--connector nixl / --kv-transfer-config apply to vLLM/TRT-LLM only.
- Dockerfile/build script: current B300 baked image (runtime tree identical to
b300/dynamo) + ai-dynamo/ai-dynamo-runtime 1.6.2 installed with --no-deps.
- start_dynamo_pd.sh: dynamo.frontend :33000 + 4P(dp4)/4D(dp4) workers on
GPU 0-3/4-7, mooncake NVLink, HiCache L2 + L3 SSD.
- README: compatibility audit (dynamo 1.6.2 unit tests match the nightly
control run), version matrix, known constraints, open items.
Promote the validated ds41-gist-exp baseline:
- image recipe-ns-l3ssd-433257c7b-baked-20261115 (SGLang + Mooncake 0.3.14 + L3 SSD)
- P: cache / no-optimistic / fastokens / tokenizer-worker 16 / L3 SSD 4T
- D: fastokens / tokenizer-worker 16
- gateway: normal health/circuit, no P admission caps
- c580 baseline 24.045 rps; c620 and buffer_only results recorded
- Feishu baseline doc and deploy manifests included
This is the base for the next Dynamo layer.
Backport the upstream namespace-tool stack onto the B300 recipe base:
- #46370: Function.namespace / ChatMessage.action protocol fields.
- #49625: Responses/Messages native recipe rendering (convert_native),
tool_search/defer_loading, namespace identity in/out/history replay.
Adapted to this base: skips serving_kimi_k3.py (not present), drops the
Minimax/Beam/wire-only dependencies added between 10-23 and the PR base,
and keeps the existing tool-parsing fallback where the newer
`parses_without_tools()` helper is unavailable.
Also includes the PR's Anthropic tool-reference plumbing and unit tests.
A 2 ms phase whose CPU clock reads 0.1 us over its wall clock is clock
granularity, not an accounting bug; the anomaly flag fired on nearly every
short phase in the live verification run.
Only flag (and record non_cpu_raw_ms) when the deficit exceeds both 100 us and
1% of the phase wall. Larger real anomalies keep the previous behaviour.
The frontend sglang:num_requests_total has no dp_rank label (verified from the
series registry), so per-rank RPS was not derivable from any existing metric.
Add sglang:batch_requests_total{phase,dp_rank}, incremented by the scheduler
process that actually completed the request:
phase=prefill prefill compute finished and the request entered the PD
transfer queue (not a guarantee that the transfer succeeded)
phase=decode request finished decoding
Only the canonical scheduler rank reports (attn_tp_rank==0, attn_cp_rank==0,
last PP stage) — every TP/CP rank runs a scheduler and sees the same request,
so an ungated counter would be multiplied by TP*CP in the multiprocess
registry. Both hooks count each request exactly once: the decode path counts
after _handle_finish_state_updated_req and on the sampling-mask abort branch,
skipping rows that finished on an earlier step; the prefill path counts after
the request enters the disagg inflight queue (aborted/retried requests never
reach it). The per-request finished() check is skipped entirely when
SGLANG_BATCH_TELEMETRY is off.
Covers the design's unit-level acceptance points:
* disabled/unsampled loops never read the thread clock;
* wall/CPU/non-CPU semantics, unmeasured != zero, partial measurement omits
non-CPU, busy vs sleeping windows are distinguishable;
* CPU > wall flags an accounting anomaly with a raw negative delta;
* child spans carry the CPU split;
* repeated phases (prefix indices) stay attribute-only, inclusive phases are
not summed, and eviction demand/shortfall/plan plus Mamba plan/zero results
are recorded as separate counters.
Parent span scheduler.loop.prefill_batch_init records wall + the scheduler
thread's CPU at both existing close points (empty admission and normal
return); the CPU clock is only read when loop detail is enabled and sampled,
through the safe batch_telemetry.thread_cpu_ns() wrapper so a missing clock
degrades to 'not measured' instead of failing the scheduling path.
Fixed children, in call order:
schedule_batch_init, ready_to_load_host_cache, prepare_for_extend,
alloc_for_extend (+ prefix_device_indices attribute-only, sampling_batch_info),
evict_to_free_tokens, evict_for_alloc, prefill_stats (+ pending_tokens),
mixed_chunk_tail.
* prefill_stats wraps the whole assignment so _get_num_pending_tokens() is
included; mixed_chunk_tail only exists when that branch is taken.
* prefill-only shape counters (n_reqs/n_new/n_cached) are snapshotted before
mixed-chunk folding; a mixed batch additionally publishes decode_reqs and
merged totals under explicit *_merged_* names.
* eviction is timed at the call site (outside the allocator wrapper) so
rank-consensus waits are included, and covers base, SWA (x2), UnifiedSWA
(x3) and the extend Mamba reclaim through evict_for_alloc_observed().
Demand, shortfall and plan are separate counters; Mamba plan and realized
counts are both recorded (including zero).
All of it is gated by detail on a sampled loop.
Adds an optional thread CPU clock next to the existing wall clock:
* detail_begin/end record time.thread_time_ns() only when detail is on and the
loop is sampled; detail_add() accepts an explicit thread_cpu_ns for callers
that already hold absolute start/end points (the prefill_batch_init parent).
* phase records carry [wall, count, start_wall, end_wall, cpu_sum, cpu_count].
thread_cpu_ms and thread_cpu_measured_count are emitted whenever any
occurrence was measured; non_cpu_ms only when every occurrence was, so a
partial measurement never attributes unmeasured wall to non-CPU time. A
phase whose CPU exceeds its wall keeps the clamped value, adds
non_cpu_raw_ms and accounting_anomaly, and bumps a per-loop anomaly count.
* new detail_attr_sum()/detail_attr_setdefault() accumulate low-cardinality
numeric loop attributes (eviction tokens, free-token snapshots).
* prefix_device_indices joins the attribute-only prefixes so per-request
repeats never create spans.
* child spans carry phase_thread_cpu_ms / phase_cpu_measured_count /
phase_non_cpu_ms, so the CPU split is visible without the loop attributes.
Default-off path is unchanged: no thread clock, no new dicts, no spans.
The detail-phase refactor made residual a required positional argument while
test_loop_span_accounting.py still calls _emit_pass_span with four arguments,
so that test failed on the base commit. Default it to 0.0.
Split out of the prefill_batch_init observability series to keep that review
scope focused.
Deriving each candidate's uncached estimate from its own recent hit rate is
self-reinforcing: a rank that falls behind sees its hit rate drop (fewer
chances to hit), gets charged more for every new request, and falls further
behind. Measured on c580: one rank ended 16% below the others, 30 s cross-rank
dispersion max 952x, and 9.6% lower rps than the total_tokens arm.
Charge the fleet-average uncached size instead and rank by the published
num_waiting_uncached_tokens, which already carries each rank's exact prefix
match.
DP balancing on total_tokens charges each request's whole prompt, but with
prefix caching only the unmatched part costs prefill compute. On a workload
with a 95% hit rate the prompt is ~95% noise: per request the uncached part
is a few percent of the prompt yet varies by more than an order of magnitude
(p50 1.9k / p99 59k tokens against a 95k prompt), so one cold request
outweighs many hot ones and per-rank prefill work drifts apart.
Add --load-balance-method uncached_tokens: DPBudget tracks the published
LoadSnapshot.num_waiting_uncached_tokens (prefix match minus accepted storage
hits) plus the rank's recent cache_hit_rate for a newly dispatched request.
total_tokens DP balancing replaces its per-rank estimate with the rank's
latest load snapshot, so a snapshot that misses work already sent to the
rank lets the controller keep sending to it. Close three gaps:
- count grammar-queue requests in num_waiting_reqs and num_total_tokens
- count the in-progress chunked request's unprefilled tokens
- publish a snapshot once newly received requests are queued, since the
one published after a forward predates the requests sent during it
Copies the three files that the live cw mounts over the image:
- managers/load_snapshot.py: queued_total_input_tokens + drain_rate_tokens_per_s
- managers/scheduler_components/load_inquirer.py: fills the two new fields
- models/deepseek_v4.py: env-gated MM trace (SGLANG_MM_TRACE, off by default)
After this commit every runtime file the P/D pods need is in the tree, so the
hostPath file mounts can be dropped once the image is rebuilt.
SGLANG_MOONCAKE_CLIENT_METRICS_PORT_BASE=<base> makes MooncakeStore.setup()
pass enable_http_server=True and client_http_port=base+dp_rank, so each DP
rank's embedded Mooncake client exposes /metrics (needs MC_STORE_CLIENT_METRIC=1).
Off by default.
Phase 1/3 of the async-backup handoff instrumentation plan:
* new fwd_timeline probe (SGLANG_FWD_TIMELINE=1): one CUDA event pair around
the model execute call per forward, resolved without blocking and written as
wall-clock JSONL per DP rank. Joined with loop spans it separates host time
spent while the GPU is busy (overlapped) from GPU-idle host stalls.
* detail phases: fwd_init_new, fwd_prepare, fwd_execute, fwd_graph_load,
fwd_graph_replay, fwd_post, fwd_runner_tail,
prefill_policy, prefill_adder_init, prefill_scan, prefill_batch_init.
All spans ride the existing SGLANG_TRACE_LOOP_DETAIL path; the GPU probe is
off by default.
Adds the Phase A instrumentation from the async-backup handoff (§7.1):
* PassTimings: pending_abort / chunk / new_batch / set_sched (+ chunk_count)
* prefill.get_next_disagg_prefill_batch_to_run: time
process_pending_chunked_abort, process_prefill_chunk,
get_new_batch_prefill and set_schedule_time_batch
* scheduler.prefill.pass gains sglang.{pending_abort,chunk,new_batch,set_sched}_ms,
sglang.get_next_residual_ms (= other - these four) and sglang.chunk_count;
the existing sglang.other_ms is unchanged for dashboard compatibility.
~5 monotonic calls per pass; enabled by SGLANG_BATCH_STAGE_TIMING (already on).
Net async change (from exp-async-backup-perop-20261107) applied onto
b300-pick-46884-20261107. Runtime files applied cleanly; the new tests and
the timeline probe are added as-is.
Interaction to validate on hardware: #46884 publishes prefill read-done before
the replay, so the scheduler-stream fence that the index copy waits on is
shorter; the async worker's wait should shrink and the copy may overlap more of
the in-flight forward. Re-baseline the 4-arm A/B on this branch.
The prefill shared-read-done fastpath lets the schedule stream run ahead of
the forward that writes a stashed chunk's KV instead of waiting for the whole
forward. It was disabled whenever hierarchical cache or a storage backend was
enabled, because host and storage offload copies used to be ordered only
behind the schedule stream and could have read unfinished KV.
The cache controller now orders its device-to-host copies behind the forward
stream through write_fence_stream, and its load-back H2D copies through
load_fence_stream, so that reason no longer holds when every KV offload copy
carries that fence. The scheduler records on the model runner whether that is
the case: hierarchical cache with a cache controller and no decode offload
manager, which has no such fence. The publish helper keeps the coarse
whole-forward barrier for LMCache and for unfenced offload, and publishes
read-done otherwise.
With the coarse barrier, a synchronous page-index copy issued while preparing
the next batch inherited the wait on the entire in-flight forward, leaving the
GPU idle between batches. With read-done published, that copy only waits for
the shared-table reads to finish; KV ordering is unchanged because the backup
copies still wait on the forward stream.
Tests: the CPU runner test covers the fenced hierarchical-cache and storage
cases publishing, and LMCache keeping the barrier even when hierarchical cache
is fenced. The GPU ordering test checks that a write-through backup of a chunk
stashed before its forward finished still copies the final KV.
Co-authored-by: ZYHowell <ZYHowell@users.noreply.github.com>
(cherry picked from commit bb1cb2dded6fb9352d98076280342b10684e061b)
* Normalize the host-pool layout to a string (a None attribute would make
the OTel SDK drop the whole flush span).
* Drop any remaining None-valued flush attributes for the same reason.