Distributed checkpoint manifests
Use metadata to prove logical coverage, bind shard identities, and reject incomplete generations before restoration.
On this page
The question for today
What you’ll understand
- Describe manifest entries for logical tensor regions and immutable stored objects.
- Check coverage rather than relying on file counts or majority availability.
- Separate structural completeness, integrity, and training-state correctness.
A distributed checkpoint needs a map from logical training state to stored objects. A manifest supplies that map and declares which generation is complete. Without it, a directory listing can contain stale files, partial writes, duplicate replicas, or unrelated optimizer fragments. Recovery should follow an explicit committed description and verify its requirements, rather than guessing which combination of filenames probably belongs together.
Describe logical regions and their stored representation
A useful entry identifies a logical tensor or state field, global shape, datatype, stored region, object location, byte range, and integrity information under a versioned encoding. It also identifies the checkpoint generation and logical cut. Replicated state requires a declared owner or replica policy; otherwise summing every stored copy can falsely look like complete coverage. Metadata must distinguish actual tensor elements from padding, compressed payload, or a framework-specific flattened layout. A loader needs the interpretation as well as the object name.
For an ordinary partitioned tensor, stored regions should cover the required logical domain without gaps. Unexpected overlap is suspicious unless it is explicitly declared replication with a consistency rule. Some formats split regions across shared files or pack multiple tensor fragments into one object, so one-file-per-rank is not a general invariant. PyTorch DCP and Megatron use planners or sharded mappings for these relationships. Application metadata must additionally name non-tensor requirements such as data progress and scheduler state; a tensor-complete manifest can still be training-incomplete.
Publish completeness only after every required dependency
Writers can report object creation and checksums to a coordinator, but an acknowledgment must have a defined persistence meaning. A complete manifest should reference immutable objects whose writes have succeeded under the storage backend contract. It should not list a mutable temporary path that another writer may later overwrite. Coordinator retries need a generation identity so a late response from an abandoned attempt cannot satisfy a newer attempt accidentally. Treat an incomplete generation as an ordinary recoverable failure state, not as something the loader must optimistically repair.
Commit metadata is a protocol boundary. Megatron documentation describes final metadata publication after asynchronous shard-saving finalization; this is a concrete implementation detail, not proof that every filesystem or application has the same guarantees. Validate the selected backend and version. A checksum proves agreement with expected bytes only when the expectation itself is trusted, and structural coverage does not prove that all tensors belong to the same update. Keep those checks distinct so an incident report can name precisely which property failed.
Make the loader a strict reader of the contract
A restore preflight should resolve one committed generation, validate its schema and logical cut, check required objects and tensor coverage, and reject conflicting identities before starting expensive computation. If an object is unavailable, use a documented replica or fall back to an older complete generation; do not silently initialize that optimizer region to zero. Recovery can stream validated pieces to bound memory, but partial success must not be reported as a usable training state. Keep error paths explicit enough to distinguish missing payload from unsupported schema.
The reliability instrument illustrates why a majority is an inadequate completeness test. Reset, set both n=5 and k=1, predict four available and majority threshold three, then Play or Step. Separately Reset, set both n=5 and k=0, predict five available, then Play or Step. If all five represent indispensable nonredundant shards, only the second case has every required piece despite both having a majority. This toy counts availability; it neither parses a manifest nor models replicas, erasure coding, persistence, or tensor coverage.
Work it through
Check coverage instead of counting objects
A one-dimensional tensor has 1,000 required elements. A proposed manifest lists three nonreplicated half-open regions [0,400), [400,800), and [850,1000). Every listed object exists and passes its recorded checksum.
Count covered elements: 400+400+150=950. The interval [800,850) contains fifty required elements absent from the listed regions.
The third object ending at 1,000 does not fill that gap. A successful checksum validates the listed object bytes against its expectation, not the existence of an unlisted tensor region.
At four bytes per logical element, 200 payload bytes are missing. The generation fails exact coverage and must not be restored as a complete tensor, regardless of its three successful object checks.
Object existence, checksums, and region coverage answer different questions. A manifest must satisfy all required structural and integrity conditions.
The living notebook
Explore the model
Interactive lab · reliability
A majority can still omit an indispensable shard
Reset, set both n=5 and k=1, predict four available and majority three, then Play or Step. Separately Reset, set both n=5 and k=0, predict five available, then Play or Step. The counter does not validate a manifest or encode redundancy; five indispensable nonreplicated pieces require all five.
- Available replicas
- 4 of 5
- Majority needed
- 3
- Majority available?
- Yes
A replica count and a majority threshold, without a consensus protocol. Playback highlights fixed replica states. Having a majority alone does not establish linearizability, durability or failure independence. Parameter changes pause playback and recompute the model at the current elapsed time. Reset restores both parameters and returns time to zero. Playback starts paused. Adjust either parameter, then choose Play or Step.
Look forCompleteness follows the declared dependency set, rather than a generic availability threshold.
Pause & reason
Check your understanding
Your turn
Try it yourself
Two files both claim the same nonreplicated tensor region [0,512), while [512,1024) is absent. Does their combined stored element count of 1,024 establish completeness?
Take a moment to make a prediction or work it out on paper. Open a hint when you need one.
Give me a hint
A sum of sizes does not identify which indices those bytes represent.
Compare with the solution
No. The entries overlap on the first 512 elements and leave the second half uncovered. Unless a declared replica policy explains the overlap, it is itself a conflict; even valid replicas of the first half would not supply the missing second half. Validate logical regions, identities, and replica rules rather than only aggregate bytes.
Keep the idea
Take it with you
- A manifest maps logical state regions to immutable stored representations.
- Coverage, integrity, consistency, and compatibility are separate checks.
- Publish or restore only when every declared indispensable dependency is ready.
Read further
Original sources and deeper explanations to follow at your own pace.
Optional progress, saved in this browser when available. Revisit any lesson at any time.
Lesson not marked complete.