engine.solvers.proposer
engine.solvers.proposer
Learned-proposer solvers: what one fresh evaluation costs, and how long its evidence lasts.
Domain implementations behind mlsysim.solvers (the public import path, derived from engine.solvers.__init__). The equations live in physics.transformer (the roofline latency of one vision-language-action evaluation) and physics.robotics (chunk streaming, the renewal schedule, the tracked evidence horizon); these models compose them for one stated machine or situation (added 2026-10-20).
Classes
| Name | Description |
|---|---|
| DecoderFamiliesModel | One fresh H-step chunk from a VLA backbone, for each decoder family. |
| EvidenceHorizonModel | How long a chunk’s evidence stays true for a tracked target, against its renewal schedule. |
| ProposerTrafficModel | Weight traffic of a machine’s two learned proposers on its shared memory bus. |
| VlaEvaluationModel | One fresh evaluation of a decoder-only VLA backbone on one processor. |
DecoderFamiliesModel
engine.solvers.proposer.DecoderFamiliesModel()One fresh H-step chunk from a VLA backbone, for each decoder family.
Every family pays the backbone’s prefill. Binned autoregressive decoding emits horizon * action_dim tokens one sweep at a time; FAST emits fast_tokens compressed tokens one at a time; a parallel head folds the binned tokens into one longer prefill; a flow-matching expert runs expert_steps refinement steps, each max(compute, (expert weights + cached prefix KV) / B_sustained) (Black et al. 2024; Pertsch et al. 2025; Kim, Finn and Liang 2025).
Methods
| Name | Description |
|---|---|
| solve | Compare decoder schedules under a shared backbone and resource model. |
solve
engine.solvers.proposer.DecoderFamiliesModel.solve(
model,
processor,
weight_bytes_per_param,
input_tokens,
bus_efficiency,
compute_utilization,
horizon,
action_dim,
fast_tokens,
expert_params,
expert_steps,
expert_bytes_per_param,
kv_bytes_per_value,
renewal_period,
)Compare decoder schedules under a shared backbone and resource model.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| model | TransformerWorkload | Backbone with parameter count in param, layer count, and hidden width. | required |
| processor | HardwareNode | Device with positive FP16 compute throughput and memory bandwidth. An explicit fp16 override takes precedence over canonical peak_flops. | required |
| weight_bytes_per_param | Quantity | Positive backbone storage per parameter, in byte/param. | required |
| input_tokens | int | Positive prompt/prefix length processed before action generation. | required |
| bus_efficiency | float | Sustained memory-bandwidth fraction in (0, 1], supplied by the caller. | required |
| compute_utilization | float | Sustained fp16 compute fraction in (0, 1], supplied by the caller. | required |
| horizon | int | Positive number of action setpoints in one chunk. | required |
| action_dim | int | Positive tokens per setpoint in the binned autoregressive schedule. | required |
| fast_tokens | int | Positive compressed action-token count in the FAST-like schedule. | required |
| expert_params | Quantity | Nonnegative flow-expert parameter count, in param. | required |
| expert_steps | int | Nonnegative number of expert refinement passes after backbone prefill. | required |
| expert_bytes_per_param | Quantity | Positive stored bytes per expert parameter, in byte/param. | required |
| kv_bytes_per_value | Quantity | Positive bytes per cached key or value element, in bytes. | required |
| renewal_period | Quantity | Positive interval between requested chunks, in seconds. | required |
Returns
| Name | Type | Description |
|---|---|---|
| DecoderFamiliesResult | Modeled decoder times in ms, expert/prefix storage in MB, token counts, and dimensionless time ratios. No quality-equivalence or memory-capacity guarantee is implied by comparing these schedules. |
See Also
VlaEvaluationModel.solve : Evaluate the shared backbone under one decoder schedule.
Notes
Equation: binned_tokens = horizon * action_dim. Each autoregressive schedule uses VlaEvaluationModel; the parallel schedule extends prefill. An expert pass takes max(2 * expert_params * horizon / effective_compute, (expert_weights + prefix_kv) / sustained_bandwidth), where prefix_kv = 2 * layers * hidden_dim * kv_bytes_per_value * input_tokens. Expert total = backbone_prefill + expert_steps * expert_pass_time. Assumptions: shared backbone inputs and rates, full-width keys and values, fixed token/refinement counts, and repeated prefix-cache reads per expert pass. Expert work uses parameter-linear FLOPs for each horizon position. Excludes: expert attention/activation traffic beyond the specified prefix reads, launch overhead, residency checks, and decoder-quality prediction.
References
Derivation: count one key and one value at each layer/hidden coordinate for each prefix token; combine its byte transfer with an expert weight sweep. The maximum of the computed resource times is the pass lower bound. Decoder token counts and expert iterations are scenario inputs, not measured performance or equal-quality guarantees.
Examples
A constructed chunk exposes its binned token count directly.
>>> from mlsysim import Models, Hardware, Q_
>>> result = DecoderFamiliesModel().solve(
... Models.Language.Llama3_8B, Hardware.Edge.JetsonAGXOrin,
... Q_(2, 'byte/param'), 8, 0.5, 0.5, 2, 3, 4,
... Q_(1000, 'param'), 2, Q_(2, 'byte/param'), Q_(2, 'byte'),
... Q_(1, 'second'))
>>> result.binned_tokens == 2 * 3
TrueEvidenceHorizonModel
engine.solvers.proposer.EvidenceHorizonModel()How long a chunk’s evidence stays true for a tracked target, against its renewal schedule.
Untracked, a target at speed v uses up the margin r_tol - e_0 in (r_tol - e_0) / v. Tracked, only a residual acceleration remains, so the evidence horizon is sqrt(2 (r_tol - e_0) / a_slip) (calc_tracked_evidence_horizon). The chunk policy’s renewal schedule (calc_chunk_renewal_schedule) gives the evidence age at replacement (renewal period plus inference), the setpoints one renewal needs, and the span one chunk supplies; drift over an age T is a_slip T^2 / 2.
Methods
| Name | Description |
|---|---|
| solve | Compare tracking-error growth with a chunk-renewal schedule. |
solve
engine.solvers.proposer.EvidenceHorizonModel.solve(
tolerance,
initial_error,
target_speed,
slip_acceleration,
chunk_rate,
chunk_step,
chunk_horizon,
inference_latency,
)Compare tracking-error growth with a chunk-renewal schedule.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| tolerance | Quantity | Positive permitted position-error magnitude, in meters. | required |
| initial_error | Quantity | Nonnegative current error, in meters, smaller than tolerance. | required |
| target_speed | Quantity | Positive untracked target speed used for the comparison deadline, in m/s. | required |
| slip_acceleration | Quantity | Positive residual acceleration after tracking, in meters per second squared. | required |
| chunk_rate | Quantity | Positive periodic chunk-renewal frequency, in Hz. | required |
| chunk_step | Quantity | Positive interval between chunk setpoints, in seconds. | required |
| chunk_horizon | int | Positive number of setpoints; must cover renewal plus inference latency. | required |
| inference_latency | Quantity | Positive evaluation time, in seconds, less than the renewal period. | required |
Returns
| Name | Type | Description |
|---|---|---|
| EvidenceHorizonResult | Spatial margins/drifts in mm, horizons and schedule times in ms, and setpoint counts. fits means replacement age is below the modeled error horizon; it is not an assurance of collision avoidance or tracking stability. |
Raises
| Name | Type | Description |
|---|---|---|
| ValueError | If the renewal period is not aligned to whole setpoint intervals, the inference misses its next renewal, or the chunk cannot bridge replacement. |
See Also
mlsysim.physics.robotics.calc_tracked_evidence_horizon : Solve the constant-acceleration error horizon. mlsysim.physics.robotics.calc_chunk_renewal_schedule : Account for renewal alignment and replacement age.
Notes
Equation: margin = tolerance - initial_error. Untracked deadline = margin / target_speed; tracked horizon = sqrt(2 * margin / slip_acceleration). Replacement age = 1 / chunk_rate + inference_latency, and position drift at age T is slip_acceleration * T**2 / 2. A chunk spans chunk_horizon * chunk_step; fits compares replacement age with horizon. Assumptions: initial velocity error has been removed by tracking, residual acceleration is constant, and renewal aligns with the setpoint grid. Excludes: jerk, measurement noise growth, missed renewals, transport/admission delays, obstacle motion beyond the stated target model, and control stability.
References
Derivation: integrate constant residual acceleration twice to obtain position error a*T**2/2, then solve for the remaining margin. Compose this horizon with the linked periodic-renewal schedule; the comparison inherits both models’ assumptions and is not a certified safety envelope.
Examples
The constructed schedule’s replacement age includes inference latency.
>>> from mlsysim import Q_
>>> result = EvidenceHorizonModel().solve(
... Q_(1, 'm'), Q_(0.1, 'm'), Q_(1, 'm/s'), Q_(1, 'm/s^2'),
... Q_(10, 'Hz'), Q_(0.01, 's'), 20, Q_(0.02, 's'))
>>> result.age_at_replacement == result.renewal_period + Q_(0.02, 's')
TrueProposerTrafficModel
engine.solvers.proposer.ProposerTrafficModel()Weight traffic of a machine’s two learned proposers on its shared memory bus.
The intent model’s 16-bit sweep M / (B eta) bounds its fresh rate; spread over a chunk of H setpoints it is t / H per setpoint (calc_action_chunk_streaming_amortization). One sweep per setpoint at the setpoint rate would demand f_setpoint M; one per chunk divides that by H. In operation the deployed intent model sweeps its weights once per action token per evaluation (D M_deployed f_intent) and the chunk policy once per renewal (M_chunk f_chunk); their sum against the sustained bandwidth is the proposers’ share of the bus (weight traffic only).
Methods
| Name | Description |
|---|---|
| solve | Account for two learned proposers sharing a machine’s memory bus. |
solve
engine.solvers.proposer.ProposerTrafficModel.solve(
machine,
fp16_bytes_per_param,
)Account for two learned proposers sharing a machine’s memory bus.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| machine | MobileManipulatorPlatform | Platform providing intent/chunk models, stored intent weights, processor bandwidth, DRAM efficiency, chunk horizon/step, proposer rates, permission rate, and intent latency breakdown. Rates are in Hz and times in seconds; bandwidth, horizon, and step must be positive and efficiency in (0, 1]. | required |
| fp16_bytes_per_param | Quantity | Positive reference storage per parameter, in byte/param. The FP16 comparison normally supplies two bytes; deployed intent storage comes separately from machine.intent_weight_memory. | required |
Returns
| Name | Type | Description |
|---|---|---|
| ProposerTrafficResult | Weight storage in GB, sweep times in ms, frequencies in Hz, traffic in GB/s, and dimensionless bus/duty ratios. A bus share above one indicates demand exceeding the supplied bandwidth model, not measured utilization. |
See Also
mlsysim.physics.robotics.calc_action_chunk_streaming_amortization : Divide sweep time among supplied chunk setpoints.
Notes
Equation: sustained_bandwidth = peak_bandwidth * dram_efficiency; sweep_time = weights / sustained_bandwidth. Intent traffic is action_dim * deployed_intent_weights * intent_rate, and chunk traffic is chunk_weights * chunk_rate. Their sum divided by sustained_bandwidth is proposer_share. The single-sweep chunk comparison divides reference weight traffic at the setpoint rate by chunk_horizon. Assumptions: a full intent-model weight sweep per action dimension and a full chunk-model sweep per renewal. The machine supplies deployed weight precision and latency assumptions independently of the FP16 comparison. Excludes: KV/activation traffic, vision encoding, other bus clients, cache reuse, compute contention, scheduling jitter, and physical safety claims.
References
Derivation: weight bytes per evaluation multiplied by evaluations per second give bandwidth demand; sum both proposer streams and divide by supplied sustained bandwidth. The linked chunk-streaming helper derives sweep amortization per setpoint. This is explicit traffic accounting, not a hardware benchmark or a model of application-level success.
Examples
The registered platform’s total traffic is the sum of its two streams.
>>> from mlsysim import Embodied, Q_
>>> machine = Embodied.MobileManipulator.WarehouseMobileManipulator
>>> result = ProposerTrafficModel().solve(machine, Q_(2, 'byte/param'))
>>> result.proposer_traffic == result.intent_traffic + result.chunk_traffic
TrueVlaEvaluationModel
engine.solvers.proposer.VlaEvaluationModel()One fresh evaluation of a decoder-only VLA backbone on one processor.
Wraps calc_vla_inference_latency (compute/memory bounds for prefill, then action_tokens - 1 decode passes, or one longer prefill under parallel decoding) and adds the roofline coordinates of its two phases: the ridge R_peak / BW_peak at the 16-bit rate, the prefill intensity (linear FLOPs per weight byte, about S at 16-bit weights), and the decode intensity (2 N FLOP per weight sweep per weight byte, 1 at 16-bit weights).
Methods
| Name | Description |
|---|---|
| solve | Estimate one decoder-backbone evaluation and its resource bounds. |
solve
engine.solvers.proposer.VlaEvaluationModel.solve(
model,
processor,
weight_bytes_per_param,
input_tokens,
action_tokens,
bus_efficiency,
compute_utilization,
parallel_decode=False,
)Estimate one decoder-backbone evaluation and its resource bounds.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| model | TransformerWorkload | Decoder geometry with parameter count in param, layer count, and hidden width. The supplied model represents the language/action backbone. | required |
| processor | HardwareNode | Processor with positive FP16 compute throughput and memory bandwidth. An explicit fp16 override takes precedence over canonical peak_flops. | required |
| weight_bytes_per_param | Quantity | Positive stored bytes per parameter, in byte/param. Weight quantization changes traffic while arithmetic still uses the processor’s fp16 rate. | required |
| input_tokens | int | Positive count of prompt and image-patch tokens entering the backbone. | required |
| action_tokens | int | Positive number of generated action tokens. | required |
| bus_efficiency | float | Caller-supplied sustained fraction of peak memory bandwidth in (0, 1]. | required |
| compute_utilization | float | Caller-supplied sustained fraction of fp16 compute throughput in (0, 1]. | required |
| parallel_decode | bool | If True, process input and action placeholders in one bidirectional pass; otherwise prefill produces the first token before serial decoding. | False |
Returns
| Name | Type | Description |
|---|---|---|
| VlaEvaluationResult | Weight storage in GB, work in FLOPs, intensities in FLOP/byte, phase times in ms, and reciprocal evaluation rates in Hz. These are modeled resource bounds; this result does not check model residency or control safety. |
See Also
mlsysim.physics.transformer.calc_vla_inference_latency : Compose compute and weight-traffic bounds for each pass. mlsysim.physics.transformer.calc_transformer_prefill_flops : Count parameter-linear and attention prefill work.
Notes
Equation: weights = parameters * weight_bytes_per_param. Each pass takes max(compute_work / effective_compute, weights / effective_bandwidth). Serial decode repeats its pass action_tokens - 1 times; parallel decode instead extends prefill to input_tokens + action_tokens. Prefill work includes the helper’s attention term, while reported prefill_intensity intentionally uses only parameter-linear work. Assumptions: one full weight read per pass, compute/memory overlap within a pass, fp16 arithmetic, and fixed caller-provided utilization factors. The peak ridge uses peak rates, not efficiency-adjusted rates. Excludes: the vision encoder, decode attention and KV traffic, runtime workspaces, launch overhead, memory admission, and closed-loop dynamics.
References
Derivation: compose the prefill and serial-pass bounds implemented and sourced in calc_vla_inference_latency; divide work by weight bytes for arithmetic intensity and invert modeled time for the evaluation rate. The decoder-family choice is an assumed execution pattern, not a reproduction of a published robot’s latency measurement.
Examples
A one-token constructed request has no post-prefill decode pass.
>>> from mlsysim import Models, Hardware, Q_
>>> result = VlaEvaluationModel().solve(
... Models.Language.Llama3_8B, Hardware.Edge.JetsonAGXOrin,
... Q_(2, 'byte/param'), 8, 1, 0.5, 0.5)
>>> result.decode_steps == 0 and result.t_total == result.t_prefill
True