Python: Parallelizing GPU and CPU work
<p>Processing batches for my ML models takes too much time so I am considering parallelizing them.</p>

<p>Right now preprocessing routine grabs data from SSD, does preprocessing and form a data structure for learning. All this time ML training process waits. Then ML process takes this data and uses it to train the model. Now preprocessing waits. And then they go round. This waiting time sums up quickly and delays model training.</p>

<p>The plan is the following: a single data structure would store a bunch of data points. Each step the training algorithm would take random subset of them to train the model (SGD with TensorFlow on GPU).</p>

<p>In parallel with that I would like another thread to do preprocessing of the next bunch of data points. And when preprocessing is ready it would replace old data structure object with the new one. And so forth.</p>

<p>As this is my first approach to parallelization in Python I wonder if this would work at all. Would global interpreter lock prevent the system from doing these tasks in a truly parallel way? </p>