DynoSim Replay CLI Reference

Flags, engine-args JSON fields, constraints, and report schema for python -m dynamo.replay.

View as Markdown

python -m dynamo.replay runs one workload through one simulated Dynamo configuration and emits an AIPerf-style report. This page is the flag and schema reference. For the workflow — input formats, run modes, and when to use DynoSim versus AIPerf — see DynoSim Runs; for searching many configurations, see DynoSim Sweeps.

The command reuses the mocker engine, so engine behavior is configured through JSON passed to --extra-engine-args (or the staged --prefill-engine-args / --decode-engine-args) rather than individual flags. For the underlying engine settings, see the Mocker CLI Reference.

python -m dynamo.replay requires exactly one of: positional trace files, or all of --input-tokens, --output-tokens, and --request-count. The dynamo format accepts one or more trace shards. Every other trace format requires exactly one file.

Workload input

trace_files
positional path(s)Defaults to null

Input trace path. The dynamo format accepts one or more JSONL or JSONL.GZ shards. Other formats accept one JSONL file. Mutually exclusive with the synthetic-workload flags below.

--input-tokens
integerDefaults to null

Synthetic per-request input length. Required (with --output-tokens and --request-count) when no trace file is given.

--output-tokens
integerDefaults to null

Synthetic per-request output length.

--request-count
integerDefaults to null

Number of synthetic requests. When --turns-per-session > 1, this is interpreted as the number of sessions, and total completed requests become request_count * turns_per_session.

--trace-format
stringDefaults to mooncake

Trace parser.

Allowed values: mooncake mooncake-delta agentic_mooncake applied_compute_agentic dynamo
--trace-block-size
integerDefaults to 512

How many tokens each hash_id in the dataset represents. Trace-file runs only; separate from the engine block_size. Public Mooncake/toolagent traces use 512. Dynamo request traces embed this value; replay derives it when the flag is omitted and rejects an explicit mismatch.

The mooncake-delta, agentic_mooncake, and dynamo formats were added after Dynamo v1.2.1. The ai-dynamo 1.2.x wheels on PyPI accept only mooncake and applied_compute_agentic.

Synthetic workload shaping

Apply only to synthetic (non-trace) runs.

--arrival-interval-ms
floatDefaults to null

Synthetic arrival spacing between requests, in milliseconds.

--turns-per-session
integerDefaults to 1

Number of turns in each synthetic session.

--shared-prefix-ratio
floatDefaults to 0.0

Fraction of prompt blocks shared inside a prefix group.

--num-prefix-groups
integerDefaults to 0

Number of shared-prefix groups. 0 disables grouping.

--inter-turn-delay-ms
floatDefaults to 0

Constant delay applied after each completed turn before the next turn in the same session becomes eligible.

Trace file schema

Mooncake-style JSONL traces contain one request per line. A basic row accepts:

FieldDescription
timestamp or created_timeRequest arrival time
input_length or input_tokensInput token count
output_length or output_tokensOutput token count
hash_idsPrefix-block identifiers from the source trace
priorityOptional signed soft-priority hint
strict_priorityOptional unsigned queue tier; larger values run first
policy_classOptional requested policy family or exact explicit class

Example:

1{"timestamp": 0, "input_length": 6755, "output_length": 500, "hash_ids": [0, 1, 2, 3]}

Rows without session_id are independent requests. Priority fields affect only pending requests when --router-mode kv_router is active; they do not change round-robin routing or execution order inside a selected engine.

Multi-turn sessions

Use the same session_id for every turn in one session. Turn n+1 waits for turn n to complete, then applies delay, delay_ms, or the timestamp delta between consecutive rows.

1{"session_id":"session-a","timestamp":1000,"input_length":2048,"output_length":128,"hash_ids":[1,2,3,4]}
2{"session_id":"session-a","delay_ms":50,"input_length":2560,"output_length":128,"hash_ids":[1,2,3,4,5]}

Agentic Mooncake traces

Set --trace-format agentic_mooncake to model request-level dependencies. Each row requires a stable request_id and can include:

FieldDescription
wait_forRequest IDs that must complete before this request starts
branchesChild request IDs spawned by this request
prefix_resetMarks the first row in a session
delayAdditional delay after dependencies complete
tool_wait_msSimulated tool-execution delay

Rows without wait_for use their timestamp as the start time. Rows with dependencies wait for all listed requests and then apply delay + tool_wait_ms.

Agentic Mooncake is an input format for externally authored Mooncake-compatible traces. It is not an intermediate representation for Dynamo request traces.

Dynamo request traces

Set --trace-format dynamo to read one or more dynamo.request.trace.v1 JSONL or JSONL.GZ shards. DynoSim reads the original records directly and does not create an intermediate Mooncake file. It derives and validates the trace block size across all shards.

Rows without agent_context use the standard request model. If every request contains agent_context, DynoSim reconstructs the agent-aware model, including session dependencies and tool waits. A replay cannot mix context-free and agent-aware request rows. For the complete capture schema, see Observe a Local Deployment.

--trace-block-size defines how many tokens each trace hash_id represents. It is independent from the simulated engine block_size.

Execution

--replay-mode
stringDefaults to offline

Offline mode drives the mocker engine core directly with no workers, NATS, etcd, or frontend. Online mode launches the mock workers against the live runtime path.

Allowed values: offline online
--router-mode
stringDefaults to round_robin

Routing strategy. kv_router uses the shared local scheduler and an in-process KV indexer.

Allowed values: round_robin kv_router
--num-workers
integerDefaults to 1

Number of aggregated workers.

--num-prefill-workers
integerDefaults to null

Prefill worker pool size for offline disaggregated simulation.

--num-decode-workers
integerDefaults to null

Decode worker pool size for offline disaggregated simulation.

--replay-concurrency
integerDefaults to null

Closed-loop concurrency cap. Ignores first-turn trace arrival timing and keeps a fixed number of requests in flight. Works with both trace-file and synthetic workloads.

--arrival-speedup-ratio
floatDefaults to 1.0

Compresses or stretches the trace arrival process. Affects trace timestamps, not worker compute speed. Larger values make arrivals happen sooner.

--report-json
pathDefaults to timestamped file

Output report path. When omitted, writes a timestamped dynamo_replay_report_*.json in the current working directory.

Engine and router JSON

These flags take JSON strings. Engine settings such as block_size, engine_type, dp_size, speedup_ratio, and decode_speedup_ratio belong here, not as top-level flags. Unspecified fields fall back to MockEngineArgs::default() and KvRouterConfig::default().

--extra-engine-args
JSON stringDefaults to null

Aggregated engine configuration. Accepts a partial JSON object.

--prefill-engine-args
JSON stringDefaults to null

Prefill worker configuration for offline disaggregated runs. Must set worker_type: "prefill".

--decode-engine-args
JSON stringDefaults to null

Decode worker configuration for offline disaggregated runs. Must set worker_type: "decode".

--router-config
JSON stringDefaults to null

KV-router policy tuning, for example {"router_queue_policy":"fcfs"} or {"router_prefill_load_model":"aic"}. Accepts a partial JSON object.

--router-policy-config
pathDefaults to null

Startup-only policy-family and cache-bucket queue YAML. Overrides router_policy_config inside --router-config. When omitted, DynoSim checks DYN_ROUTER_POLICY_CONFIG.

--model-name
stringDefaults to null

Exact model profile to select from --router-policy-config. When omitted, the YAML root profile is used.

Requests can set policy_class in Mooncake JSONL rows. A recognized policy family combines with the router-observed uncached Input Sequence Length (ISL) bucket to select a physical queue. An exact explicit class bypasses cache bucketing. Missing, unknown, and ordinary physical-class names use the selected profile’s default_policy_family. For the YAML schema and queue behavior, see Router Configuration.

Engine-timing AIC fields (engine-args JSON)

Set inside --extra-engine-args (or the staged prefill/decode engine args) to drive the simulated worker’s own timing model from AIC. This is the engine-timing AIC surface, distinct from the router-side --aic-* flags below.

aic_backend
stringDefaults to null

Backend the analytical model emulates. Enables the AIC perf model; should match engine_type.

Allowed values: vllm sglang trtllm
aic_system
stringDefaults to null

GPU SKU for the perf model, for example h200_sxm, h100_sxm, b200.

aic_model_path
stringDefaults to null

HuggingFace model identifier used by the perf model. Equivalent of --model-path in dynamo.mocker.

aic_tp_size
integerDefaults to 1

Tensor-parallel size of each engine replica.

aic_nextn
integerDefaults to null

Speculative-decode depth for AIC-backed MTP runs. In disagg, set on the decode engine args.

aic_nextn_accept_rates
stringDefaults to null

Conditional draft-token accept rates for the mocker burst sampler, for example "1,1" with aic_nextn=2 accepts up to three visible tokens per decode forward.

startup_time
floatDefaults to 0

Simulated seconds between a planner scale-up decision and the new worker becoming active. Unset or 0 means workers activate instantly.

Router-side AIC prompt-load flags

Top-level flags used only for router-side prompt-load modeling, together with router_prefill_load_model: "aic" in --router-config. Engine timing AIC still belongs in the engine-args JSON above. Both surfaces accept the MoE parallelism fields; for Kimi-style TP-only MoE configs, set --aic-moe-tp-size equal to --aic-tp-size, with --aic-moe-ep-size 1 and --aic-attention-dp-size 1.

--aic-backend
stringDefaults to null

Backend for the router-side perf model.

Allowed values: vllm sglang trtllm
--aic-system
stringDefaults to null

GPU SKU for the router-side perf model, for example h200_sxm.

--aic-backend-version
stringDefaults to auto

AIC backend engine version. When unset, uses the default version for the backend.

--aic-model-path
stringDefaults to null

HuggingFace model identifier for the router-side perf model.

--aic-tp-size
integerDefaults to 1

Tensor-parallel size for router-side latency prediction.

--aic-moe-tp-size
integerDefaults to null

Mixture-of-Experts tensor-parallel size. Required by some MoE models.

--aic-moe-ep-size
integerDefaults to null

Mixture-of-Experts expert-parallel size. Required by some MoE models.

--aic-attention-dp-size
integerDefaults to null

Attention data-parallel size. Required by some MoE models.

Constraints

DynoSim validates these before running and fails immediately on any violation.

Shared constraints:

  • extra_engine_args.engine_type must be vllm, sglang, or trtllm
  • aggregated simulation requires the existing aggregated args path
  • disaggregated simulation requires both prefill_engine_args and decode_engine_args
  • disaggregated simulation requires router_mode=kv_router
  • dp_size must be 1
  • disaggregated simulation requires matching block_size in prefill_engine_args and decode_engine_args

Additional offline constraints:

  • offline kv_router requires num_workers > 1
  • single-worker offline mode is a dedicated fast path for vllm, sglang, and trtllm; it supports flat request runs and workload-driven multi-turn runs
  • offline disaggregated simulation is a separate two-stage runtime with prefill and decode worker pools

Additional online constraints:

  • the current live simulation path is also limited to aggregated workers

Report schema

The report — and the equivalent Python APIs dynamo.replay.run_trace_replay(...) and dynamo.replay.run_synthetic_trace_replay(...) — contains:

  • request counts
  • input and output token totals
  • virtual duration and wall-clock runtime
  • request and token throughput
  • prefix cache reuse ratio
  • TTFT, TTST, TPOT, ITL, and end-to-end latency summaries
  • output-token-throughput-per-user summaries