docs(training-guides): add checkpointing and resuming TrainJobs guide#289
Open
typhoonzero wants to merge 1 commit into
Open
docs(training-guides): add checkpointing and resuming TrainJobs guide#289typhoonzero wants to merge 1 commit into
typhoonzero wants to merge 1 commit into
Conversation
Kubeflow Trainer v2 has no checkpoint API of its own: the platform provides durable storage, pod restarts, and suspend/resume, while the training script must save checkpoints and auto-detect them on start. This guide documents that split and the non-obvious API behaviour around it, verified live against Trainer v2.1.0. - New guide: checkpointing-and-resuming.mdx (weight 33), covering checkpoint contents, storage access modes, a checkpoint-aware TrainingRuntime, per-interruption resume (crash / preemption / suspend), per-framework knobs, multi-node/DCP, and a verify drill. - Assets: checkpoint-pvc.yaml, checkpoint-trainingruntime.yaml, trainjob-resume.yaml (all server-side validated). - index.mdx: add a routing row for the new guide. Notable gotchas documented: - The trainer.kubeflow.org/trainjob-ancestor-step: trainer label is required, or every spec.trainer.* override is dropped silently. - podTemplateOverrides cannot set env on trainer/initializer containers. - RWO storage suffices for single-node resume across nodes; RWX is only needed for numNodes > 1. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Deploying alauda-ai with
|
| Latest commit: |
465de44
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://0037dd34.alauda-ai.pages.dev |
| Branch Preview URL: | https://docs-trainer-v2-checkpointin.alauda-ai.pages.dev |
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.
What
Adds a new Checkpointing and Resuming TrainJobs guide to the training guides, plus three runnable assets and a routing row in the index.
Kubeflow Trainer v2 has no checkpoint API of its own — the platform provides durable storage, pod restarts (
failurePolicy.maxRestarts), and pause/resume (spec.suspend), while the training script must write checkpoints and auto-detect the newest one on start. Get either half wrong and the failure is silent: the job restarts and trains from step 0. This guide documents that split and the non-obvious API behaviour around it.Contents
checkpointing-and-resuming.mdx(weight 33 — between the main Trainer v2 guide and the preemption guide that builds on it):TrainingRuntime, with the resume auto-detect explainedsuspendtorch.distributed.checkpoint(DCP) — the repo's first DCP mentionassets/checkpointing/:checkpoint-pvc.yaml,checkpoint-trainingruntime.yaml,trainjob-resume.yamlindex.mdx: one new routing rowIt deliberately does not restate the HuggingFace
save_steps/resume_from_checkpointrecipe thatpreemptible-trainjobs-with-kueue.mdxalready owns; instead it's the general mechanics doc that guide now links to (and vice-versa).Verification
Behaviour was validated live against Kubeflow Trainer v2.1.0 with a CPU-only TrainJob driven through crash,
suspend, and cross-node resume. Findings folded into the doc:trainer.kubeflow.org/trainjob-ancestor-step: trainerlabel on the trainer replicatedJob is required — without it, everyspec.trainer.*override (env,resourcesPerNode,image,command,numNodes) is dropped silently, no error or event.podTemplateOverridescan mount volumes but the validating webhook rejectsenvon trainer/initializer containers — env must go inspec.trainer.env.numNodes > 1.All three assets pass
kubectl apply --dry-run=server, anddoom lintis clean.🤖 Generated with Claude Code