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 core functionality of hivemind.Optimizer #403

Merged
merged 146 commits into from
Nov 28, 2021

Conversation

justheuristic
Copy link
Member

@justheuristic justheuristic commented Nov 6, 2021

This PR will implement a subset of #400 via hivemind.optim.experimental.Optimizer

This is a draft PR that implements hivemind optimizer core components. It will be merged piece-wise in #404 #407 and 2 more PRs.

This PR implements the main class of hivemind.Optimizer

  • implement GradientAverager with pre-scheduling
  • test that pre-scheduling works as intended
  • implement ProgressTracker
  • test that ProgressTracker correctly accumulates progress from several peers
  • implement HivemindOptimzier with synchronous or DPU steps
  • check that the new optimizer trains albert-based model similarly to CollaborativeOptimizer

@codecov
Copy link

codecov bot commented Nov 6, 2021

Codecov Report

Merging #403 (f0160ce) into master (00538db) will decrease coverage by 1.15%.
The diff coverage is 64.56%.

@@            Coverage Diff             @@
##           master     #403      +/-   ##
==========================================
- Coverage   84.87%   83.72%   -1.16%     
==========================================
  Files          76       77       +1     
  Lines        7327     7783     +456     
==========================================
+ Hits         6219     6516     +297     
- Misses       1108     1267     +159     
Impacted Files Coverage Δ
hivemind/__init__.py 100.00% <ø> (ø)
hivemind/averaging/partition.py 98.01% <ø> (ø)
hivemind/optim/collaborative.py 23.64% <0.00%> (ø)
hivemind/optim/grad_scaler.py 30.13% <10.86%> (-5.58%) ⬇️
hivemind/averaging/averager.py 85.50% <38.88%> (-1.75%) ⬇️
hivemind/optim/experimental/optimizer.py 64.17% <64.17%> (ø)
hivemind/optim/experimental/grad_averager.py 92.78% <75.00%> (+0.07%) ⬆️
hivemind/optim/experimental/state_averager.py 86.76% <78.12%> (-2.74%) ⬇️
hivemind/averaging/control.py 94.17% <80.00%> (-0.73%) ⬇️
hivemind/optim/experimental/progress_tracker.py 98.28% <91.30%> (+0.80%) ⬆️
... and 7 more

@justheuristic justheuristic force-pushed the hivemind_optimizer_thirdtimesthecharm branch from bd65f8e to f34d02d Compare November 18, 2021 16:41
@justheuristic justheuristic marked this pull request as ready for review November 18, 2021 21:39
@justheuristic
Copy link
Member Author

Verified stability as of commit 8840aaa

image

Using @SeanNaren 's hivemind-lightning

Since that commit, all changes were cosmetic (e.g. docs, renaming internal functions)

@justheuristic justheuristic merged commit 5d31c3b into master Nov 28, 2021
@justheuristic justheuristic deleted the hivemind_optimizer_thirdtimesthecharm branch November 28, 2021 15:20
@justheuristic justheuristic restored the hivemind_optimizer_thirdtimesthecharm branch November 28, 2021 23:51
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.

6 participants