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
5c5866b3
Unverified
Commit
5c5866b3
authored
Mar 01, 2021
by
Sean Naren
Committed by
GitHub
Mar 01, 2021
Browse files
Add is root check to only cast to FP16 on main FSDP wrapper (#452)
parent
c114a219
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
fairscale/nn/data_parallel/fully_sharded_data_parallel.py
fairscale/nn/data_parallel/fully_sharded_data_parallel.py
+1
-1
No files found.
fairscale/nn/data_parallel/fully_sharded_data_parallel.py
View file @
5c5866b3
...
...
@@ -736,7 +736,7 @@ class FullyShardedDataParallel(nn.Module):
# Start of a forward pass.
self
.
training_state
=
TrainingState
.
FORWARD
if
self
.
mixed_precision
:
if
self
.
_is_root
and
self
.
mixed_precision
:
args
,
kwargs
=
cast_inputs_to_fp16
(
*
args
,
**
kwargs
)
# All-gather full parameters. This will also transfer FP32 parameters to
...
...
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