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

Refactor naming and serialization for PeerIDs #339

Merged
merged 9 commits into from
Jul 29, 2021

Conversation

borzunov
Copy link
Member

@borzunov borzunov commented Jul 28, 2021

This PR follows #323 and does the remaining mass refactors (we've agreed on the most of them in comments to #323):

  1. Rename Endpoint to PeerID in averager (+ related variable names)
  2. Rename the P2P.id field to P2P.peer_id (because the local peer ID is stored in the .peer_id fields in all other classes)
  3. Serialize PeerIDs as bytes instead of Base58 string
  4. Remove JoinRequest.peer_id and AveragingData.peer_id fields (they duplicate context.remote_id)
  5. Remove the DecentralizedAveraging gRPC interface (not used anymore)

@borzunov borzunov added the refactor Resolving technical debt label Jul 28, 2021
@codecov
Copy link

codecov bot commented Jul 28, 2021

Codecov Report

Merging #339 (1220c66) into master (3f691fc) will decrease coverage by 0.15%.
The diff coverage is 85.85%.

@@            Coverage Diff             @@
##           master     #339      +/-   ##
==========================================
- Coverage   83.38%   83.23%   -0.16%     
==========================================
  Files          66       66              
  Lines        5981     5975       -6     
==========================================
- Hits         4987     4973      -14     
- Misses        994     1002       +8     
Impacted Files Coverage Δ
hivemind/averaging/key_manager.py 90.00% <75.00%> (ø)
hivemind/averaging/allreduce.py 77.70% <75.75%> (ø)
hivemind/p2p/p2p_daemon.py 95.13% <83.33%> (ø)
hivemind/averaging/matchmaking.py 83.48% <92.10%> (-1.18%) ⬇️
hivemind/averaging/averager.py 85.32% <100.00%> (ø)
hivemind/averaging/group_info.py 100.00% <100.00%> (ø)
hivemind/dht/node.py 92.02% <100.00%> (-1.21%) ⬇️
hivemind/dht/protocol.py 93.05% <100.00%> (ø)
hivemind/optim/collaborative.py 26.20% <100.00%> (ø)
... and 1 more

hivemind/averaging/allreduce.py Show resolved Hide resolved
hivemind/averaging/allreduce.py Outdated Show resolved Hide resolved
@@ -32,7 +25,6 @@ enum MessageCode {
}

message JoinRequest {
string endpoint = 1; // A follower accepts incoming allreduce requests at this address
bytes schema_hash = 2; // A hash that describes follower's tensors (shapes, num tensors, etc)
Copy link
Member

Choose a reason for hiding this comment

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

[the resulting protobuf starts from index=2; discussed with @borzunov and decided to keep it that way unless someone has strong objections]

@borzunov borzunov merged commit 0774937 into master Jul 29, 2021
@borzunov borzunov deleted the follow-up-averager-p2p branch July 29, 2021 11:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor Resolving technical debt
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants