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
1fa778d7
Unverified
Commit
1fa778d7
authored
Mar 11, 2021
by
Benjamin Lefaudeux
Committed by
GitHub
Mar 11, 2021
Browse files
[fix] Lightning compatibility (#510)
parent
5e8a6422
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
fairscale/optim/oss.py
fairscale/optim/oss.py
+1
-1
No files found.
fairscale/optim/oss.py
View file @
1fa778d7
...
@@ -400,7 +400,7 @@ class OSS(Optimizer):
...
@@ -400,7 +400,7 @@ class OSS(Optimizer):
# Populate the sharded optimizer state on the fly,
# Populate the sharded optimizer state on the fly,
# remove the params that this rank does not own
# remove the params that this rank does not own
if
self
.
param_to_rank
[
param
]
!=
self
.
rank
:
if
self
.
param_to_rank
[
param
]
!=
self
.
rank
:
state_dict
[
"state"
][
key
]
=
None
state_dict
[
"state"
][
key
]
=
{}
else
:
else
:
self
.
optim
.
state
[
param
]
=
recursive_copy_to_device
(
value
,
non_blocking
=
True
,
device
=
param
.
device
)
self
.
optim
.
state
[
param
]
=
recursive_copy_to_device
(
value
,
non_blocking
=
True
,
device
=
param
.
device
)
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