DataLoader
Timeline (last 90 days)
When DataLoader's shuffle=True, a custom torch.Generator should be passed explicitly with a seed set, so as to control the source of randomness in data order.
When DataLoader's num_workers > 0, each worker has its own independent random state, and a seed should be derived from the base seed and set for each worker via worker_init_fn.
For a small corpus of 1000 words, setting num_workers=0 when using DataLoader is more efficient than multiprocessing.
On an H100, the GPU completes one computation step far faster than data loading, and a low num_workers causes the dataloader to be unable to feed data in time, forcing the GPU to idle and wait, i.e. the data starvation problem.
In the PyTorch DataLoader, num_workers determines how many independent subprocesses are used to read and preprocess data in parallel, and a low value prevents data preparation from overlapping with GPU computation.
TorchCodec supports placing decoding work on the GPU and using it together with DataLoader's multi-process workers to alleviate the CPU bottleneck common in video decoding.
All Facts (7)
When DataLoader's shuffle=True, a custom torch.Generator should be passed explicitly with a seed set, so as to control the source of randomness in data order.
50%UnverifiedWhen DataLoader's num_workers > 0, each worker has its own independent random state, and a seed should be derived from the base seed and set for each worker via worker_init_fn.
50%UnverifiedFor a small corpus of 1000 words, setting num_workers=0 when using DataLoader is more efficient than multiprocessing.
50%UnverifiedIn the PyTorch DataLoader, num_workers determines how many independent subprocesses are used to read and preprocess data in parallel, and a low value prevents data preparation from overlapping with GPU computation.
50%UnverifiedOn an H100, the GPU completes one computation step far faster than data loading, and a low num_workers causes the dataloader to be unable to feed data in time, forcing the GPU to idle and wait, i.e. the data starvation problem.
50%UnverifiedTorchCodec supports placing decoding work on the GPU and using it together with DataLoader's multi-process workers to alleviate the CPU bottleneck common in video decoding.
50%UnverifiedThe num_workers parameter in PyTorch's DataLoader can run multiple data loading workers in parallel, avoiding data starvation during GPU training.
50%