solvers.CheckpointModel
solvers.CheckpointModel()Analyzes the storage constraints and I/O burst penalties of saving model states.
Training massive models requires saving hundreds of gigabytes (Weights + Optimizer States) to persistent storage. This model calculates the time spent blocked on I/O, subtracting from the cluster’s Model FLOPs Utilization.
Literature Source: 1. Eisenman et al. (2022), “Check-N-Run: A Checkpointing System for Training Large Language Models.”
Methods
| Name | Description |
|---|---|
| solve | Estimate synchronous checkpoint size, write time, and stall fraction. |
solve
solvers.CheckpointModel.solve(
model,
hardware,
optimizer='adam',
checkpoint_interval_hours=4.0,
n_writers=1,
filesystem_limit_gbs=500.0,
)Estimate synchronous checkpoint size, write time, and stall fraction.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| model | Workload | Workload whose parameter count sets the checkpoint payload. | required |
| hardware | HardwareNode | Device with storage bandwidth in bytes/second. Missing or zero storage bandwidth uses the declared fallback in engine.calibration. |
required |
| optimizer | str | "adam" selects mixed-precision Adam checkpoint bytes; other names use the SGD convention. Gradients are not persisted. |
'adam' |
| checkpoint_interval_hours | float | Hours between checkpoints. A nonpositive interval returns a stall fraction of one; positive intervals use write time divided by interval. | 4.0 |
| n_writers | int | Positive number of writers sharing the checkpoint payload. | 1 |
| filesystem_limit_gbs | float | Positive aggregate filesystem ceiling in decimal GB/second. | 500.0 |
Returns
| Name | Type | Description |
|---|---|---|
| CheckpointResult | Checkpoint size in GB, write duration in seconds, and a dimensionless stall fraction in mfu_penalty_pct (not multiplied by 100). storage_bottleneck flags writes longer than one minute; it does not certify that a checkpoint schedule fits the interval. |
See Also
mlsysim.physics.memory.calc_checkpoint_size : Persisted state accounting.
Notes
Equation: M = P b; bandwidth = min(n_writers * device_bandwidth, filesystem_limit); write_time = M / bandwidth. The penalty is write_time / checkpoint_interval for a positive interval.
Assumptions: writers partition one payload without duplicated writes; checkpointing synchronously blocks useful training. Byte conventions come from engine.calibration and are separate from storage rates.
Excludes: asynchronous overlap, filesystem metadata, serialization CPU work, network contention, and checkpoint recovery. The penalty can exceed one when a write takes longer than its configured interval.
References
Derivation: payload size is parameter count times persisted bytes per parameter; elapsed transfer time is payload divided by available rate. The writer minimum is a shared-bandwidth capacity constraint.
Examples
>>> from mlsysim import Models, Hardware
>>> result = CheckpointModel().solve(Models.Language.Llama3_8B, Hardware.Cloud.H100)
>>> result.checkpoint_size.to("GB").magnitude > 0
True
>>> result.write_time_seconds.to("second").magnitude > 0
True