Skip to main content
Applies to: Embedded ✅, Enterprise ✅ Optimizing data loader performance can be tricky, as runtime bottlenecks are often difficult to locate across various stages of the I/O and CPU pipelines. To help distinguish bottlenecks, StreamingDataset exposes several pipeline counters: raw_queue_depth shows the number of loaded rows waiting to be transformed, and prefetch_queue_depth is the number of transformed rows ready to be consumed. unscanned_rows and consumed_rows show how far the current iterator has progressed. If the prefetch_queue_depth is consistently zero but the raw_queue_depth is not, then you likely have a CPU transformation bottleneck. You should investigate GIL bottlenecks or look for ways to optimize your transformation. This can often be done by batching the compute work. If both prefetch_queue_depth and raw_queue_depth are consistently zero while the consumer is waiting, I/O is the likely bottleneck. A larger read batch size or clumped shuffling could help.
bytes_loaded measures raw Arrow buffer bytes before transformation. bytes_loaded, fetch_time, and transform_time are cumulative across iterations of the same dataset instance; because work runs concurrently, the summed stage times can exceed wall-clock time. The queue depths report rows currently waiting in the pipeline, and the progress counters reflect the latest iterator snapshot.

Next steps

PyTorch Data Loader

Stream, shuffle and transform training data with StreamingDataset.

Checkpointing

Save progress so a failed run can pick back up.