Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
fairscale
Commits
3dcc9eff
Unverified
Commit
3dcc9eff
authored
May 26, 2021
by
msbaines
Committed by
GitHub
May 26, 2021
Browse files
[docs] add MOE to docs (#693)
parent
2c663f5a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
5 deletions
+12
-5
docs/source/api/index.rst
docs/source/api/index.rst
+1
-0
docs/source/api/nn/moe.rst
docs/source/api/nn/moe.rst
+4
-0
docs/source/index.rst
docs/source/index.rst
+3
-0
fairscale/nn/moe/moe_layer.py
fairscale/nn/moe/moe_layer.py
+4
-5
No files found.
docs/source/api/index.rst
View file @
3dcc9eff
...
...
@@ -7,6 +7,7 @@ API Reference
optim/adascale
optim/oss
optim/grad_scaler
nn/moe
nn/pipe
nn/sharded_ddp
nn/fsdp
...
...
docs/source/api/nn/moe.rst
0 → 100644
View file @
3dcc9eff
Mixture Of Experts
==================
.. autoclass:: fairscale.nn.MOELayer
docs/source/index.rst
View file @
3dcc9eff
...
...
@@ -26,6 +26,9 @@ Components
* `Fully Sharded Data Parallel FSDP <../../en/latest/api/nn/fsdp.html>`_
* `FSDP Tips <../../en/latest/api/nn/fsdp_tips.html>`_
* Mixture-of-Experts:
* `MOE <../../en/latest/api/nn/moe.html>`_
* Optimization at scale:
* `AdaScale SGD <../../en/latest/api/optim/adascale.html>`_
...
...
fairscale/nn/moe/moe_layer.py
View file @
3dcc9eff
...
...
@@ -43,13 +43,12 @@ class MOELayer(Base):
output = moe(input)
l_aux = moe.l_aux
.. Gshard
_
: https://arxiv.org/pdf/2006.16668.pdf
..
_
Gshard: https://arxiv.org/pdf/2006.16668.pdf
Args:
gate (torch.nn.Module):
gate network
expert (torch.nn.Module):
expert network
gate: gate network
expert: expert network
group: group to use for all-to-all communication
"""
def
__init__
(
self
,
gate
:
Module
,
experts
:
Union
[
Module
,
ModuleList
],
group
:
Optional
[
Any
]
=
None
)
->
None
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment