Restore the continuation state

Every continuation mode in this toy starts from the same saved parameter: -5/4. The next prescribed input is also the same. Restoring only the parameter produces -17/4 after one update. Restoring the parameter, momentum and completed-step counter produces -8/3, matching the uninterrupted path. Equal weights did not imply equal continuation.[4][5]

This is an original CPU-only arithmetic example, not a trained model or a GPU recovery test. The state has three fields: parameter p, momentum m and completed-update counter t. Each next input g updates momentum to m/2 + g, then subtracts that value divided by t + 1 from p. The counter advances by one. Python fractions keep every value exact; there is no rounding tolerance.[5]

The four prescribed inputs are 1, 2, 3 and 4. They are called gradients here because they occupy that position in the update rule; they are not derivatives evaluated from a model. After the first two updates, the saved state is p = -5/4, m = 5/2 and t = 2. Every continuation receives the same remaining inputs, 3 and 4, in that order.[5][4]

  • Compare continuation: Retain the suffix states and compare them with the intended uninterrupted reference under the same future inputs.

Compare the complete suffix

The two partial restores separate the missing information. Preserving the counter while resetting momentum gives -9/4 after the next update. Preserving momentum while resetting the counter gives -11/2: it reuses the first learning rate instead of the third. The parameter-only restore loses both fields. Each partial restore diverges from the reference in this fixture.[4]

The full toy restore reconstructs all three fields through a JSON roundtrip. Both remaining updates match the uninterrupted reference exactly, including parameters, momentum and counters. The comparison retains the whole suffix, not just a final parameter or an incremented progress number. Fixed configuration and future input order are supplied identically outside the checkpoint.[4][5]

One synthetic checkpoint, five continuation modes. Every row starts at p = -5/4 and receives the same two future inputs.

ModeRestored momentumRestored stepNext parameterFull suffix matches
Uninterrupted5/22-8/3Yes
Parameter only00-17/4No
Parameter + step02-9/4No
Parameter + momentum5/20-11/2No
Full toy state5/22-8/3Yes
  • Suffix agreement compares parameter, momentum and counter after both future updates.
  • Full toy state includes p,m,t with fixed configuration and identical future inputs; it is not a universal checkpoint inventory.

Retain conditional outcomes

The conditional controls matter. With a zero momentum coefficient, omitting the buffer while preserving the counter does not change the continuation. With a constant learning rate, resetting the counter leaves the parameter path unchanged, while the complete state still differs. Missing a field does not inevitably change every output; whether it matters depends on the declared computation.[4][5]

The retained invocation includes five authored modes and fourteen separate checks, including those conditional examples, changed future inputs and malformed checkpoint fields. All states and outcomes are in the download. These are designed cases, not independent recovery trials or an estimate of how often real jobs fail.[4]

  • State the scope: This full checkpoint means three fields for one authored recurrence, with fixed external configuration and inputs.

Bound the checkpoint contract

PyTorch’s checkpoint guidance recommends retaining optimizer state and relevant progress information when resuming training. Its SGD documentation describes momentum buffers and warns that details differ across implementations. These sources explain the background; this standard-library worksheet does not invoke or validate PyTorch.[1][2]

For a real workload, the inventory may also include scheduler state, random-number generators, data order or cursor, model buffers, mixed-precision scaling and distributed state. Environment and nondeterministic operations can still prevent exact agreement. The three fields here are sufficient only for this recurrence with its fixed configuration and identical future inputs.[1][3]

The MIT proof includes the exact executed source and inputs, complete saved output and a readable protocol. A useful continuation check asks whether the resumed path agrees with the intended reference under the same future work. This worksheet establishes that narrow arithmetic result. It does not measure recovery speed, checkpoint durability, model quality, training benefit or any provider’s performance.[5][6]

  • Define the continuation contract before calling a checkpoint complete.

Sources

  1. Saving and Loading Models — Matthew Inkawhich, PyTorch Tutorials docs.pytorch.org
  2. SGD — PyTorch2.15 documentation docs.pytorch.org
  3. Reproducibility — PyTorch2.15 documentation docs.pytorch.org
  4. Complete retained original result data.nodus-compute.ai
  5. MIT source, fixture, protocol and provenance data.nodus-compute.ai
  6. Source and saved-result provenance data.nodus-compute.ai
  7. Vector figure data.nodus-compute.ai