

TITLE
Data Loading as a Service

COMMENTS
6

REACTIONS
+1: 0
-1: 0
laugh: 0
hooray: 0
heart: 0
rocket: 0
eyes: 3

BODY
# 🚀 Not a Feature request, what am I here for then?

Well, mainly I'd just like to get some feedback from fellow software engineers. Some of the frustrations I've experienced might not have been big issues at all or there could have been easy ways to get around them which I've failed to notice. Getting roasted can be a good way for us to identify obvious flaws in our thought processes that aren't so obvious from our own often tunneled point of view.

## Motivation

Data loading in PyTorch requires the user to define the Dataset, collator, as well as a sampling strategy.
I found it rather hard to stick to the framework when I have to deal with
- Extremely large datasets that do not fit in system memory
- The previous point + training with multiple processes and nodes

For Language Modeling and Machine Translation,
- We often have to deal with large text/CSV files that are multiple times the size of system memory.
- Also running training on a single GPU is often slow to the point of frustration.
- Then we have to duplicate the extremely large dataset across each machine.
- To format the data we have into a PyTorch Dataset, we simply just do a hack where we wrap an IO stream into a PyTorch Dataset
- Or preprocess the entire dataset beforehand to speed up data loading.
- Sometimes we would keep an index table to "lookup" the position of a data entry in a file which can be slow if not using SSD to perform random access.

Instead of trying to write code that fits into the format expected by PyTorch. I simply threw everything out the window and just made data loading a standalone service instead...

## Your contribution

Well, I've uploaded my work on https://github.com/mingruimingrui/data-loader-as-a-service-demo.

If you have taken your time to read up to this point, I would like to give you my gratitude as it had made me quite happy (^o^)
I would also like to ask for you to leave some comments for me which can be any of the following.
1. Can you relate to the problems I've faced?
2. Which part of the Data Loading as a Service do you like?
3. Which part of the Data Loading as a Service do you not like or have problems agreeing with?
5. Any other comments would also be appreciated.
