09. Training & Compute Engineering
Engineering·Chapter 09
Memory, parallelism and unit cost
Where this chapter fits: this is the home ground of PyTorch and the training side: framework mechanics, memory accounting, parallelism, data pipelines and profiling. The site-wide writing principles hold — APIs and default behavior are checked against official documentation, and performance conclusions come with reproducible measurement bases.
Questions this chapter answers
- The model does not fit — which dimension do you shard, and by how much?
- Throughput will not climb: what do you measure first, and what do you change?
- Training is unstable: do you investigate the data, the gradients, or the communication?
Article index
Articles for this chapter are being written and will be linked here once published.
The topic backlog below shows what this chapter will cover.
Topic backlog
- PyTorch tensor semantics: stride, views and broadcasting
- Autograd mechanics and gradient control (no_grad, detach, retain_graph)
- The real behavior of nn.Module parameters and buffers, optimizers and schedulers
- Correct use of mixed precision and GradScaler
- Memory accounting: parameters, gradients, optimizer state and activations, item by item
- Parallelism strategies: where DDP, FSDP, TP and PP apply
- Data pipelines and IO: DataLoader tuning and storage bottlenecks
- Profiling and bottleneck localization
- Checkpoints and resuming from interruption