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
d9f36130
Unverified
Commit
d9f36130
authored
Apr 20, 2021
by
Sam Shleifer
Committed by
GitHub
Apr 20, 2021
Browse files
[FSDP] Consolidate cpu_adam optimizer state dict (#607)
parent
1141528e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
1 deletion
+3
-1
benchmarks/experimental/experimental_async_approaches.py
benchmarks/experimental/experimental_async_approaches.py
+0
-1
fairscale/nn/data_parallel/fully_sharded_data_parallel.py
fairscale/nn/data_parallel/fully_sharded_data_parallel.py
+3
-0
No files found.
benchmarks/experimental/experimental_async_approaches.py
View file @
d9f36130
...
...
@@ -810,7 +810,6 @@ def bench_mpi(args):
init_method
=
f
"tcp://
{
os
.
environ
[
'MASTER_ADDR'
]
}
:
{
os
.
environ
[
'MASTER_PORT'
]
}
"
rank
=
torch
.
distributed
.
get_rank
()
world_size
=
torch
.
distributed
.
get_world_size
()
torch
.
cuda
.
set_device
(
local_rank
%
torch
.
cuda
.
device_count
())
rpc
.
init_rpc
(
f
"Test
{
rank
}
"
,
...
...
fairscale/nn/data_parallel/fully_sharded_data_parallel.py
View file @
d9f36130
...
...
@@ -1416,6 +1416,9 @@ class FullyShardedDataParallel(nn.Module):
buffer
=
None
# for sharded tensors
singleton_buffer
=
None
# for singleton tensors
for
buffer_name
,
t
in
v
.
items
():
if
torch
.
is_tensor
(
t
):
t
=
t
.
to
(
self
.
compute_device
)
if
ou
.
is_singleton_tensor
(
t
):
if
singleton_buffer
is
None
:
singleton_buffer
=
list
(
t
.
new_zeros
(
self
.
world_size
).
chunk
(
self
.
world_size
))
...
...
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