WeightOnlyQuantizationScenario
Robotics scenarios · Implementation: mlsysim/engine/scenario_definitions/robotics/proposers.py.
Construct this scenario with keyword inputs. The fields below show the types and defaults declared by this class.
One backbone priced at several weight formats against measurements of the same formats.
formats maps a label to its evaluation scenario; measured and scores map the same labels to a measured latency and a task score. group_size, scale_bits, and weight_bits price the per-group scale overhead of the deployed format.
Notes
Equation: relative gap = (modeled - measured latency) / measured latency; scale overhead = scale bits / (group size * weight bits).
Assumptions: Every label names the same workload and hardware configuration across modeled and measured mappings; group size and bit widths are positive.
Excludes: A universal quantization speedup, statistical uncertainty in measurements, and automatic quality validation.
References
Derivation: relative gap = (modeled - measured latency) / measured latency; scale overhead = scale bits / (group size * weight bits). The individual properties state units and intermediate accounting; this class introduces no fitted coefficient.
Examples
The named scenario supplies illustrative inputs; the output is calculated.
>>> from mlsysim import Scenarios
>>> case = Scenarios.OpenVlaOrinQuantization
>>> round(float(case.measured_speedup), 3)
2.5Attributes
| Name | Description |
|---|---|
| deployed | |
| formats | |
| group_size | |
| measured | |
| measured_speedup | Reference measured latency divided by deployed measured latency; inputs are |
| reference | |
| scale_bits | |
| scale_overhead | Scale-storage bits per weight divided by payload bits per weight, a fractional |
| score_drop | Reference task score minus deployed task score, in the supplied score’s units. |
| scores | |
| weight_bits |
Methods
| Name | Description |
|---|---|
| computed | Modeled total evaluation latency for the named format, with time units. |
| gap | Signed fractional latency error relative to the supplied measurement for the same |
computed
engine.scenario_types.WeightOnlyQuantizationScenario.computed(label)Modeled total evaluation latency for the named format, with time units.
Equation: return formats[label].result.t_total.
gap
engine.scenario_types.WeightOnlyQuantizationScenario.gap(label)Signed fractional latency error relative to the supplied measurement for the same label.
Equation: return ((computed(label) - measured[label]) / measured[label]).to('').magnitude.
formats
Type: Dict[str, VlaEvaluationScenario].
Declared default: required.
measured
Type: Dict[str, Quantity].
Declared default: required.
scores
Type: Dict[str, float].
Declared default: required.
deployed
Type: str.
Declared default: required.
reference
Type: str.
Declared default: required.
group_size
Type: int.
Declared default: required.
scale_bits
Type: int.
Declared default: required.
weight_bits
Type: int.
Declared default: required.
measured_speedup
engine.scenario_types.WeightOnlyQuantizationScenario.measured_speedup
Reference measured latency divided by deployed measured latency; inputs are source-reported data.
Equation: return (measured[reference] / measured[deployed]).to('').magnitude.
score_drop
engine.scenario_types.WeightOnlyQuantizationScenario.score_drop
Reference task score minus deployed task score, in the supplied score’s units.
Equation: return scores[reference] - scores[deployed].
scale_overhead
engine.scenario_types.WeightOnlyQuantizationScenario.scale_overhead
Scale-storage bits per weight divided by payload bits per weight, a fractional overhead.
Equation: return scale_bits / group_size / weight_bits.