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
FastMoE
Commits
670e1407
Unverified
Commit
670e1407
authored
Jun 01, 2022
by
Rick Ho
Committed by
GitHub
Jun 01, 2022
Browse files
Merge pull request #117 from laekov/distributed-doc
Add a hint for DGDP synchronization
parents
527e66af
039b4550
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
fmoe/distributed.py
fmoe/distributed.py
+3
-3
No files found.
fmoe/distributed.py
View file @
670e1407
...
@@ -26,6 +26,7 @@ class DistributedGroupedDataParallel(nn.Module):
...
@@ -26,6 +26,7 @@ class DistributedGroupedDataParallel(nn.Module):
self
,
self
,
module
,
module
,
auto_allreduce
=
False
,
auto_allreduce
=
False
,
need_sync
=
True
,
**
kwargs
**
kwargs
):
):
assert
not
auto_allreduce
,
"Automatic all-reduce is not implemented yet"
assert
not
auto_allreduce
,
"Automatic all-reduce is not implemented yet"
...
@@ -75,13 +76,12 @@ class DistributedGroupedDataParallel(nn.Module):
...
@@ -75,13 +76,12 @@ class DistributedGroupedDataParallel(nn.Module):
g
.
copy_
(
s
)
g
.
copy_
(
s
)
self
.
allreduce_params
=
allreduce_params
self
.
allreduce_params
=
allreduce_params
self
.
_sync_params
()
if
need_sync
:
self
.
_sync_params
()
def
_sync_params
(
self
):
def
_sync_params
(
self
):
groups
=
dict
()
groups
=
dict
()
for
p
in
self
.
module
.
parameters
():
for
p
in
self
.
module
.
parameters
():
if
not
p
.
requires_grad
or
p
.
grad
is
None
:
continue
if
hasattr
(
p
,
"dp_comm"
):
if
hasattr
(
p
,
"dp_comm"
):
dp_comm
=
p
.
dp_comm
dp_comm
=
p
.
dp_comm
else
:
else
:
...
...
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