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
fcbf1ea3
Unverified
Commit
fcbf1ea3
authored
Mar 18, 2021
by
Myle Ott
Committed by
GitHub
Mar 18, 2021
Browse files
[perf] [FSDP] micro-optimization for memory usage (#533)
parent
7b127ccb
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
0 deletions
+2
-0
fairscale/nn/data_parallel/fully_sharded_data_parallel.py
fairscale/nn/data_parallel/fully_sharded_data_parallel.py
+2
-0
No files found.
fairscale/nn/data_parallel/fully_sharded_data_parallel.py
View file @
fcbf1ea3
...
...
@@ -815,6 +815,8 @@ class FullyShardedDataParallel(nn.Module):
if
self
.
reshard_after_forward
:
self
.
_free_full_params
()
if
self
.
mixed_precision
:
self
.
_free_fp16_param_shard
()
# Switch to main FP32 param shard. We maintain this invariant throughout
# the code, i.e., ``p.data == p._fp32_shard`` after each function. This
...
...
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