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
deepspeed
Commits
15ca99c6
Commit
15ca99c6
authored
Sep 10, 2020
by
Jeff Rasley
Browse files
remove old pt file
parent
d15015e9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
33 deletions
+0
-33
deepspeed/pt/deepspeed_zero_utils.py
deepspeed/pt/deepspeed_zero_utils.py
+0
-33
No files found.
deepspeed/pt/deepspeed_zero_utils.py
deleted
100755 → 0
View file @
d15015e9
import
torch
from
torch.autograd
import
Variable
import
collections
def
async_migrate_to
(
obj
,
dev
,
main_stream
=
None
):
if
torch
.
is_tensor
(
obj
):
obj
=
Variable
(
obj
)
if
isinstance
(
obj
,
Variable
):
v
=
obj
.
cuda
(
dev
,
async
=
True
)
if
main_stream
is
not
None
:
v
.
data
.
record_stream
(
main_stream
)
return
v
elif
isinstance
(
obj
,
collections
.
Mapping
):
return
{
k
:
async_copy_to
(
o
,
dev
,
main_stream
)
for
k
,
o
in
obj
.
items
()}
elif
isinstance
(
obj
,
collections
.
Sequence
):
return
[
async_copy_to
(
o
,
dev
,
main_stream
)
for
o
in
obj
]
else
:
return
obj
def
async_copy_to
(
obj
,
dev
,
main_stream
=
None
):
if
torch
.
is_tensor
(
obj
):
obj
=
Variable
(
obj
)
if
isinstance
(
obj
,
Variable
):
target
=
torch
.
empty_like
(
obj
,
device
=
dev
).
copy_
(
obj
)
if
main_stream
is
not
None
:
target
.
data
.
record_stream
(
main_stream
)
return
target
elif
isinstance
(
obj
,
collections
.
Mapping
):
return
{
k
:
async_copy_to
(
o
,
dev
,
main_stream
)
for
k
,
o
in
obj
.
items
()}
elif
isinstance
(
obj
,
collections
.
Sequence
):
return
[
async_copy_to
(
o
,
dev
,
main_stream
)
for
o
in
obj
]
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