pub struct MockEngineArgsBuilder { /* private fields */ }Expand description
Builder for MockEngineArgs.
Implementations§
Source§impl MockEngineArgsBuilder
impl MockEngineArgsBuilder
Sourcepub fn engine_type(self, value: EngineType) -> Self
pub fn engine_type(self, value: EngineType) -> Self
Engine type: vLLM, SGLang, or TensorRT-LLM simulation
Sourcepub fn num_gpu_blocks(self, value: usize) -> Self
pub fn num_gpu_blocks(self, value: usize) -> Self
Usable simulated G1 capacity. This preserves the mocker’s historical
convention across backends. A raw vLLM num_gpu_blocks value also
includes its reserved null block, so parity runs configure real vLLM
with one additional total block.
pub fn block_size(self, value: usize) -> Self
Sourcepub fn max_model_len(self, value: Option<usize>) -> Self
pub fn max_model_len(self, value: Option<usize>) -> Self
Optional vLLM sequence-length limit, including prompt and generated tokens. Requests with no room to generate are rejected before admission.
pub fn max_num_seqs(self, value: Option<usize>) -> Self
pub fn max_num_batched_tokens(self, value: Option<usize>) -> Self
pub fn enable_prefix_caching(self, value: bool) -> Self
Sourcepub fn g1_backend(self, value: G1Backend) -> Self
pub fn g1_backend(self, value: G1Backend) -> Self
Requested G1 block-manager implementation for the shared vLLM/TRT-LLM
scheduler. None selects native unless legacy offload requires KVBM.
Ignored by the SGLang scheduler, which uses SglangKvManager.
pub fn enable_chunked_prefill(self, value: bool) -> Self
pub fn speedup_ratio(self, value: f64) -> Self
Sourcepub fn decode_speedup_ratio(self, value: f64) -> Self
pub fn decode_speedup_ratio(self, value: f64) -> Self
Additional speedup multiplier applied only to decode steps.
Models speculative decoding (e.g. Eagle) where decode throughput improves
without affecting prefill latency. The effective decode speedup is
speedup_ratio * decode_speedup_ratio.
pub fn dp_size(self, value: u32) -> Self
Sourcepub fn startup_time(self, value: Option<f64>) -> Self
pub fn startup_time(self, value: Option<f64>) -> Self
Optional startup time in seconds to simulate engine initialization delay
Sourcepub fn worker_type(self, value: WorkerType) -> Self
pub fn worker_type(self, value: WorkerType) -> Self
Worker type for disaggregated serving (Aggregated, Prefill, or Decode)
Sourcepub fn planner_profile_data(self, value: Option<PathBuf>) -> Self
pub fn planner_profile_data(self, value: Option<PathBuf>) -> Self
Original planner profile NPZ path used to materialize perf_model.
Sourcepub fn perf_model(self, value: Arc<PerfModel>) -> Self
pub fn perf_model(self, value: Arc<PerfModel>) -> Self
Performance model for timing predictions (not serialized, loaded from planner_profile_data)
Sourcepub fn aic_backend(self, value: Option<String>) -> Self
pub fn aic_backend(self, value: Option<String>) -> Self
If set, indicates direct AIC SDK calls should be used. The value is the backend name (e.g., “sglang”, “vllm”). The Python layer reads this and overrides perf_model with an Aiconfigurator callback.
Sourcepub fn aic_system(self, value: Option<String>) -> Self
pub fn aic_system(self, value: Option<String>) -> Self
AIC GPU system name (e.g., “h200_sxm”). Required when aic_backend is set.
Sourcepub fn aic_backend_version(self, value: Option<String>) -> Self
pub fn aic_backend_version(self, value: Option<String>) -> Self
AIC backend engine version (e.g., “0.12.0” for vLLM, “0.5.6.post2” for SGLang). If None, uses the default version for the backend.
Sourcepub fn aic_tp_size(self, value: Option<usize>) -> Self
pub fn aic_tp_size(self, value: Option<usize>) -> Self
Tensor parallel size for AIC latency prediction. Only affects AIC performance model lookups, not mocker scheduling.
Sourcepub fn aic_model_path(self, value: Option<String>) -> Self
pub fn aic_model_path(self, value: Option<String>) -> Self
HuggingFace model path for AIC latency prediction (e.g., “nvidia/Llama-3.1-8B-Instruct-FP8”).
Sourcepub fn aic_moe_tp_size(self, value: Option<usize>) -> Self
pub fn aic_moe_tp_size(self, value: Option<usize>) -> Self
MoE tensor-parallel size for AIC latency prediction (e.g., 4 for pure MoE-TP). Required for MoE models; must satisfy: aic_tp_size * aic_attention_dp_size == aic_moe_tp_size * aic_moe_ep_size.
Sourcepub fn aic_moe_ep_size(self, value: Option<usize>) -> Self
pub fn aic_moe_ep_size(self, value: Option<usize>) -> Self
MoE expert-parallel size for AIC latency prediction (e.g., 4 for pure EP). Required for MoE models; must satisfy: aic_tp_size * aic_attention_dp_size == aic_moe_tp_size * aic_moe_ep_size.
Sourcepub fn aic_attention_dp_size(self, value: Option<usize>) -> Self
pub fn aic_attention_dp_size(self, value: Option<usize>) -> Self
Attention data-parallel size for AIC latency prediction (default: 1).
Corresponds to the dp dimension in AIC CLI output.
Must satisfy: aic_tp_size * aic_attention_dp_size == aic_moe_tp_size * aic_moe_ep_size.
Sourcepub fn aic_gemm_dtype(self, value: Option<String>) -> Self
pub fn aic_gemm_dtype(self, value: Option<String>) -> Self
Weight dtype override for AIC latency prediction.
Sourcepub fn aic_moe_dtype(self, value: Option<String>) -> Self
pub fn aic_moe_dtype(self, value: Option<String>) -> Self
MoE kernel dtype override for AIC latency prediction.
Sourcepub fn aic_fmha_dtype(self, value: Option<String>) -> Self
pub fn aic_fmha_dtype(self, value: Option<String>) -> Self
Activation dtype override for AIC latency prediction.
Sourcepub fn aic_kv_cache_dtype(self, value: Option<String>) -> Self
pub fn aic_kv_cache_dtype(self, value: Option<String>) -> Self
KV-cache dtype override for AIC latency prediction.
Sourcepub fn aic_comm_dtype(self, value: Option<String>) -> Self
pub fn aic_comm_dtype(self, value: Option<String>) -> Self
Communication (collective) dtype override for AIC latency prediction.
Sourcepub fn aic_nextn(self, value: Option<usize>) -> Self
pub fn aic_nextn(self, value: Option<usize>) -> Self
MTP/Eagle speculative-decoding draft-token count (1..=5). The mocker samples accepted drafts while AIC supplies undiscounted verification-round latency.
Sourcepub fn aic_nextn_accept_rates(self, value: Option<String>) -> Self
pub fn aic_nextn_accept_rates(self, value: Option<String>) -> Self
Conditional acceptance rates for draft tokens, comma-separated. Entry i is P(draft i accepted | every earlier draft was accepted).
Sourcepub fn aic_mtp_seed(self, value: u64) -> Self
pub fn aic_mtp_seed(self, value: u64) -> Self
Base RNG seed for MTP burst sampling. Worker rank is added with wrapping arithmetic before constructing each worker-local sampler.
Sourcepub fn gpu_memory_utilization(self, value: Option<f64>) -> Self
pub fn gpu_memory_utilization(self, value: Option<f64>) -> Self
GPU memory fraction for AIC KV capacity estimation with vLLM.
Sourcepub fn mem_fraction_static(self, value: Option<f64>) -> Self
pub fn mem_fraction_static(self, value: Option<f64>) -> Self
Static memory fraction for AIC KV capacity estimation with SGLang.
Sourcepub fn free_gpu_memory_fraction(self, value: Option<f64>) -> Self
pub fn free_gpu_memory_fraction(self, value: Option<f64>) -> Self
Fraction of free GPU memory (after weights/buffers) allocated to the KV
cache, for AIC KV capacity estimation with TRT-LLM. Mirrors TRT-LLM’s
KvCacheConfig.free_gpu_memory_fraction. Unlike vLLM’s
gpu_memory_utilization (a fraction of total memory), this is a
fraction of what remains after the model is loaded.
Sourcepub fn enable_local_indexer(self, value: bool) -> Self
pub fn enable_local_indexer(self, value: bool) -> Self
Enable worker-local KV indexer for tracking this worker’s own KV cache state
Sourcepub fn bootstrap_port(self, value: Option<u16>) -> Self
pub fn bootstrap_port(self, value: Option<u16>) -> Self
Bootstrap port for disaggregated serving rendezvous. Prefill workers listen on this port; decode workers connect to it. If None, bootstrap rendezvous is disabled.
Sourcepub fn handoff_session_timeout_ms(self, value: u64) -> Self
pub fn handoff_session_timeout_ms(self, value: u64) -> Self
Absolute live handoff session timeout, excluding modeled transfer delay.
Sourcepub fn kv_bytes_per_token(self, value: Option<usize>) -> Self
pub fn kv_bytes_per_token(self, value: Option<usize>) -> Self
KV cache bytes per token, auto-computed from model config by Python CLI. Formula: num_layers * 2 * num_kv_heads * head_dim * dtype_bytes
Sourcepub fn kv_transfer_bandwidth(self, value: Option<f64>) -> Self
pub fn kv_transfer_bandwidth(self, value: Option<f64>) -> Self
KV cache transfer bandwidth in GB/s for disaggregated serving latency simulation. Default: 64.0 (inter-node InfiniBand). Set to 0 to disable KV transfer delay. For intra-node NVLink, typical value is ~450.
Sourcepub fn kv_transfer_timing_mode(self, value: KvTransferTimingMode) -> Self
pub fn kv_transfer_timing_mode(self, value: KvTransferTimingMode) -> Self
Selects whether disaggregated transfer timing charges the full prompt or only the physical prompt footprint missing at the destination.
Sourcepub fn num_g2_blocks(self, value: Option<usize>) -> Self
pub fn num_g2_blocks(self, value: Option<usize>) -> Self
KVBM G2 (host DRAM) block capacity. When the kvbm-offload
feature is enabled, setting this explicitly opts the mocker into
G2 offload simulation. When unset or set to 0, no G2 offload engine
is attached.
Sourcepub fn num_g3_blocks(self, value: Option<usize>) -> Self
pub fn num_g3_blocks(self, value: Option<usize>) -> Self
KVBM G3 shared lower-tier block capacity. Positive values require
num_g2_blocks and a resolvable KV block byte size; 0 disables G3.
Sourcepub fn enable_g4_storage(self, value: bool) -> Self
pub fn enable_g4_storage(self, value: bool) -> Self
Enable KVBM mock G4 object-storage simulation. G4 stages through G2
and uses object presence operations instead of a BlockManager<G4>.
Sourcepub fn offload_batch_size(self, value: Option<usize>) -> Self
pub fn offload_batch_size(self, value: Option<usize>) -> Self
Batch size for the G1→G2 offload pipeline. Offloads are grouped
into batches of this size before being handed to the worker.
Only consulted when the kvbm-offload feature is enabled;
falls back to the KvbmOffloadConfig default when unset or 0.
Sourcepub fn bandwidth_g1_to_g2_gbps(self, value: Option<f64>) -> Self
pub fn bandwidth_g1_to_g2_gbps(self, value: Option<f64>) -> Self
G1→G2 offload bandwidth in GB/s for the PS-queue simulation.
Only consulted when the kvbm-offload feature is enabled;
falls back to the KvbmOffloadConfig default (host DRAM PCIe
ballpark) when unset.
Sourcepub fn bandwidth_g2_to_g1_gbps(self, value: Option<f64>) -> Self
pub fn bandwidth_g2_to_g1_gbps(self, value: Option<f64>) -> Self
G2→G1 onboard bandwidth in GB/s for the PS-queue simulation.
Only consulted when the kvbm-offload feature is enabled;
falls back to the KvbmOffloadConfig default when unset.
Sourcepub fn bandwidth_g2_to_g3_gbps(self, value: Option<f64>) -> Self
pub fn bandwidth_g2_to_g3_gbps(self, value: Option<f64>) -> Self
G2→G3 offload bandwidth in GB/s for the shared PS-queue simulation.
Sourcepub fn bandwidth_g3_to_g2_gbps(self, value: Option<f64>) -> Self
pub fn bandwidth_g3_to_g2_gbps(self, value: Option<f64>) -> Self
G3→G2 staging bandwidth in GB/s for the shared PS-queue simulation.
Sourcepub fn bandwidth_g2_to_g4_gbps(self, value: Option<f64>) -> Self
pub fn bandwidth_g2_to_g4_gbps(self, value: Option<f64>) -> Self
G2→G4 object offload bandwidth in GB/s for the shared PS-queue simulation.
Sourcepub fn bandwidth_g4_to_g2_gbps(self, value: Option<f64>) -> Self
pub fn bandwidth_g4_to_g2_gbps(self, value: Option<f64>) -> Self
G4→G2 object staging bandwidth in GB/s for the shared PS-queue simulation.
Sourcepub fn reasoning(self, value: Option<ReasoningConfig>) -> Self
pub fn reasoning(self, value: Option<ReasoningConfig>) -> Self
Reasoning/thinking token configuration. When set, the mocker wraps output in thinking boundary tokens.
Sourcepub fn response_replay_trace_path(self, value: Option<PathBuf>) -> Self
pub fn response_replay_trace_path(self, value: Option<PathBuf>) -> Self
Optional Mooncake trace with exact output token IDs keyed by
output_replay_id annotations. Direct replay paths carry the same token
IDs on DirectRequest and do not need this lookup.
Sourcepub fn zmq_kv_events_port(self, value: Option<u16>) -> Self
pub fn zmq_kv_events_port(self, value: Option<u16>) -> Self
ZMQ port for publishing KV events in vLLM’s native wire format. When set, the scheduler publishes to a ZMQ PUB socket instead of directly to NATS. A KvEventPublisher relay subscribes to this socket and forwards events to NATS.
Sourcepub fn zmq_replay_port(self, value: Option<u16>) -> Self
pub fn zmq_replay_port(self, value: Option<u16>) -> Self
ZMQ ROUTER port for replay of buffered KV event batches.
When set alongside zmq_kv_events_port, the mocker binds a ROUTER socket
that streams back buffered batches by sequence number on request.
Port is offset by dp_rank (replay_port + dp_rank).
Sourcepub fn preemption_mode(self, value: PreemptionMode) -> Self
pub fn preemption_mode(self, value: PreemptionMode) -> Self
Preemption mode for decode eviction under memory pressure. Lifo (default) evicts the newest request; Fifo evicts the oldest.
Sourcepub fn router_queue_policy(self, value: Option<RouterQueuePolicy>) -> Self
pub fn router_queue_policy(self, value: Option<RouterQueuePolicy>) -> Self
Optional replay-only override for the router queue policy.
Sourcepub fn sglang(self, value: Option<SglangArgs>) -> Self
pub fn sglang(self, value: Option<SglangArgs>) -> Self
SGLang-specific configuration. Only used when engine_type == Sglang.
Sourcepub fn trtllm(self, value: Option<TrtllmArgs>) -> Self
pub fn trtllm(self, value: Option<TrtllmArgs>) -> Self
TensorRT-LLM-specific configuration. Only used when engine_type == Trtllm.