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
Megatron-LM
Commits
85876092
"vscode:/vscode.git/clone" did not exist on "22400011d6a498ecf77797a56dfe13bc94c426ca"
Commit
85876092
authored
Dec 10, 2021
by
Lawrence McAfee
Browse files
output tensor now allocated directly on gpu.
parent
e33d63cc
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
megatron/schedules.py
megatron/schedules.py
+2
-2
No files found.
megatron/schedules.py
View file @
85876092
...
@@ -54,7 +54,7 @@ def free_output_tensor(output_tensors):
...
@@ -54,7 +54,7 @@ def free_output_tensor(output_tensors):
if
isinstance
(
output_tensors
,
torch
.
Tensor
):
if
isinstance
(
output_tensors
,
torch
.
Tensor
):
output_tensors
=
[
output_tensors
]
output_tensors
=
[
output_tensors
]
for
output_tensor
in
output_tensors
:
for
output_tensor
in
output_tensors
:
output_tensor
.
data
=
torch
.
FloatTensor
([
0
])
.
to
(
output_tensor
.
data
)
output_tensor
.
data
=
torch
.
cuda
.
FloatTensor
([
0
])
def
custom_backward
(
output
,
grad_output
):
def
custom_backward
(
output
,
grad_output
):
'''Directly call C++ autograd engine.
'''Directly call C++ autograd engine.
...
...
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