Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement weight as part of the allreduce protocol, not matchmaking #384

Merged
merged 8 commits into from
Sep 24, 2021

Conversation

justheuristic
Copy link
Member

This PR allows specifying allreduce weights in AllReduceRunner, instead of gathering them during matchmaking.

This will allow peers to use their actual batch size in both DPU and advance matchmaking (aka @yhn112 -style matchmaking)

[WIP] implement advance matchmaking as a working example

@codecov
Copy link

codecov bot commented Sep 18, 2021

Codecov Report

Merging #384 (2c28b82) into master (d809e30) will decrease coverage by 0.02%.
The diff coverage is 94.11%.

@@            Coverage Diff             @@
##           master     #384      +/-   ##
==========================================
- Coverage   84.04%   84.02%   -0.03%     
==========================================
  Files          70       70              
  Lines        6426     6423       -3     
==========================================
- Hits         5401     5397       -4     
- Misses       1025     1026       +1     
Impacted Files Coverage Δ
hivemind/averaging/allreduce.py 76.77% <90.90%> (-0.65%) ⬇️
hivemind/averaging/averager.py 86.23% <100.00%> (ø)
hivemind/averaging/partition.py 98.01% <100.00%> (-0.04%) ⬇️

@justheuristic justheuristic changed the title [DO NOT MERGE YET] implement parts as part of the allreduce protocol, not matchmaking Implement weight as part of the allreduce protocol, not matchmaking Sep 18, 2021
@@ -37,13 +38,12 @@ class AllReduceRunner(ServicerBase):
:param prefix: namespace for servicer's RPCs (typically, equal to prefix for group keys)
:param group_id: unique identifier of this specific all-reduce run
:param tensors: local tensors that should be averaged with groupmates
:param tensors: local tensors that should be averaged with groupmates
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, that was in the master code :)

Copy link
Member

@borzunov borzunov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've left one comment, everything else is good :)

@@ -180,9 +182,10 @@ async def _generate_input_for_peer(self, peer_index: int) -> AsyncIterator[avera
code=averaging_pb2.PART_FOR_AVERAGING,
group_id=self.group_id,
tensor_part=first_part,
metadata=self._weight_binary,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we create a new double weight; field instead and avoid encoding the weight to the binary format manually?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done so

Co-authored-by: Alexander Borzunov <[email protected]>
@justheuristic justheuristic merged commit 4a9bc92 into master Sep 24, 2021
@justheuristic justheuristic deleted the allreduce_weights branch September 24, 2021 23:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants