Add version-consistent result rounding to load_balance_peers #230
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.
Problem:
In current version, calling load_balance_peers may result in a nasty bug: two peers with different numpy/scipy versions (or even different builds of the same version, such as mkl/nomkl) can make incompatible decisions on how to round load balancing outputs.
Here's an example from my local laptiop (numpy+atlas)

Here's a colab instance with the same version of numpy+scipy, but different build and python version

When training collaboratively, all AWS peers would split vector parts as:
(4461869, 4461869, 4461868, 4461868, 0, 0, 0, 0)
... while a some desktop peers decided:
(4461869, 4461868, 4461868, 4461869, 0, 0, 0, 0)
As a result, AllReduce failed with INTERNAL_ERROR due to incompatible part sizes.
Solution: