Repository navigation
Architecture Decisions
Decision: use PyTorch DDP with one complete model replica per rank. This makes gradient synchronization and batch partitioning easier to understand and debug. Trade-off: each device must fit the model; this is not an FSDP demonstration.
Decision: provide a 70,978-parameter byte-level causal Transformer for CPU-only demonstrations. This enables two-process verification without CUDA or Hugging Face downloads. Trade-off: the toy corpus and architecture are not a real LLM benchmark.
Decision: use PEFT LoRA on q_proj and v_proj, retaining pretrained Qwen base weights. Trade-off: adds dependency, device-memory and model-download requirements; not pretraining from scratch.
Decision: keep CLI, dataset, collators, modeling, training and saving in one Python module for learning purposes. Trade-off: separate modules, unit tests, data validation and experiment tracking would improve maintainability for larger projects.
Decision: save outputs on rank 0 and synchronize afterwards. Trade-off: simple write ownership, but no periodic checkpoint/restart support.
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.