UpdateWorkingSetScenario
Training scenarios · Implementation: mlsysim/engine/scenario_definitions/training.py.
Construct this scenario with keyword inputs. The fields below show the types and defaults declared by this class.
A full on-device update with Adam: its working set and the DRAM bytes of one step.
Gradients equal the weights; the optimizer keeps optimizer_moments weight-sized arrays; saved activations are activation_factor times the weight bytes (activation_factor_high bounds the quoted range).
Notes
Equation: Working set=weights+gradients+optimizer_state+saved_activations; traffic delegates to calc_update_step_traffic.
Assumptions: Gradients use weight width; optimizer moments are weight-sized arrays; activation factors are declared inputs.
Excludes: Master-weight precision differences, allocator reserve, and runtime workspace.
References
Implementation references: mlsysim.physics.calc_update_step_traffic. These helper contracts state the source assumptions; the scenario binds their inputs and derives the displayed ratios and budgets.
Examples
The named registry scenario supplies the stated inputs; this is a modeled calculation, not a new measurement.
>>> from mlsysim import Scenarios
>>> scenario = Scenarios.PhoneFullUpdateWorkingSet
>>> round(scenario.amplification, 6)
9.0Attributes
| Name | Description |
|---|---|
| activation_factor | |
| activation_factor_high | |
| activations | Saved activation MB under the supplied activation-to-weight multiplier. |
| amplification | Total working set divided by weight bytes, a dimensionless multiplier. |
| bandwidth | |
| bytes_per_param | |
| ceiling | Upper working-set-to-weight ratio using activation_factor_high rather than the nominal activation multiplier. |
| floor | Persistent-state-to-weight ratio before any saved activations are added. |
| gradients | Gradient storage in MB, assumed equal to weight storage in this scenario. |
| optimizer_moments | |
| optimizer_state | Optimizer-state MB: optimizer_moments weight-sized arrays; storage widths are not inferred from a runtime optimizer. |
| parameters | |
| persistent | Activation-free MB: weights plus gradients plus optimizer state. |
| step_floor | Traffic-only latency floor in ms: step_traffic / bandwidth; requires bandwidth and excludes compute/overlap effects. |
| step_traffic | DRAM bytes per update in MB from calc_update_step_traffic; uses its declared read/write accounting, not a measured trace. |
| total | Working-set MB: persistent state plus the assumed saved activations. |
| traffic_ratio | Update-step traffic divided by weight storage; dimensionless bytes-moved amplification. |
| weight_read_share | Fraction of update traffic attributed to the helper’s weight-read component. |
| weight_reads | Weight-read portion of the update traffic in MB, returned by calc_update_step_traffic. |
| weights | Parameter storage in decimal MB: parameter count times the declared bytes per parameter. |
parameters
Type: float.
Declared default: required.
bytes_per_param
Type: Quantity.
Declared default: required.
optimizer_moments
Type: int.
Declared default: required.
activation_factor
Type: float.
Declared default: required.
activation_factor_high
Type: float.
Declared default: required.
bandwidth
Type: Optional[Quantity].
Declared default: None.
weights
engine.scenario_types.UpdateWorkingSetScenario.weights
Parameter storage in decimal MB: parameter count times the declared bytes per parameter.
Equation: (self.parameters * self.bytes_per_param).to(‘MB’)
gradients
engine.scenario_types.UpdateWorkingSetScenario.gradients
Gradient storage in MB, assumed equal to weight storage in this scenario.
Equation: self.weights
optimizer_state
engine.scenario_types.UpdateWorkingSetScenario.optimizer_state
Optimizer-state MB: optimizer_moments weight-sized arrays; storage widths are not inferred from a runtime optimizer.
Equation: (self.optimizer_moments * self.weights).to(‘MB’)
activations
engine.scenario_types.UpdateWorkingSetScenario.activations
Saved activation MB under the supplied activation-to-weight multiplier.
Equation: (self.activation_factor * self.weights).to(‘MB’)
persistent
engine.scenario_types.UpdateWorkingSetScenario.persistent
Activation-free MB: weights plus gradients plus optimizer state.
Equation: (self.weights + self.gradients + self.optimizer_state).to(‘MB’)
total
engine.scenario_types.UpdateWorkingSetScenario.total
Working-set MB: persistent state plus the assumed saved activations.
Equation: (self.persistent + self.activations).to(‘MB’)
amplification
engine.scenario_types.UpdateWorkingSetScenario.amplification
Total working set divided by weight bytes, a dimensionless multiplier.
Equation: (self.total / self.weights).to(’’).magnitude
floor
engine.scenario_types.UpdateWorkingSetScenario.floor
Persistent-state-to-weight ratio before any saved activations are added.
Equation: (self.persistent / self.weights).to(’’).magnitude
ceiling
engine.scenario_types.UpdateWorkingSetScenario.ceiling
Upper working-set-to-weight ratio using activation_factor_high rather than the nominal activation multiplier.
Equation: self.floor + self.activation_factor_high
step_traffic
engine.scenario_types.UpdateWorkingSetScenario.step_traffic
DRAM bytes per update in MB from calc_update_step_traffic; uses its declared read/write accounting, not a measured trace.
Equation: The calculation follows the stated accounting rule; the method body shows each intermediate term.
weight_reads
engine.scenario_types.UpdateWorkingSetScenario.weight_reads
Weight-read portion of the update traffic in MB, returned by calc_update_step_traffic.
Equation: The calculation follows the stated accounting rule; the method body shows each intermediate term.
traffic_ratio
engine.scenario_types.UpdateWorkingSetScenario.traffic_ratio
Update-step traffic divided by weight storage; dimensionless bytes-moved amplification.
Equation: (self.step_traffic / self.weights).to(’’).magnitude
step_floor
engine.scenario_types.UpdateWorkingSetScenario.step_floor
Traffic-only latency floor in ms: step_traffic / bandwidth; requires bandwidth and excludes compute/overlap effects.
Equation: (self.step_traffic / self.bandwidth).to(‘millisecond’)