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
98bb40d9
Commit
98bb40d9
authored
Apr 19, 2023
by
Abhinav Khattar
Browse files
address review comments
Signed-off-by:
Abhinav Khattar
<
aklife97@gmail.com
>
parent
630811b2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
megatron/core/pipeline_parallel/schedules.py
megatron/core/pipeline_parallel/schedules.py
+2
-2
No files found.
megatron/core/pipeline_parallel/schedules.py
View file @
98bb40d9
...
...
@@ -90,7 +90,7 @@ def get_forward_backward_func():
collect_non_loss_data: TODO
enable_autocat (optional, default=False): If True, runs the
enable_autoca
s
t (optional, default=False): If True, runs the
forward_step_func call inside torch.autocast context
"""
...
...
@@ -188,7 +188,7 @@ def forward_step(forward_step_func,
set_input_tensor
=
get_attr_wrapped_model
(
model
,
"set_input_tensor"
)
set_input_tensor
(
input_tensor
)
context_manager
=
torch
.
autocast
(
"cuda"
)
if
(
enable_autocast
or
torch
.
is_autocast_enabled
())
else
nullcontext
()
context_manager
=
torch
.
autocast
(
"cuda"
)
if
enable_autocast
else
nullcontext
()
with
context_manager
:
output_tensor
,
loss_func
=
forward_step_func
(
data_iterator
,
model
)
...
...
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