kwongfuk/codex-skills/exact-training-resume-guard
- community
Checking that the SKILL.md file is still in the repository.
Enforce exact-resume support for long-running training jobs. Use when writing or updating any training script, launcher, sbatch file, DeepSpeed/Accelerate/TRL training entrypoint, or checkpoint policy where future runs must resume from the last step with optimizer, scheduler, RNG, and framework state preserved after timeout, preemption, or manual interruption.
Install
npx vskill@latest install kwongfuk/codex-skills/exact-training-resume-guardSKILL.md
Exact Training Resume Guard
Use this skill whenever a task writes or edits training launchers, training entrypoints, or checkpoint logic.
This is not "load model weights and start over." The requirement is exact resume:
- continue from the last saved step
- preserve optimizer state
- preserve scheduler position
- preserve RNG state
- preserve framework and distributed state such as DeepSpeed sharded checkpoints
Hard Requirements
- Save full training state, not model-only checkpoints.
- Do not enable options like
save_only_model=truefor long-running training unless the user explicitly accepts losing exact resume. - Save model, optimizer, scheduler, scaler if used, RNG state, and distributed/framework state needed by the runtime.
- Resume from the latest complete checkpoint automatically.
- On startup, detect the newest complete checkpoint under the resume directory.
- Resume only from checkpoints that contain every file required by the framework.
- If a checkpoint is incomplete, skip it and log that decision.
- Handle interruption safely.
- Trap
SIGTERMandSIGINT. - Forward termination to the trainer so it can finish or flush the current save path.
- Emit the latest resumable checkpoint path during shutdown.
- Keep checkpoints on durable storage.
- Checkpoint trees and any checkpoint-writing
output_dirmust be on durable storage such as/scratch, not ephemeral local scratch and not mixed into lightweight repo logs.
Implementation Checklist
- Launcher defaults:
- full-state checkpoint saving enabled
- periodic save interval defined
- resume path configurable but defaulting to the task checkpoint directory
- Entry script:
- accepts
resume_from_checkpoint - passes it into the trainer/runtime
- does not silently ignore resume
- Checkpoint validation:
- verify the framework-specific state files exist before resuming
- examples: optimizer, scheduler, RNG, trainer state, DeepSpeed shard state
- Logging:
- print startup resume source
- print skipped incomplete checkpoints
- print latest resumable checkpoint on shutdown
Framework Guidance
- Hugging Face Trainer / TRL:
- prefer
trainer.train(resume_from_checkpoint=...) - keep full checkpoint directories; do not rely on
save_model()alone - DeepSpeed:
- require optimizer/model shard state under the checkpoint step directory
- do not call a checkpoint "resumable" if only safetensors weights exist
- Accelerate or custom loops:
- persist optimizer, scheduler, scaler, RNG, and dataloader/step counters when applicable
Review Rule
A training script is not done until exact resume has been checked explicitly. If the script only reloads model weights, describe it as restart from weights, not resume training.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingglobal/exact-training-resume-guard/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/kwongfuk/codex-skills/exact-training-resume-guard)