Skip to content

Commit 9562373

Browse files
authored
Update README.md
1 parent 63ab183 commit 9562373

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

fast_mnist/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# Fast MNIST
2+
13
The [PyTorch MNIST dataset](https://pytorch.org/docs/stable/torchvision/datasets.html#mnist) is **SLOW** by default, because it wants to conform to the usual interface of returning a PIL image. This is unnecessary if you just want a normalized MNIST and are not interested in image transforms (such as rotation, cropping). By folding the normalization into the dataset initialization you can **save your CPU and speed up training by 2-3x**.
24

35
The bottleneck when training on MNIST with a GPU and a small-ish model is **the CPU**. In fact, even with six dataloader workers on a six core i7, the GPU utilization is only ~5-10%. Using FastMNIST increases GPU utilization to ~20-25% and reduces CPU utilization to near zero. On my particular model the steps per second with batch size 64 went from ~150 to ~500.

0 commit comments

Comments
 (0)