Read only needed checkpoint snapshot components during finalization - #984
Draft
bradhilton wants to merge 2 commits into
Draft
bradhilton wants to merge 2 commits into
bradhilton wants to merge 2 commits into
Conversation
bradhilton
had a problem deploying
to
trainer-rank-gpu-validation
September 26, 2026 08:00 — with
GitHub Actions
Failure
bradhilton
deployed
to
trainer-rank-gpu-validation
September 26, 2026 08:10 — with
GitHub Actions
Active
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Checkpoint finalization reads each per-block snapshot once for LoRA, three times for optimizer components, and once for step scalars. Each pass currently materializes every tensor. Read only the requested component with
safe_open/get_tensor, preserving explicit missing-key errors, tensor lifetime, step ordering and the existing merge, manifest and cleanup paths. There is no retained tensor cache or public API change.Stacked on #979 (
a0c6c767); the production diff is limited to the two reader call sites. A follow-up also changes two inherited test-fixture assignments tosetattrso CI type-checks their ModuleType stand-ins; the runtime component is unchanged.Validation:
prekattempt used the shared environment's older ty 0.0.14 and failed type checks; canonical CI remains required.A bounded warm-cache CPU reader benchmark using safetensors 0.8.0 measured median wall times of 9.14 → 3.02 ms (16 keys/block, 65,536 elements/key) and 55.65 → 16.30 ms (128 keys/block, 2,048 elements/key). It used two blocks, one Torch CPU thread, and eight alternating-order samples of four passes. CPU time agreed with wall time. This measures header/tensor-view reader work only, excluding tensor-data arithmetic, checkpoint merge/write, physical I/O, comparative RSS and GPU performance. Native background stack samples motivated the change but do not establish interference or speedup.
Canonical CI passes on
5fc36d957: lint/format/type/lock, 1,264 Megatron lightweight tests, and 2,083 unit tests (34 skipped, two deselected). TrainerRank GPU validation completed successfully on two H200s: 95 pytest cases passed (two skipped), followed by the CP2 and TP2 public TrainerRank checks. Sky job 1 reported SUCCEEDED and the workflow completed cluster teardown at 2:29:27 AM MDT. These tests establish compatibility, not native workload performance.The first head's GPU attempt failed before a training job because two free H200s were unavailable; its launch request was cancelled. Its quality run exposed the two inherited fixture type errors corrected by the follow-up above. Those earlier outcomes remain retained. This PR stays draft and unmerged.