engine.solvers.reliability
engine.solvers.reliability
Reliability and checkpoint-interval solvers.
Domain implementations behind mlsysim.solvers (the public import path, derived from engine.solvers.__init__); kept per-domain so the logic stays reviewable.
Classes
| Name | Description |
|---|---|
| CheckpointIntervalModel | Young-Daly checkpoint interval and the share of wall time it wastes. |
| FailureIntervalModel | Interval between failures across identical, independent components. |
| RecoveryBudgetModel | Cold-restart budget for one failure, and its cost per day at a failure interval. |
| ReliabilityModel | Calculates Mean Time Between Failures (MTBF) and optimal checkpointing intervals. |
| SeriesFailureModel | Failure interval of a synchronous job built from heterogeneous components. |
CheckpointIntervalModel
engine.solvers.reliability.CheckpointIntervalModel()Young-Daly checkpoint interval and the share of wall time it wastes.
tau* = sqrt(2 * write_time * MTBF) balances the write share write_time / tau against the rework share tau / (2 * MTBF); at the optimum the two are equal. Literature: Young (1974); Daly (2006). Added 2026-10-20.
Methods
| Name | Description |
|---|---|
| solve | Balance checkpoint write time against expected rework. |
solve
engine.solvers.reliability.CheckpointIntervalModel.solve(write_time, mtbf)Balance checkpoint write time against expected rework.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| write_time | Quantity | Positive checkpoint write pause in time units. | required |
| mtbf | Quantity | Positive job mean time between failures in time units. | required |
Returns
| Name | Type | Description |
|---|---|---|
| CheckpointIntervalResult | Write duration in seconds, MTBF in hours, optimal interval, and dimensionless write, rework, and total waste shares. |
See Also
mlsysim.physics.reliability.calc_young_daly_interval : Balance checkpoint writing and lost work. mlsysim.physics.reliability.calc_checkpoint_waste : Sum write and rework overhead fractions.
Notes
Equation: tau = sqrt(2 write_time MTBF); write_share = write_time/tau; rework_share = tau/(2 MTBF); waste = write_share + rework_share.
Assumptions: First-order periodic checkpointing, failures uniformly placed within an interval, and checkpoint cost small enough for the approximation to be useful.
Excludes: Checkpoint overlap, recovery time, correlated failures, and higher-order scheduling corrections.
References
Derivation: Differentiating write_time/tau + tau/(2 MTBF) and setting its derivative to zero yields tau; the two contributions are equal at that point.
Examples
>>> r = CheckpointIntervalModel().solve(Q_(10, "s"), Q_(1000, "s"))
>>> abs(r.write_share - r.rework_share) < 1e-12
TrueFailureIntervalModel
engine.solvers.reliability.FailureIntervalModel()Interval between failures across identical, independent components.
With N components that each fail on average once per MTBF, some component fails on average every MTBF / N (the minimum of N exponentials). Over a run of a given length the expected failure count is the run length divided by that interval.
Methods
| Name | Description |
|---|---|
| solve | Calculate the failure interval of independent identical components. |
solve
engine.solvers.reliability.FailureIntervalModel.solve(
component_mtbf,
n_components,
run_duration,
)Calculate the failure interval of independent identical components.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| component_mtbf | Quantity | Positive per-component MTBF in hours or compatible units. | required |
| n_components | int | Positive number of independent components. | required |
| run_duration | Quantity | Positive observation duration in time units. | required |
Returns
| Name | Type | Description |
|---|---|---|
| FailureIntervalResult | System interval in hours, dimensionless expected failure count over the run, and failures per day. |
See Also
mlsysim.physics.reliability.calc_mtbf_cluster : Aggregate identical node failure rates.
Notes
Equation: interval = component_mtbf / n_components; expected_failures = run_duration / interval; failures_per_day = one_day / interval.
Assumptions: Independent, identical exponential failures and an unchanged population over the run.
Excludes: Common-cause faults, repair downtime, and redundancy masking component failures.
References
Derivation: The minimum of independent exponential lifetimes has the sum of their rates; count expectation is rate times duration.
Examples
>>> r = FailureIntervalModel().solve(Q_(100, "hour"), 10, Q_(20, "hour"))
>>> r.interval == Q_(10, "hour") and r.expected_failures == 2
TrueRecoveryBudgetModel
engine.solvers.reliability.RecoveryBudgetModel()Cold-restart budget for one failure, and its cost per day at a failure interval.
The budget is detection + restart + checkpoint load + warmup (RecoveryProfile.cold_restart_time); a job that fails every failure_interval pays it 1 day / failure_interval times a day, on every one of its n_devices. Rework since the last save is charged to checkpoint waste, not here. Added 2026-10-20.
Methods
| Name | Description |
|---|---|
| solve | Price serial cold-restart phases at a given failure frequency. |
solve
engine.solvers.reliability.RecoveryBudgetModel.solve(
checkpoint_bytes,
recovery,
failure_interval,
n_devices,
)Price serial cold-restart phases at a given failure frequency.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| checkpoint_bytes | Quantity | Nonnegative checkpoint size in bytes. | required |
| recovery | RecoveryProfile | Detection, restart, warmup, and positive checkpoint bandwidth profile. | required |
| failure_interval | Quantity | Positive interval between job failures in time units. | required |
| n_devices | int | Nonnegative number of reserved job devices. | required |
Returns
| Name | Type | Description |
|---|---|---|
| RecoveryBudgetResult | Phase and total restart times, failures/day, lost minutes/day, dimensionless day share, and device-hours lost per day. |
Notes
Equation: reload = checkpoint_bytes / bandwidth; total = detect + restart + reload + warmup; failures_per_day = one_day / failure_interval; daily_loss = total * failures_per_day.
Assumptions: All phases execute serially, their durations are fixed, and the whole job waits for recovery.
Excludes: Rework since the checkpoint, concurrent recovery, retry failures, and overlapping incidents.
References
Derivation: Adding serial phase durations gives one recovery budget; multiplying by event frequency and device count gives expected device-time loss.
Examples
>>> r = RecoveryBudgetModel().solve(Q_(1, "GB"), Reliability.Recovery, Q_(1, "day"), 4)
>>> r.failures_per_day == 1 and r.lost_per_day == r.total
TrueReliabilityModel
engine.solvers.reliability.ReliabilityModel()Calculates Mean Time Between Failures (MTBF) and optimal checkpointing intervals.
This model handles the reliability modeling of massive clusters, helping determine the ‘Goodput’ of long-running training jobs. It identifies the probability of a job failure before completion and calculates the Young-Daly optimal interval to minimize wasted compute time.
Literature Source: 1. Young (1974), “A First-Order Approximation to the Optimum Checkpoint Interval.” 2. Daly (2006), “A Higher Order Estimate of the Optimum Checkpoint Interval for Restart-Dump Strategy.”
Methods
| Name | Description |
|---|---|
| solve | Estimate fleet failure exposure and a checkpoint interval. |
solve
engine.solvers.reliability.ReliabilityModel.solve(
fleet,
job_duration_hours,
checkpoint_time_s=60.0,
avg_recovery_time_s=300.0,
)Estimate fleet failure exposure and a checkpoint interval.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| fleet | Fleet | Cluster configuration with positive node count and per-node device counts. | required |
| job_duration_hours | float | Nonnegative planned job duration in hours. | required |
| checkpoint_time_s | float | Positive write pause per checkpoint in seconds; default 60. | 60.0 |
| avg_recovery_time_s | float | Nonnegative recovery duration per failure in seconds; default 300, including reload, restart, and warmup. | 300.0 |
Returns
| Name | Type | Description |
|---|---|---|
| ReliabilityResult | Fleet MTBF and checkpoint interval with time units, failure probability, expected failure count, and dimensionless goodput estimate. |
See Also
mlsysim.physics.reliability.calc_mtbf_node : Sum independent component failure rates. mlsysim.physics.reliability.calc_young_daly_interval : Balance checkpoint writing and lost work.
Notes
Equation: lambda_node = n_gpu / MTBF_gpu + n_nic / MTBF_nic + n_psu / MTBF_psu; M = 1 / (fleet.count * lambda_node); P(failure) = 1 - exp(-job_duration / M); tau = sqrt(2 * checkpoint_time * M). Steady-state Young-Daly goodput is max(0, 1 - checkpoint_time / tau - tau / (2 * M) - recovery_time / M).
Assumptions: Independent exponential component failures and a synchronous series system. Nonredundant PSU counts come from the node; component lifetimes come from the Reliability registry. At the optimal Young-Daly interval tau = sqrt(2 * C * M), expected rework loss tau / (2 * M) equals checkpoint write overhead C / tau.
Excludes: Correlated failures, repair contention, asynchronous background checkpointing, and higher-order O((C / M)) Daly correction terms.
References
Young (1974), “A First Order Approximation to the Optimum Checkpoint Interval.” https://doi.org/10.1145/361147.361115 (bibliography key: young1974). Daly (2006), “A Higher Order Estimate of the Optimum Checkpoint Interval for Restart Dumps.” https://doi.org/10.1016/j.future.2004.11.016 (bibliography key: daly2006).
Examples
>>> from mlsysim import Systems
>>> r = ReliabilityModel().solve(Systems.Clusters.Research_256, 24)
>>> 0 <= r.failure_probability <= 1 and r.fleet_mtbf.m_as("hour") > 0
TrueSeriesFailureModel
engine.solvers.reliability.SeriesFailureModel()Failure interval of a synchronous job built from heterogeneous components.
Any single component failure stops the job, so failure rates add (a series system with independent, exponentially distributed failures). Each component is stated per node, with its MTTF and its count per node; its share per device is count / devices_per_node / MTTF. A redundant part that cannot fail the node singly (an N+M power supply) enters with count 0. Added 2026-10-20.
Methods
| Name | Description |
|---|---|
| solve | Aggregate heterogeneous component hazards for a synchronous job. |
solve
engine.solvers.reliability.SeriesFailureModel.solve(
n_devices,
devices_per_node,
component_mttf,
per_node,
)Aggregate heterogeneous component hazards for a synchronous job.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| n_devices | int | Positive accelerator count in the job. | required |
| devices_per_node | int | Positive accelerator count per node. | required |
| component_mttf | dict of str to Quantity | Positive component MTTFs in hours or compatible units. | required |
| per_node | dict of str to int | Nonnegative component counts per node, with the same keys as component_mttf. Use zero for parts whose single failure cannot stop the node. | required |
Returns
| Name | Type | Description |
|---|---|---|
| SeriesFailureResult | Per-device component rates, total device and system rates in inverse hours, MTBF in hours, and failures per day. |
Notes
Equation: component_rate[k] = per_node[k] / (devices_per_node * MTTF[k]); system_rate = n_devices * sum(component_rate); MTBF = 1/system_rate.
Assumptions: Independent exponential component failures; any included component failure stops the entire job. At least one component rate must be positive.
Excludes: Fault correlation, shared infrastructure, and explicit redundant failure combinations.
References
Derivation: Summing independent exponential hazards gives the series-system rate. Per-node rates are divided by devices per node and multiplied by the job’s device count.
Examples
>>> r = SeriesFailureModel().solve(8, 4, {"gpu": Q_(100, "hour")}, {"gpu": 4})
>>> r.mtbf == Q_(12.5, "hour")
True