The simple version
Imagine feeding a hungry crowd one grape at a time, where every grape is in its own tiny box that must be found, opened and thrown away. Even with lots of helpers, most of the time goes on boxes, not grapes. Put the grapes in big crates instead and a few helpers keep everyone fed.
The data loader
Frameworks read data in background workers while the GPU computes. In PyTorch, DataLoader(num_workers=…, pin_memory=True, prefetch_factor=…) controls how many worker processes read and decode samples, whether batches go into page-locked memory for faster host-to-GPU copies, and how many batches each worker prepares ahead.
Loading overlaps with compute. If the loader needs 0.82 s per step and compute needs 0.40 s, the GPUs sit idle about half the time: 0.40 ÷ 0.82 ≈ 49% busy.
How much data does training need?
Example (stated assumptions): 8 GPUs × 2,500 images/s each × 110 KiB ≈ 2.3 GB/s per node. Modest bandwidth. But it is also 20,000 file opens per second per node. Across 128 nodes that is 2.56 million opens per second hitting the filesystem's metadata service.
That second number is usually the problem. Small files turn a bandwidth problem into a metadata problem (Lesson 19).
Proving the GPUs are waiting
Watch GPU activity with nvidia-smi dmon -s u (the sm column is streaming-multiprocessor utilisation). A saw-tooth or consistently low value while the framework reports long "data" time means the loader, not the model, is the limit. Profilers in the training framework can split step time into data wait and compute.
Tools
nvidia-smi dmon -s uPer-second GPU utilisation; idle gaps often mean data waits.
lfs df -iInode/metadata capacity on Lustre MDTs and OSTs.
simtrain (simulator only)Modelled training harness in the Storage School lab: data time vs compute.
Quiz
Lab
Lab 3.1 · Starved dataloader
A vision model trains from /lustre/datasets/imagenet-raw: 1.28 million JPEGs averaging 110 KiB. nvidia-smi shows the GPUs mostly idle. The same images also exist as 1,024 tar shards in /lustre/datasets/imagenet-shards.
Try it now in the simulator (opens with the command ready; press Enter):
$ simtrain --data /lustre/datasets/imagenet-raw$ simtrain --data /lustre/datasets/imagenet-shards