PeriodicInferencePowerScenario
Sustainability scenarios · Implementation: mlsysim/engine/scenario_definitions/sustainability.py.
Construct this scenario with keyword inputs. The fields below show the types and defaults declared by this class.
workload run once per period on hardware at its peak precision rate, idling between runs.
Active power is the board’s tdp and idle power its tdp_min; average power weights each by its share of the period (DutyCycledPowerModel). energy_cut (optional) divides the energy of each inference, to show how little a cheaper inference moves a duty-cycled average.
Notes
Equation: Composition of mlsysim.solvers.DutyCycledPowerModel.solve.
Assumptions: One inference occurs per period; peak FLOPs bound execution time and registry TDP values proxy active/idle power.
Excludes: Measured board energy, wake-up cost, memory-bound latency, and a period shorter than inference time.
References
Derivation: This scenario binds named inputs to DutyCycledPowerModel. The linked solver contracts own equations, sources, and result-unit definitions.
Examples
Evaluate the named configuration and display a modeled result.
>>> from mlsysim import Scenarios
>>> case = Scenarios.KeywordSpottingOnEsp32S3
>>> value = case.average_power
>>> print(f"{value:.3g~}")
52.9 mWAttributes
| Name | Description |
|---|---|
| active_contribution | Active state’s duty-weighted average-power contribution in mW. |
| active_power | Registry TDP used as the active-power assumption, a power quantity. |
| average_power | Duty-weighted average power in mW from DutyCycledPowerModel.solve. |
| crossover_duty | Active fraction where active and idle energy contributions are equal. |
| cut_gain | Dimensionless fraction of average power removed by the active-energy reduction. |
| cut_saving | Average mW saved by reducing active inference energy by energy_cut; idle power unchanged. |
| duty | Active fraction of the period, inference time divided by period; no clamping. |
| energy_cut | |
| hardware | |
| idle_contribution | Idle state’s duty-weighted average-power contribution in mW. |
| idle_power | Registry minimum TDP used as the idle-power assumption, a power quantity. |
| idle_share | Idle contribution divided by average power, dimensionless. |
| inference_energy | Modeled active energy in mJ, active power times compute-bound execution time. |
| inference_time | Peak-compute execution bound in ms, workload FLOPs divided by precision-specific peak rate. |
| period | |
| precision | |
| result | Evaluate the stated periodic inference power case through DutyCycledPowerModel.solve; returns its typed result and quantity units. |
| workload |
workload
Type: Workload.
Declared default: required.
hardware
Type: HardwareNode.
Declared default: required.
period
Type: Quantity.
Declared default: required.
precision
Type: str.
Declared default: 'int8'.
energy_cut
Type: Optional[float].
Declared default: None.
inference_time
engine.scenario_types.PeriodicInferencePowerScenario.inference_time
Peak-compute execution bound in ms, workload FLOPs divided by precision-specific peak rate.
Equation: (workload.inference_flops / hardware.compute.precision_flops[precision]).to('ms').
duty
engine.scenario_types.PeriodicInferencePowerScenario.duty
Active fraction of the period, inference time divided by period; no clamping.
Equation: (inference_time / period).to('').magnitude.
active_power
engine.scenario_types.PeriodicInferencePowerScenario.active_power
Registry TDP used as the active-power assumption, a power quantity.
Equation: hardware.tdp.
idle_power
engine.scenario_types.PeriodicInferencePowerScenario.idle_power
Registry minimum TDP used as the idle-power assumption, a power quantity.
Equation: hardware.tdp_min.
inference_energy
engine.scenario_types.PeriodicInferencePowerScenario.inference_energy
Modeled active energy in mJ, active power times compute-bound execution time.
Equation: (active_power * inference_time).to('mJ').
result
engine.scenario_types.PeriodicInferencePowerScenario.result
Evaluate the stated periodic inference power case through DutyCycledPowerModel.solve; returns its typed result and quantity units.
Calculation: mlsysim.solvers.DutyCycledPowerModel.solve.
active_contribution
engine.scenario_types.PeriodicInferencePowerScenario.active_contribution
Active state’s duty-weighted average-power contribution in mW.
Equation: result.contributions['active'].to('mW').
idle_contribution
engine.scenario_types.PeriodicInferencePowerScenario.idle_contribution
Idle state’s duty-weighted average-power contribution in mW.
Equation: result.contributions['idle'].to('mW').
average_power
engine.scenario_types.PeriodicInferencePowerScenario.average_power
Duty-weighted average power in mW from DutyCycledPowerModel.solve.
Equation: result.average_power.to('mW').
crossover_duty
engine.scenario_types.PeriodicInferencePowerScenario.crossover_duty
Active fraction where active and idle energy contributions are equal.
Duty cycle at which active energy equals idle energy.
Equation: (idle_power / (active_power + idle_power)).to('').magnitude.
cut_saving
engine.scenario_types.PeriodicInferencePowerScenario.cut_saving
Average mW saved by reducing active inference energy by energy_cut; idle power unchanged.
Average power saved when each inference costs 1 / energy_cut of its energy.
Equation: (active_contribution * (1 - 1 / energy_cut)).to('mW').
cut_gain
engine.scenario_types.PeriodicInferencePowerScenario.cut_gain
Dimensionless fraction of average power removed by the active-energy reduction.
Equation: (cut_saving / average_power).to('').magnitude.