PartitionScreenScenario
Agents scenarios · Implementation: mlsysim/engine/scenario_definitions/agents.py.
Construct this scenario with keyword inputs. The fields below show the types and defaults declared by this class.
A fixed partition screened over worker counts: (1 - p) + p / N + c (N - 1) of the serial time.
The best count is the integer that minimizes elapsed time under the ceiling max_workers; no count beats 1 / (1 - p), and the continuous optimum sits at sqrt(p / c).
Notes
Equation: The calculation members below define elapsed, best_workers, best_time, best_speedup, speedup_cap, continuous_best.
Assumptions: The parallel share divides evenly across workers and each extra worker adds the same coordination fraction.
Excludes: Overhead changing with topology, data skew, or a nonlinear worker count.
References
Derivation: A fixed partition screened over worker counts: (1 - p) + p / N + c (N - 1) of the serial time. Each member records the corresponding algebra or named physics function.
Examples
Evaluate the named configuration and display a modeled result.
>>> from mlsysim import Scenarios
>>> case = Scenarios.RepairPartitionScreen
>>> value = case.best_workers
>>> print(value)
6Attributes
| Name | Description |
|---|---|
| best_speedup | Dimensionless serial-to-best-parallel speedup, reciprocal normalized elapsed time. |
| best_time | Smallest normalized elapsed time in the enumerated search. |
| best_workers | Worker count minimizing normalized elapsed time within the configured search ceiling. |
| continuous_best | Unconstrained continuous optimum sqrt(parallel fraction / per-worker overhead); not an integer search result. |
| elapsed | Normalized elapsed time by integer worker count via calc_partition_elapsed. |
| max_workers | |
| overhead_per_extra_worker | |
| parallel_fraction | |
| speedup_cap | Amdahl ceiling with coordination removed, one over the serial fraction. |
parallel_fraction
Type: float.
Declared default: required.
overhead_per_extra_worker
Type: float.
Declared default: required.
max_workers
Type: int.
Declared default: required.
elapsed
engine.scenario_types.PartitionScreenScenario.elapsed
Normalized elapsed time by integer worker count via calc_partition_elapsed.
Elapsed time over the serial reference, for each count from one to the ceiling.
Calculation: mlsysim.physics.coordination.calc_partition_elapsed.
best_workers
engine.scenario_types.PartitionScreenScenario.best_workers
Worker count minimizing normalized elapsed time within the configured search ceiling.
Equation: min(t, key=t.get).
best_time
engine.scenario_types.PartitionScreenScenario.best_time
Smallest normalized elapsed time in the enumerated search.
Equation: elapsed[best_workers].
best_speedup
engine.scenario_types.PartitionScreenScenario.best_speedup
Dimensionless serial-to-best-parallel speedup, reciprocal normalized elapsed time.
Equation: 1 / best_time.
speedup_cap
engine.scenario_types.PartitionScreenScenario.speedup_cap
Amdahl ceiling with coordination removed, one over the serial fraction.
Amdahl’s ceiling with free coordination: 1 / (1 - p).
Equation: 1 / (1 - parallel_fraction).
continuous_best
engine.scenario_types.PartitionScreenScenario.continuous_best
Unconstrained continuous optimum sqrt(parallel fraction / per-worker overhead); not an integer search result.
sqrt(p / c), where the derivative of the elapsed time vanishes.
Equation: _math.sqrt(parallel_fraction / overhead_per_extra_worker).