Support multiple data providers #207
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Handle the case of multiple data providers providing the same dataset. For that case we assume that a dataset name is used uniquely for the same dataset. With that assumption, we can inform workers of the multiple data providers for a dataset and have them choose between them when downloading data slices. Right now, workers choose randomly if there are multiple data providers available.
Tested locally by having 2 data providers with the MNIST dataset. Workers pulled slices from both of them.
Remarks:
While this allows for simple load balancing when pull data, this won't provide any fault tolerance if data providers are no longer available: The scheduler determines the available data providers once. For fault tolerance, this needs to be done for each data slice request from workers. Furthermore, data providers add themselves into the DHT using start_providing. It'll take a while after a provider is gone that this record is removed from the DHT. We would have to account for this by checking the actual availability of data providers as reported by the DHT.