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

Improve Optimizer docs, update quickstart to use Optimizer #416

Merged
merged 23 commits into from
Dec 2, 2021

Conversation

justheuristic
Copy link
Member

  • deduplicate docs, fix typos, improve formatting
  • switch quickstart.md to the new optimizer

@codecov
Copy link

codecov bot commented Nov 29, 2021

Codecov Report

Merging #416 (7a20275) into master (318bb7a) will increase coverage by 0.09%.
The diff coverage is 50.00%.

@@            Coverage Diff             @@
##           master     #416      +/-   ##
==========================================
+ Coverage   83.57%   83.67%   +0.09%     
==========================================
  Files          77       77              
  Lines        7788     7790       +2     
==========================================
+ Hits         6509     6518       +9     
+ Misses       1279     1272       -7     
Impacted Files Coverage Δ
hivemind/optim/collaborative.py 23.64% <ø> (ø)
hivemind/optim/experimental/optimizer.py 64.17% <ø> (ø)
hivemind/optim/grad_scaler.py 30.13% <ø> (ø)
hivemind/compression/base.py 92.00% <50.00%> (-1.75%) ⬇️
hivemind/averaging/averager.py 85.50% <0.00%> (+0.72%) ⬆️
hivemind/averaging/matchmaking.py 89.09% <0.00%> (+0.90%) ⬆️
hivemind/utils/mpfuture.py 95.00% <0.00%> (+0.90%) ⬆️

@justheuristic justheuristic changed the title Update Optimizer docs, improve quickstart Improve Optimizer docs, update quickstart to use Optimizer Nov 29, 2021
hivemind/optim/grad_scaler.py Show resolved Hide resolved
hivemind/optim/experimental/optimizer.py Outdated Show resolved Hide resolved
hivemind/optim/experimental/optimizer.py Show resolved Hide resolved
@@ -26,9 +29,9 @@

.. raw:: html

CollaborativeOptimizer is a legacy version of hivemind.Optimizer. **For new projects, please use hivemind.Optimizer.**
CollaborativeOptimizer is a legacy version of hivemind.Optimizer. <b>For new projects please use hivemind.Optimizer</b>.
Currently, hivemind.Optimizer supports all the features of CollaborativeOptimizer and then some.
Copy link
Member

Choose a reason for hiding this comment

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

supports all the features of CollaborativeOptimizer and then some.

The sentence seems to be not finished.

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

I think this phrase is not widely-known enough to be used in the docs. Most readers just won't understand it :(

docs/modules/optim.rst Show resolved Hide resolved
>>> # alternative: opt = hivemind.Optimizer(dht, run_id="run_42", optimizer=torch.optim.Adam(model.parameters())
>>> opt = hivemind.Optimizer(dht=dht, run_id="run_42", params=model.parameters(),
>>> optimizer=lambda params: torch.optim.Adam(params, **other_options),
>>> target_batch_size=4096, batch_size_per_step=4)
Copy link
Member

Choose a reason for hiding this comment

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

Let's use the same order of parameters in hivemind.Optimizer definition, both examples in the API docs and the quickstart. It makes it easier to compare the values of the same arguments in these examples, as well as go through them to check whether you've specified all you need in your own code.

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed

```

Congrats, you've just started a pocket-sized experiment with decentralized deep learning!

However, this is just the bare minimum of what hivemind can do. In [this example](https://github.com/learning-at-home/hivemind/tree/master/examples/albert),
However, this is only the basics of what hivemind can do. In [this example](https://github.com/learning-at-home/hivemind/tree/master/examples/albert),
we show how to use a more advanced version of DecentralizedOptimizer to collaboratively train a large Transformer over the internet.
Copy link
Member

@borzunov borzunov Dec 2, 2021

Choose a reason for hiding this comment

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

Please replace DecentralizedOptimizer -> hivemind.Optimizer here and in L186.

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed

```

Congrats, you've just started a pocket-sized experiment with decentralized deep learning!

However, this is just the bare minimum of what hivemind can do. In [this example](https://github.com/learning-at-home/hivemind/tree/master/examples/albert),
However, this is only the basics of what hivemind can do. In [this example](https://github.com/learning-at-home/hivemind/tree/master/examples/albert),
we show how to use a more advanced version of DecentralizedOptimizer to collaboratively train a large Transformer over the internet.

If you want to learn more about each individual component,
Copy link
Member

@borzunov borzunov Dec 2, 2021

Choose a reason for hiding this comment

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

Please replace:

  • (Li et al. 2020) -> Li et al. (2020)
  • (Ryabinin et al. 2021) -> Ryabinin et al. (2021)

@justheuristic justheuristic merged commit 40726cd into master Dec 2, 2021
@justheuristic justheuristic deleted the optimizer-docs-review branch December 2, 2021 13:36
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