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

Disentangle DecentralizedAverager components, add weights #217

Merged
merged 14 commits into from
Apr 10, 2021

Conversation

justheuristic
Copy link
Member

@justheuristic justheuristic commented Apr 10, 2021

This PR changes the internal logic of DecentralizedAverager to make matchmaking code independent of allreduce and vice versa.

  • Matchmaking now returns GroupInfo (before: it returned AllreduceRunner)
  • Matchmaking no longer stores AllReduce parameters
  • Matchmaking no longer owns averaged_tensors
  • Matchmaking no longer handles load balancing
  • Removed group_key_seed (duplicate of group_id)
  • throughput and client_mode is now allgathered via data_for_gather
  • AllReduceRunner now accepts optional peer-wise weights
  • Added test for weighted averaging
  • Fixed a minor bug: when encountering an internal error, averager attempts to warn its groupmates. Previously, it would send warning to peers even if these peers can't accept incoming requests. This caused fabulous error messages.

@justheuristic justheuristic marked this pull request as ready for review April 10, 2021 03:20
@justheuristic justheuristic requested review from mryab and foksly April 10, 2021 03:20
@justheuristic justheuristic requested review from foksly and removed request for foksly April 10, 2021 03:27
@justheuristic
Copy link
Member Author

@foksly if you have time, pls review this as well.

return AllReduceRunner(group_id=group_info.group_id, tensors=averaged_tensors, endpoint=self.endpoint,
ordered_group_endpoints=group_info.endpoints, part_sizes=part_sizes,
weights=weights, gathered=user_gathered, return_deltas=True, **kwargs)
except Exception as e:
Copy link
Member

Choose a reason for hiding this comment

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

It's best to catch a more specific exception

Copy link
Member Author

Choose a reason for hiding this comment

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

This code was intentionally written to catch all kinds of fails
including, but not limited to

  • malformed metadata
  • serialization errors
  • negative throughputs
  • unsolvable load_balancing
  • your endpoint is not in group
  • some endpoint is present multiple times
  • AssertionError

[Resolution: let's keep it as is for now]

@justheuristic justheuristic merged commit 053c7c7 into master Apr 10, 2021
@justheuristic justheuristic deleted the averager-refactor branch April 10, 2021 15:38
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