DynoSim Replay CLI Reference
aisimulate predict --stack dynamo evaluates one concrete workload and deployment configuration
through the Dynamo simulation stack. AISimulate owns the traffic and engine schema. The ai-dynamo
package supplies the Dynamo runner and the optional router and planner configuration adapters.
For an end-to-end workflow, see Run a DynoSim Simulation. To search configuration domains, see Sweep DynoSim Configurations.
The former Replay online mode has no replacement in the unified AISimulate CLI yet. aisimulate predict and aisimulate recommend are offline-only. The separate python3 -m dynamo.mocker
command remains available for launching live workers but does not provide replay orchestration.
Command
YAML prediction configuration. Prediction files contain concrete values and reject search
domains, presets, optimization, and optimizer.
Execution stack. Set this option to dynamo to load the Dynamo runner and the Router and Planner
adapters registered by ai-dynamo.
Override a schema-valid configuration path after loading the YAML file. Repeat the option for multiple overrides. Values are parsed as YAML, and later assignments win. Sequence indexes are not supported.
Directory for prediction.json and optional per-request output.
Replace known AISimulate output files in an existing nonempty output directory. Unrelated files are preserved.
Standard-output format.
Allowed values: table jsonWrite one record per request to requests.jsonl.
Configuration Sections
The YAML document uses these top-level sections:
Unknown fields are rejected. predict accepts only concrete values. Use aisimulate recommend for
choices, range, or preset domains.
Dynamo Prediction Example
Traffic Rules
traffic contains source, load, and stop mappings.
- Omitting the entire section creates 100 independent synthetic requests at concurrency 10, with 1,024 input tokens and 128 output tokens per request.
source.type: syntheticcreates independent requests withinput_tokensandoutput_tokens.source.type: synthetic-sessioncreates ordered multi-turn sessions. Each later turn’s prompt starts with the session’s earlier prompts and outputs.source.type: tracereads one or more paths. Supported formats includemooncake,mooncake-delta,agentic_mooncake,weka,applied_compute_agentic, anddynamo.load.type: concurrencykeeps a fixed number of requests or sessions active.load.type: constant_rateschedules evenly spaced arrivals fromrequests_per_secondorsessions_per_second.load.type: poissonuses the matching rate with exponential inter-arrival times and an optionalseed, which defaults to 42.load.type: trace_timestampspreserves trace timing and accepts a positivespeedup.stop.requestsapplies to independent requests.stop.sessionsapplies to session sources.stop.requests_per_load_unitandstop.sessions_per_load_unitderive the count from the concrete concurrency or arrival rate.stop.max_virtual_time_secondsis a soft virtual-time cutoff. Requests admitted before the cutoff may finish afterward.
For Dynamo request traces, omit traffic.source.block_size; Dynamo derives it from the source and
rejects mixed block sizes across shards. For Weka corpora, AISimulate derives the block size from the
source. An explicitly configured Weka block size is only an assertion against the published source
metadata. Dynamo format accepts multiple trace shards. Weka accepts one file or directory; other
formats accept exactly one file.
For Weka traces, traffic.source.nested_timestamp_basis controls how nested timestamps
are interpreted:
auto(the default) scans the entire corpus and selects one basis for all nested requests. If any replayable child timestamp precedes its parent marker, it selectsrelative; otherwise, it selectsabsolute. A corpus without replayable nested requests resolves tonot_applicable. It does not choose a separate basis for each child or file.absoluteuses timestamps directly and rejects a child timestamp before its parent marker, apart from the importer’s timestamp-rounding tolerance.relativeadds the parent marker’s timestamp to each child timestamp.
Explicit absolute and relative overrides take precedence over inference. For example, a marker
at 1 second with a child timestamp of 2 seconds is interpreted as 3 seconds with relative, and
as 2 seconds with absolute. auto chooses 2 seconds for that corpus unless another child
provides evidence for relative timestamps.
AISimulate’s Weka importer also changes two behaviors from the former Dynamo importer:
- A source request with
out: 0retains zero output tokens and runs as a prefill-only request. The former importer usedmax(1, out). Output-token counts, throughput, and timing metrics can therefore change for the same corpus. - A missing or null
api_timeremains absent (None) inrecorded_api_time_ms, preserving the distinction from an explicit zero. Dependency classification uses a zero-duration interval at the request timestamp when that duration is unknown. These requests were previously rejected. The fallback can affect inferred dependency edges and replay timing; it does not assert that the measured API duration was zero.
mooncake-delta requires aggregated engine mode. agentic_mooncake and weka
require trace_timestamps.
applied_compute_agentic requires concurrency load.
Canonical Python Engine Configuration
Pass an AISimulate engine launch mapping to extra_engine_args, prefill_engine_args, or
decode_engine_args. Dynamo owns the optional dynamo runtime options; AISimulate owns the
engine schema, topology, defaults, and validation.
The MockEngineArgs, SglangArgs, and TrtllmArgs Python classes have been removed. Replace
constructor calls and flat engine JSON with mappings in this shape:
Use json.dumps and json.loads to save and restore configuration mappings. Keep
num_gpu_blocks_is_explicit when saving a normalized configuration: false preserves automatic
AISimulate capacity estimation. Providing engine.num_gpu_blocks without that marker selects an
explicit capacity. Set engine.max_num_seqs or engine.max_num_batched_tokens to null (None in Python)
for an unlimited scheduler limit; omit the field to use the engine default. With the SGLang
backend, a null engine.max_num_seqs is not unlimited: the engine derives the limit from the KV
capacity and the context length.
A vLLM engine models async scheduling by default, except with MTP and native host offload: a
request that arrives while the engine is busy is admitted later than with synchronous scheduling,
one pass later in offline replay and up to two passes later in online replay. Set
engine.async_scheduling to false (False in Python) to model synchronous scheduling. SGLang
and TensorRT-LLM engines reject the field.
AIS perf model inputs of the Python replay API
run_trace_replay(...) and run_synthetic_trace_replay(...) take an AIS perf model through two
keywords, ais_perf_model for the engines and router_ais_perf_model for the KV router.
Available since v1.8. Each value is one perf model config, a list of configs with one
worker_type each, a path to a YAML or JSON file, or inline JSON (text that starts with { or
[). For the keys of a config, see
Unified perf-model input
in the AISimulate documentation.
ais_perf_modelsetsengine.timing_modelin the engine args of every role the replay runs:prefillanddecodewhen prefill or decode engine args are given,aggregatedotherwise. It creates aggregated engine args when none are given. A disaggregated replay needs bothprefill_engine_argsanddecode_engine_args: the keyword does not create engine args for a role that has none. Engine args that already writeengine.timing_modelare an error, for exampleextra_engine_args already sets engine.timing_model; it cannot be combined with ais_perf_model. It does not configure the router.router_ais_perf_modelgives the KV router the perf model that itsaisprefill load model reads. It requiresrouter_mode="kv_router"and arouter_configwithrouter_prefill_load_model="ais". It reads theprefillconfig of a disaggregated replay and theaggregatedconfig otherwise. A KV router replay whoserouter_configsetsrouter_prefill_load_model="ais"needs this keyword. Without it, and without the deprecatedais_perf_config, both functions raise aValueError:router_prefill_load_model='ais' requires router_ais_perf_model=. Withrouter_mode="kv_router", the keyword without arouter_config, or with one that does not set that load model, is aValueErrortoo:router_ais_perf_model= requires router_config with router_prefill_load_model='ais'.
Both functions read a value before the replay starts and check each config the replay uses:
ais_perf_model the config of every role the replay runs, router_ais_perf_model the one config
the router reads. A value they cannot read, a list without such a config, and such a config with
an unknown top-level key or without backend, system or model are each a ValueError. The
other configs of a list are checked only for their form: systems_paths written as text or an
empty from is still a ValueError, while an unknown top-level key or a missing backend,
system or model is not. A top-level key written with a null value is the same as a key left
out. For ais_perf_model the message of such an error starts with ais_perf_model, with
cannot read, or with the absolute path of the file the value names, for example
ais_perf_model requires model. For router_ais_perf_model it starts with
router_ais_perf_model, for example
router_ais_perf_model: ais_perf_model: no entry for worker type 'aggregated'; it has: prefill.
The replay itself makes further checks, for example of the backend name and of the keys inside
estimator_config and speculation. It reports an error in its own words, without these
prefixes, and the words depend on the value. An unknown backend name, for example, is a
ValueError whose message starts with invalid AIS performance config for ais_perf_model and
with invalid AIS perf config for router_ais_perf_model; tp: 0 in a router_ais_perf_model
value is a RuntimeError whose message starts with AIS model construction failed.
Deprecated. Use router_ais_perf_model=. Removed in v1.9. The ais_perf_config keyword of
both functions still works and emits a FutureWarning:
ais_perf_config= is deprecated and will be removed in v1.9; use router_ais_perf_model=.
Passing both keywords is an error: ais_perf_config= cannot be combined with router_ais_perf_model=.
A mistake made with the deprecated keyword is still reported by the replay itself, which names
ais_perf_config, for example ais_perf_config requires router_mode='kv_router'.
A planner_config that writes ais_perf_model with the roles or dataset_profiles keys still
works too, and both functions emit one FutureWarning for it, for example
ais_perf_model.roles is deprecated and will be removed in v1.9; use ais_perf_model with one perf model config or a list of configs (one per worker_type).
Typed agentic replay through the Dynamo API
AISimulate owns public Weka ingestion, validation, and lowering into the canonical
ValidatedAgenticGraph. The lower-level
dynamo.replay.run_trace_replay(...) API keeps trace_format="weka" as a compatibility adapter,
but delegates graph construction directly to aisim-core before Dynamo composes its Router
and Mocker runtime behavior.
Use weka_nested_timestamp_basis="absolute" or "relative" to override nested timestamp
interpretation in run_trace_replay(...). Omitting it preserves the auto heuristic.
Set weka_client="agentx" to spawn and join subagents as the AgentX client does; the default
"recorded" keeps the recorded timing. This client follows SemiAnalysisAI’s AIPerf fork
agentx-harness at 754356e9,
not the AIPerf --scenario inferencex-agentx-mvp that Dynamo’s AgentX recipes run; parity with
those recipes is not established. weka_chat_template adds a chat template’s tokens to each
prompt (request_tokens, user_tokens, assistant_tokens, tail_tokens, append_tail_tokens,
all required, with append_tail_tokens <= tail_tokens <= request_tokens). In an AISimulate
prediction config, they are traffic.source.client and traffic.source.chat_template.
Set agentic_lanes to a positive integer to replay a fixed number of trajectories concurrently.
Plays are stable-sorted and stride-assigned to lanes. A lane starts its next play only after its
current play is quiescent, and lanes do not steal work. Agentic replay rejects
replay_concurrency and Planner scaling. A Weka corpus may retain multiple source-model labels as
provenance, but the current runtime projects every node onto the single configured
execution_model. Per-node heterogeneous timing models are not yet supported.
Agentic reports retain the sorted source-model labels in agentic_graph.source_models and record
the explicit projection policy and target in agentic_model_projection.
Weka reports also expose the resolved timestamp basis as the string
weka_nested_timestamp_basis: absolute, relative, or not_applicable. For offline
run_trace_replay(...), read report.summary["weka_nested_timestamp_basis"]; online replay
includes the same field in its summary dictionary. The Dynamo runner includes it in
report.metadata, including when raw-report capture is disabled. The requested basis remains
in the workload configuration.
Agentic Mooncake v2 begins with a required versioned header:
Each request row contains a globally unique request_id, nonempty play_id, session_id, model,
exact input and output metadata, hash_ids, and not_before_ms. Optional
source_play_ordinal and recorded_api_time_ms fields preserve source ordering and recorded timing
evidence. The optional dependencies array contains typed incoming edges. Each edge identifies its
predecessor, a dispatch or completion trigger, a nonnegative delay, and a sequence, spawn,
join, or replay_barrier relation.
Agentic Mooncake v2 remains an optional materialized interchange format. Dynamo intentionally does not ship a Weka parser, lowering implementation, or Weka-to-v2 converter; those source semantics and any future materialization tooling belong to AISimulate.
AgentX host offload and lifecycle controls
Configure G2 through engine.workers.<role>.kv_cache.host_offload in CLI YAML,
or engine.native_host_offload in the canonical engine configuration passed to
the Python replay API. Both use the existing offline replay
path for every trace format, including ordinary Dynamo, Mooncake, and
Mooncake-delta traces. No connector configuration is required.
For AgentX graphs, G2 requires vLLM, one aggregated worker or one prefill plus
one decode worker, attention DP=1 on every role, static worker pools, and no
speculative decoding (engine.aic_nextn and
engine.timing_model.config.speculation unset,
engine.decode_speedup_ratio=1.0). Tensor parallelism may exceed one. These AgentX limits
also apply when a Dynamo trace contains agent context but agentic_lanes is
omitted. Ordinary traces retain their existing topology support; a standard
Dynamo trace with two workers and attention DP=2 is covered by the G2 tests.
G3 and online AgentX G2 replay are outside this support boundary.
Each role can omit offload or select dp_rank_local or cluster_shared.
Shared roles must agree on layout, total capacity, and shared directional
bandwidths. num_host_blocks is the capacity of one shared pool and is counted
once. AISimulate’s public engine materializer derives the layout identity for
CLI and ReplaySpec inputs; direct canonical configuration callers must supply
a compatible kv_layout_id in engine.native_host_offload for a shared pool. Host-tier events
remain distinct from GPU residency, while the KV router retains its configured
host-tier weighting. P-to-D handoff uses GPU-resident hashes.
engine.kv_transfer_bytes_per_token describes P-to-D transfer size;
engine.kv_cache_bytes_per_token describes the physical cache footprint used by G2.
G2 requires a resolved, positive physical cache size. Set the transfer size
separately when the geometries differ.
The Python run_trace_replay API also accepts agentic_snapshot (a mapping
containing seed), agentic_warmup (default False), agentic_warmup_policy, and
agentic_profile (AISimulate’s duration, response-grace, and cancellation-drain options).
agentic_warmup_policy is repeated_prefixes (default) or live_trajectory_v1, which
advances each trajectory during warmup and requires agentic_warmup=True and agentic_profile.
These phase controls require offline replay. Snapshots require positive
agentic_lanes; warmup and profiling require a
snapshot. Profiling cannot be combined with max_sim_time_ms. Warmup retains
G1/G2 state across the measurement barrier. Results retain agentic_snapshots,
agentic_phases, and agentic_profile when those phases are enabled.
With per-request capture, inspect first_admission_g1_reused_input_tokens,
first_admission_host_reused_input_tokens, and admission_history to distinguish
G1 hits, completed G2 restores, and P/D admission. HBM-only reports may omit the
host field. g2_domains reports shared capacity. This support is
functional_only; it does not establish performance equivalence with a
hardware offload recipe.
Engine and Adapter Rules
-
engine.mode: aggregatedrequiresengine.workers.aggregated. -
engine.mode: disaggregatedrequiresengine.workers.prefill,engine.workers.decode, andengine.kv_transfer. -
aisimulate predictandaisimulate recommendcurrently support TensorRT-LLM only in aggregated mode. This is an offline simulation limitation; Dynamo runtime deployments support TensorRT-LLM disaggregated serving. -
Each
parallelismmapping is concrete and containsreplicas,tensor,pipeline,attention_data,moe_tensor, andmoe_expert. -
engine.context_lengthdefaults tomax, which AISimulate resolves from the model’s Hugging Face configuration. Default KV block sizes are 64 for vLLM, 1 for SGLang, and 32 for TensorRT-LLM. -
Scheduler defaults are 8,192 batched tokens for every role and 256 sequences for aggregated and decode workers. Prefill workers default to one sequence.
-
timing.type: defaultuses the AIConfigurator forward-pass model shipped in theaisimwheel.fixedrequires bothprefill_msanddecode_ms;polynomialselects the built-in polynomial model. -
router.policy: kv_routersupports one or more routable workers. Setrouter.prefill_load_model.typetononeorais. Arecommendrouter section that does not writerouter.prefill_load_model.typesearches both for its KV router candidates. Itsaiscandidates read the perf model of their engine, as withrouter.ais_perf_model: {use: engine}, and a recommended config with theaisload model writes that key. Withfixedorpolynomialengine timing the engine has no AIS perf model: thoseaiscandidates are infeasible, with a reason such asrouter.prefill_load_model.type: ais needs an AIS perf model on the aggregated engine; it has none, and the search goes on with the other candidates. -
With
router.prefill_load_model.type: ais,router.ais_perf_modelnames the AIS perf model the router predicts prefill durations with. Available since v1.8. Write{use: engine}to read the perf model of the engine the router routes to, or write one perf model config or a list of configs with oneworker_typeeach under the key. The router takes theprefillconfig in disaggregated mode and theaggregatedconfig otherwise. A string is not accepted, andnullis the same as leaving the key out.from, the items ofsystems_paths, and the path fields underestimator_configmust be absolute paths. The key withoutrouter.prefill_load_model.type: aisis an error, andretune.routerdoes not accept the key. -
router.ais_perf_model: {use: engine}needs an engine with an AIS perf model. Withfixedorpolynomialengine timing a prediction fails withrouter.ais_perf_model: {use: engine} needs an AIS perf model on the aggregated engine; it has none; write a perf model config under the key for such an engine. In a recommendation that writes{use: engine}each such candidate fails with the same message. -
A perf model config or list written under
router.ais_perf_modelis read before the replay of a prediction or the search of a recommendation starts. A prediction reads the config of itsengine.mode, and a recommendation reads the config of every searched mode: theprefillconfig fordisaggregatedand theaggregatedconfig foraggregated. In a config that is read, an unknown top-level key or a missingbackend,systemormodelends the run with a configuration error, and so does a list with no config for such a mode, for exampleais_perf_model: no entry for worker type 'prefill'; it has: aggregated. The other configs of a list are checked only for their form and for two rules:systems_pathswritten as text, a relative path, or the keyuseis still a configuration error there, while an unknown top-level key or a missingbackend,systemormodelis not. The keyuseis accepted only as{use: engine}written alone, souse: nullis a configuration error too; any other top-level key written with anullvalue is the same as a key left out. -
The perf model itself makes further checks during a prediction or a candidate’s replay, for example of the
backendname and of the keys insideestimator_configandspeculation. A config it does not accept fails a prediction; the message depends on the value and containsinvalid AIS perf configfor an unknownbackendname. In a recommendation such a config fails each candidate that reads it: with one config, each candidate that runs the KV router with theaisprefill load model, and with a list, each such candidate of the mode that reads the config. No prediction and no candidate reads adecodeconfig. Candidates that read a config the perf model accepts and candidates withrouter.prefill_load_model.type: nonestill run. When no candidate is feasible, the run ends withno feasible candidate found; otherwise it writes a recommendation from the feasible candidates. -
Deprecated. Use
router.ais_perf_model: {use: engine}or a perf model config. Removed in v1.9. A section that writesrouter.prefill_load_model.type: ais, alone or amongchoices, withoutrouter.ais_perf_modelstill works and prints one warning:router.prefill_load_model.type: ais without router.ais_perf_model is deprecated and will be removed in v1.9; use router.ais_perf_model: {use: engine} (or a perf model config when the engine does not use an AIS perf model).Arecommendsection that does not write the type is not this form and prints no warning. -
router.use_kv_events: falsereplays a router started with--no-router-kv-events: it indexes its own routing decisions, forgets them 120 s (the frontend’s--router-ttl-secsdefault) after the last one, and reads no engine KV events. Offline replay only. -
With
router.policy: kv_router,router.policy_config(predictonly) names the router policy YAML that the live router takes with--router-policy-config. The worker-selection policy it selects replaces the default cost function. The replay seed does not reach that policy, a policy that reads the clock reads wall time, androuter.conversation_affinitypins a session’s worker under every policy. -
With
router.policy: kv_router, each vLLM aggregated or prefill worker that setsengine.workers.<role>.kv_cache.kvcrgets thekv.fetchhint that the production KV router chooses, so it pulls the prompt prefix it lacks from the named peer’s host memory (see KV Cache Runner (KVCR) peer fetch). As in production, the router sends that hint only when the role’s hint policies includekv_fetch. The default cost function with nohintssends none, and the workers then pull nothing. To get hints, pointrouter.policy_configat a policy file that selects thekvcrworker-selection policy, which runskv_fetchby default:Set the role’s
hints: []to turn the defaultkv_fetchofkvcroff. To keep the default cost function, listkv_fetchunderworker_selection.<role>.hintsin that file (see Hint Policies):Without a policy file, the environment variable
DYN_ROUTER_WORKER_SELECTION_POLICY=kvcrselectskvcrfor every role, as it does for the frontend. Replay models the built-inkv_fetchpolicy only: it sends a hint for every copy source the router selects, does not apply themin_additional_blocksparameter, and does not run a custom hint policy. Decode workers of a disaggregated deployment get no hints, because replay feeds the router no KV events from the decode pool.round_robinsends no hints. Replay checks the role as the production router does at startup and fails with the same error: a role that listskv_fetchneeds an index that keeps the request’s block chain, whichrouter.use_kv_events: falsedoes not, and akvcrselection needs a hint policy that sends its copies. When the hint comes only from the defaultkv_fetchofkvcrand the index cannot keep the chain, replay does not fail: it sends no hints and logs one warning. Replay treats all workers as one transfer island. -
With KVCR-owned memory (
engine.workers.<role>.kv_cache.kvcr.local_g2), the router names a peer as a production router with a KV state agent does: each worker has one cache owner per rank, and a rank is named only for the prefix its KVCR-owned memory holds. A prefix that a peer holds only on its GPU or in the engine’s own host memory (engine.workers.<role>.kv_cache.host_offload) gives no hint. Withoutlocal_g2, any worker that holds the prefix on its GPU or in the engine’s own host memory can be the named peer. -
Blocks in KVCR-owned memory and on the KVCR disk tier (
engine.workers.<role>.kv_cache.kvcr.g3) reach the router as the cache owner’s host and disk residency, and count toward the worker’s overlap with the router’shost_cache_hit_weight(default0.75) anddisk_cache_hit_weight(default0.25). Theroutersection has no key for these weights; set them asparametersof the role’s policy in therouter.policy_configfile (see Tuning Guidelines). A disk block is never the source of akv.fetchhint. -
An aggregated or prefill worker that sets
engine.workers.<role>.kv_cache.prefix_match_unitcannot replay behind akv_routerthat reads engine KV events, even withrouter.overlap_score_credit: 0, because AISimulate does not yet export KV events withprefix_match_unit.round_robinreplays it. -
planner.policyisdisabledorenabled. Enabled settings use the productionPlannerConfigdefaults and normalization. The default target isthroughput, which enables load scaling and disables throughput scaling. Throughput scaling withtarget: slarequires both TTFT and ITL thresholds. -
planner.max_num_gpusmaps to Planner’smax_gpu_budget(default 8); concrete predictions also acceptmin_num_gpusformin_gpu_budget(default -1, no floor). Recommendations carryoptimization.constraints.min_candidate_gpusinto that runtime floor when set. Other candidate constraints govern the static search;planner.max_num_gpusgoverns runtime scaling. -
Omitted Planner adjustment intervals use production defaults. Explicit
nulluses the default only for an effectively disabled scaling mode. Exported enabled configurations contain concrete intervals, including the load interval used for performance-model updates. -
evaluation.slaaccepts eithere2e_msalone orttft_msanditl_mstogether. The two forms are mutually exclusive.
Conversation Affinity
For AgentX trace replay, router.conversation_affinity uses Dynamo’s native hard binding
with kv_router and fixed aggregated or disaggregated worker pools. Online replay and
Planner-enabled replay are unsupported. Omitting the field preserves normal routing.
session (the default) binds each conversation. sibling_group binds siblings sharing a parent
within the same play and requires unambiguous lineage; the parent keeps its own binding.
Prefill and decode pools bind independently. ttl_seconds is the idle expiry in simulated
seconds, defaults to 300, and must be finite and between 1 and 31,536,000 inclusive.
Overrides
--set accepts dot-separated, schema-valid paths. The field does not need to be present in the
input YAML:
An override cannot create an unknown field. Override a complete mapping when changing a tagged
configuration shape, such as traffic.source.
Output
The output directory contains:
prediction.json preserves the Dynamo runner report, including summary metrics and available
Planner diagnostics. requests.jsonl is present only with --capture-per-request.
resource-runtime.json records the supervised execution: its status, resource budget,
peak_observed_rss_bytes, and wall time. execution-events.jsonl records the execution’s progress
events, starting with its resource plan. resource-plan.json is written only when the run is
refused for resources before it starts. --format changes standard output but not durable files.
The command exits with 0 on success, 1 for execution failure, 2 for CLI or configuration
errors, 3 when the run is refused or stopped by its execution.resources limits, 124 when
execution start-up or shutdown times out, and 130 when interrupted.