Skip to main content

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

overlapped_share

engine.scenario_types.PipelineSpeedupScenario.overlapped_share(stage, *feeders)

Fraction of feeder time that can cover the named stage, capped at one. Equation: min(1, stages[stage] / subtotal(*feeders)). Units: dimensionless; this is a timing budget, not a scheduled overlap measurement.

Busy share of stage when the feeders run concurrently on other hardware.

With the stages pipelined, one request leaves per max(feeders, stage), so stage is busy stage / max(feeders, stage) of the time.

share

engine.scenario_types.PipelineSpeedupScenario.share(*names)

Selected stages’ share of baseline serial duration. Equation: subtotal(*names) / total. Units: dimensionless; the names should describe the intended nonoverlapping subset.

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.

Back to top