PipelineSpeedupScenario
Optimization scenarios · Implementation: mlsysim/engine/scenario_definitions/optimization.py.
Construct this scenario with keyword inputs. The fields below show the types and defaults declared by this class.
Serial pipeline stages; one stage is made speedup times faster (Amdahl’s law).
Notes
Equation: Compose mlsysim.physics.performance.calc_amdahls_speedup.
Assumptions: The baseline stages are serial and only one stage changes duration; optional overlap shares are budget ratios rather than a scheduler simulation.
Excludes: Parallel critical paths and dependencies beyond the named serial stages are absent.
References
Derivation: this scenario binds its input fields to the referenced implementation contracts: mlsysim.physics.performance.calc_amdahls_speedup. The methods below identify any additional arithmetic.
Examples
>>> from mlsysim import Scenarios
>>> case = Scenarios.PhoneCameraPipeline
>>> str(case.total)
'200 ms'Attributes
| Name | Description |
|---|---|
| accelerated | |
| accelerated_stage | New duration of the selected stage. Equation: stages[accelerated] / speedup. Units: |
| accelerated_total | Serial request duration after the single-stage upgrade. Equation: replace the original |
| fraction | Baseline latency fraction belonging to the accelerated stage. Equation: |
| limit | Amdahl ceiling when the selected stage becomes instantaneous. Equation: |
| overall_speedup | End-to-end Amdahl speedup for the single-stage upgrade. Equation: |
| speedup | |
| stages | |
| total | Serial end-to-end duration of all named stages. Equation: sum of stage times. Units: |
Methods
| Name | Description |
|---|---|
| overlapped_share | Fraction of feeder time that can cover the named stage, capped at one. Equation: |
| share | Selected stages’ share of baseline serial duration. Equation: subtotal(*names) / total. |
| subtotal | Serial duration of the selected named stages. Equation: sum the stage times for |
subtotal
engine.scenario_types.PipelineSpeedupScenario.subtotal(*names)Serial duration of the selected named stages. Equation: sum the stage times for names. Units: milliseconds; repeated names would count the stage repeatedly.
stages
Type: Dict[str, Quantity].
Declared default: required.
accelerated
Type: str.
Declared default: required.
speedup
Type: float.
Declared default: 1.0.
total
engine.scenario_types.PipelineSpeedupScenario.total
Serial end-to-end duration of all named stages. Equation: sum of stage times. Units: milliseconds; stages do not overlap in this baseline.
fraction
engine.scenario_types.PipelineSpeedupScenario.fraction
Baseline latency fraction belonging to the accelerated stage. Equation: stages[accelerated] / total. Units: dimensionless; the stage must be present and total duration positive.
accelerated_stage
engine.scenario_types.PipelineSpeedupScenario.accelerated_stage
New duration of the selected stage. Equation: stages[accelerated] / speedup. Units: milliseconds; speedup changes only this stage.
accelerated_total
engine.scenario_types.PipelineSpeedupScenario.accelerated_total
Serial request duration after the single-stage upgrade. Equation: replace the original stage time in total with accelerated_stage. Units: milliseconds; all other times are fixed.
overall_speedup
engine.scenario_types.PipelineSpeedupScenario.overall_speedup
End-to-end Amdahl speedup for the single-stage upgrade. Equation: mlsysim.physics.performance.calc_amdahls_speedup(fraction, speedup). Units: dimensionless; stages remain sequential.
limit
engine.scenario_types.PipelineSpeedupScenario.limit
Amdahl ceiling when the selected stage becomes instantaneous. Equation: calc_amdahls_speedup(fraction, infinity). Units: dimensionless; unchanged stages bound the total gain.