Skip to main content

MockEngineArgsBuilder

Struct MockEngineArgsBuilder 

Source
pub struct MockEngineArgsBuilder { /* private fields */ }
Expand description

Builder for MockEngineArgs.

Implementations§

Source§

impl MockEngineArgsBuilder

Source

pub fn engine_type(self, value: EngineType) -> Self

Engine type: vLLM, SGLang, or TensorRT-LLM simulation

Source

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.

Source

pub fn block_size(self, value: usize) -> Self

Source

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.

Source

pub fn max_num_seqs(self, value: Option<usize>) -> Self

Source

pub fn max_num_batched_tokens(self, value: Option<usize>) -> Self

Source

pub fn enable_prefix_caching(self, value: bool) -> Self

Source

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.

Source

pub fn enable_chunked_prefill(self, value: bool) -> Self

Source

pub fn speedup_ratio(self, value: f64) -> Self

Source

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.

Source

pub fn dp_size(self, value: u32) -> Self

Source

pub fn startup_time(self, value: Option<f64>) -> Self

Optional startup time in seconds to simulate engine initialization delay

Source

pub fn worker_type(self, value: WorkerType) -> Self

Worker type for disaggregated serving (Aggregated, Prefill, or Decode)

Source

pub fn planner_profile_data(self, value: Option<PathBuf>) -> Self

Original planner profile NPZ path used to materialize perf_model.

Source

pub fn perf_model(self, value: Arc<PerfModel>) -> Self

Performance model for timing predictions (not serialized, loaded from planner_profile_data)

Source

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.

Source

pub fn aic_system(self, value: Option<String>) -> Self

AIC GPU system name (e.g., “h200_sxm”). Required when aic_backend is set.

Source

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.

Source

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.

Source

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”).

Source

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.

Source

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.

Source

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.

Source

pub fn aic_gemm_dtype(self, value: Option<String>) -> Self

Weight dtype override for AIC latency prediction.

Source

pub fn aic_moe_dtype(self, value: Option<String>) -> Self

MoE kernel dtype override for AIC latency prediction.

Source

pub fn aic_fmha_dtype(self, value: Option<String>) -> Self

Activation dtype override for AIC latency prediction.

Source

pub fn aic_kv_cache_dtype(self, value: Option<String>) -> Self

KV-cache dtype override for AIC latency prediction.

Source

pub fn aic_comm_dtype(self, value: Option<String>) -> Self

Communication (collective) dtype override for AIC latency prediction.

Source

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.

Source

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).

Source

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.

Source

pub fn gpu_memory_utilization(self, value: Option<f64>) -> Self

GPU memory fraction for AIC KV capacity estimation with vLLM.

Source

pub fn mem_fraction_static(self, value: Option<f64>) -> Self

Static memory fraction for AIC KV capacity estimation with SGLang.

Source

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.

Source

pub fn enable_local_indexer(self, value: bool) -> Self

Enable worker-local KV indexer for tracking this worker’s own KV cache state

Source

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.

Source

pub fn handoff_session_timeout_ms(self, value: u64) -> Self

Absolute live handoff session timeout, excluding modeled transfer delay.

Source

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

Source

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.

Source

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.

Source

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.

Source

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.

Source

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>.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn reasoning(self, value: Option<ReasoningConfig>) -> Self

Reasoning/thinking token configuration. When set, the mocker wraps output in thinking boundary tokens.

Source

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.

Source

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.

Source

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).

Source

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.

Source

pub fn router_queue_policy(self, value: Option<RouterQueuePolicy>) -> Self

Optional replay-only override for the router queue policy.

Source

pub fn sglang(self, value: Option<SglangArgs>) -> Self

SGLang-specific configuration. Only used when engine_type == Sglang.

Source

pub fn trtllm(self, value: Option<TrtllmArgs>) -> Self

TensorRT-LLM-specific configuration. Only used when engine_type == Trtllm.

Source

pub fn build(self) -> Result<MockEngineArgs, MockEngineArgsBuilderError>

Builds a new MockEngineArgs.

§Errors

If a required field has not been initialized.

Trait Implementations§

Source§

impl Default for MockEngineArgsBuilder

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more