Add a ThreadPool which respects the order of Parquet dataset pieces.#796
Add a ThreadPool which respects the order of Parquet dataset pieces.#796wbeardall wants to merge 2 commits intouber:masterfrom
Conversation
… 'make_batch_reader' and test.
|
As someone who needs repeatability I'd really like to see this merged. Do you have any insight into the performance implications? Clearly this should be faster than setting I would assume that any performance differences would only be noticeable for the first few items, and once all queues are all filled and model training becomes the bottleneck there should be almost no difference compared to unordered |
|
The additional overhead seems to be functionally negligible for most practical use-cases where you're model bottlenecked. @jrauch-pros you are correct that there is a performance cost at initialization, see below: |

This PR offers a solution for #551, where the standard ThreadPool implementation can return dataset pieces out of order.
Contributions
OrderedThreadPoolimplementation, which internally keeps track of results and the pieces indexes returned by the ventilator, and only returns pieces in exact order.WorkerThreadis that it returns indexedOrderedVentilatedItemProcessedMessageobjects.make_readerandmake_batch_readerto allow for instantation ofOrderedThreadPoolobjects from string withreader_pool_type="orderedthread"make_readerandmake_batch_readerto include the ordered optiontest_parquet_reader.pyWorked Example
We provide a modified version of the minimal code example in #551, which can be used to verify the solution.