Compute the number of training steps per epoch from dataset size and batch size, for training-loop and sharding checks.
分布式下每卡步数不变,总样本覆盖相同。
| Item | Formula / Note | Source / Standard |
|---|---|---|
| Steps formula | steps per epoch equals the sample count divided by batch size rounded up | PyTorch DataLoader docs |
| Last partial batch | a non-dividing sample count leaves a smaller last batch that may be dropped | PyTorch DataLoader docs |
| Distributed sharding | with multiple devices per-device steps divide by the device count while shards must cover the data | PyTorch DistributedDataParallel docs |