# Does Trainer use multiple workers on datasets?

**URL:** <https://discuss.huggingface.co/t/does-trainer-use-multiple-workers-on-datasets/46694>\
**Category:** 🤗Transformers\
**Created:** [July 13, 2023, 2:04pm UTC](https://discuss.huggingface.co/t/does-trainer-use-multiple-workers-on-datasets/46694 "2023-07-13T14:04:47Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![oran-sh](https://avatars.discourse-cdn.com/v4/letter/o/a4c791/32.png) [@oran-sh](https://discuss.huggingface.co/u/oran-sh)\
**Post date:** [July 13, 2023, 2:04pm UTC](https://discuss.huggingface.co/t/does-trainer-use-multiple-workers-on-datasets/46694/1 "2023-07-13T14:04:48Z")

</div>

Hey,  
when using trainer with a hugging face dataset, does it use multiple workers and prefetching when loading batches (as can be done with torch.DataLoader)?  
This can extremely effect training time. Is there a way to prefetch data so that it won’t be a bottleneck for training?

Thanks
