Zubnet AIसीखेंWiki › Checkpoint
Training

Checkpoint

Model Checkpoint, Snapshot
Training के दौरान एक model के state का saved snapshot — weights, optimizer state, learning rate schedule, और training step। Checkpoints आपको interruptions (hardware failure, preemption) के बाद training resume करने देते हैं, model के intermediate versions evaluate करने देते हैं, और अगर training degrade हो तो एक पहले वाले version पर roll back करने देते हैं। हर कुछ thousand steps पर checkpoints save करना standard practice है।

यह क्यों matter करता है

Large models train करना days से months लेता है। Checkpoints के बिना, 100,000-step training run के step 90,000 पर एक GPU failure का मतलब शुरू से करना। Checkpoints insurance हैं: वो progress incrementally save करते हैं, तो आप सिर्फ last checkpoint के बाद का काम खोते हैं। वो model selection भी enable करते हैं — कभी-कभी एक earlier checkpoint आपके evaluation metrics पर final से better perform करता है।

Deep Dive

A full checkpoint for a 70B model includes: model weights (~140 GB in FP16), optimizer states (~280 GB for Adam, which stores two moving averages per parameter), learning rate scheduler state, random number generator states, and the current training step. Total: ~420 GB per checkpoint. Saving this to disk takes significant time and storage, which is why checkpointing is done periodically rather than every step.

Checkpoint Strategies

Common strategies: save every N steps (simple but uses lots of storage), save only the K most recent checkpoints (deleting older ones to save space), save based on evaluation metrics (keep the checkpoint with the best validation loss), and use async checkpointing (save in the background while training continues on the next batch). Large training runs often use all of these: frequent local checkpoints on fast NVMe storage plus periodic remote checkpoints to network storage for disaster recovery.

Checkpoint Conversion

Different frameworks use different checkpoint formats: PyTorch's state_dict, Hugging Face's safetensors, FSDP's sharded checkpoints, and DeepSpeed's ZeRO checkpoints. Converting between formats is a common task — you might train with DeepSpeed (sharded across GPUs) but need a single consolidated checkpoint for inference or uploading to Hugging Face. The safetensors format is becoming the standard for sharing because it's fast to load and memory-safe.

संबंधित अवधारणाएँ

← सभी Terms
← Chatbot Arena Classification →