Repository navigation
Checkpoints
flowchart LR
A["Training loop completed"] --> R{"rank == 0?"}
R -->|yes tiny mode| C["torch.save: tiny_transformer.pt"]
R -->|yes qwen mode| D["PEFT save_pretrained + tokenizer.save_pretrained"]
R -->|no| E["Skip checkpoint write"]
C --> B["Distributed barrier if world_size > 1"]
D --> B
E --> B
B --> X["destroy_process_group"]
- Tiny mode:
--save-dir/tiny_transformer.ptsaved viatorch.savewith architecture metadata andmodel_state_dict. - Qwen mode: PEFT LoRA adapters and tokenizer saved with
save_pretrained. The original pretrained Qwen base weights are not copied into the output folder.
Both modes write only on rank 0 and then join a distributed barrier before teardown. The script performs a single save after the training loop, not periodic checkpointing. It does not save optimizer state, scheduler state, epoch/step progress, RNG state, or resumable distributed-training metadata.
Artifacts and local training outputs are excluded from Git with .gitignore in the publication package. Do not upload model checkpoints as source files without checking size, provenance and redistribution terms.
Distributed LLM Training · PyTorch DDP (educational) — Home · System-Architecture · Low-Level-Design · Publishing-the-Wiki
This project is licensed under the Apache License, Version 2.0.© 2026 Sudhanshu Shukla · Licensed under the Apache License, Version 2.0.