dynamo.mocker
dynamo.mocker publishes 5 classes and 16 functions. Source: components/src/dynamo/mocker/__init__.py
MockEngineArgs (class)
ProfileDataResult (class)
Result of processing —planner-profile-data argument. Cleans up tmpdir on deletion.
components/src/dynamo/mocker/args.py#L35
Public methods
init
No summary available.
ReasoningConfig (class)
No summary available.
lib/bindings/python/src/dynamo/_core.pyi#L1928
Public methods
init
No summary available.
SglangArgs (class)
No summary available.
lib/bindings/python/src/dynamo/_core.pyi#L1937
Public methods
init
No summary available.
TrtllmArgs (class)
No summary available.
lib/bindings/python/src/dynamo/_core.pyi#L1949
Public methods
init
No summary available.
apply_worker_engine_args_overrides (function)
build_mocker_engine_args (function)
build_runtime_config (function)
compute_stagger_delay (function)
Compute the stagger delay based on worker count to give the frontend time to process registrations. Returns the delay in seconds between worker launches.
graceful_shutdown (function)
Shutdown dynamo distributed runtime instances. The endpoints will be immediately invalidated so no new requests will be accepted.
launch_workers (function)
Launch mocker worker(s) with isolated DistributedRuntime instances.
Each worker gets its own DistributedRuntime, which means:
- Separate etcd/NATS connections
- Separate Component instances (no shared overhead)
- Independent service registration and stats scraping
- But still sharing the same tokio runtime (efficient)
load_mocker_engine_args (function)
main (function)
parse_args (function)
Parse command-line arguments for the Dynamo mocker engine.
Returns
argparse.Namespace— argparse.Namespace: Parsed command-line arguments.
parse_bootstrap_ports (function)
Parse comma-separated bootstrap ports string into list of integers.
positive_int (function)
prefetch_model (function)
Resolve model_path to a local directory, fetching config/tokenizer if needed.
fetch_model returns the cached snapshot directory without contacting the
hub when config.json and the tokenizer files are already present, and downloads
only those files otherwise. Resolving once here means neither the workers nor
the KV-bytes estimate below resolve a hub ID over the network. Returns the
original path on failure so callers degrade to their previous behavior.
resolve_planner_profile_data (function)
Resolve —planner-profile-data to an NPZ file path.
Handles backward compatibility by accepting either:
- A mocker-format NPZ file (returned as-is)
- A profiler-style results directory (converted to mocker-format NPZ)
Parameters
Path from —planner-profile-data argument.
Returns
ProfileDataResult— ProfileDataResult with npz_path and optional tmpdir for cleanup.
Raises
FileNotFoundError— If path doesn’t contain valid profile data in any supported format.
run_mocker_trace_replay (function)
validate_worker_type_args (function)
Resolve disaggregation mode from —disaggregation-mode or legacy boolean flags. Raises ValueError if validation fails.
worker (function)
Main worker function that launches mocker instances.
Each mocker gets its own DistributedRuntime instance for true isolation, while still sharing the same event loop and tokio runtime.