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
6fe415e9
Commit
6fe415e9
authored
Jun 01, 2022
by
Rick Ho
Browse files
fix bug for sync_params
parent
21a331fb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
8 deletions
+0
-8
fmoe/distributed.py
fmoe/distributed.py
+0
-8
No files found.
fmoe/distributed.py
View file @
6fe415e9
...
@@ -78,16 +78,8 @@ class DistributedGroupedDataParallel(nn.Module):
...
@@ -78,16 +78,8 @@ class DistributedGroupedDataParallel(nn.Module):
self
.
_sync_params
()
self
.
_sync_params
()
def
_sync_params
(
self
):
def
_sync_params
(
self
):
r
"""
Note that this module does not guarantee initial consistency of
parameters. Users are supposed to manually initalize the model on
different workers with the same parameters using either this function
or other methods like pre-defined random seeds.
"""
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