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
630811b2
Commit
630811b2
authored
Apr 19, 2023
by
Abhinav Khattar
Browse files
keep previous autocast check
Signed-off-by:
Abhinav Khattar
<
aklife97@gmail.com
>
parent
513d7d8e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
megatron/core/pipeline_parallel/schedules.py
megatron/core/pipeline_parallel/schedules.py
+1
-1
No files found.
megatron/core/pipeline_parallel/schedules.py
View file @
630811b2
...
@@ -188,7 +188,7 @@ def forward_step(forward_step_func,
...
@@ -188,7 +188,7 @@ def forward_step(forward_step_func,
set_input_tensor
=
get_attr_wrapped_model
(
model
,
"set_input_tensor"
)
set_input_tensor
=
get_attr_wrapped_model
(
model
,
"set_input_tensor"
)
set_input_tensor
(
input_tensor
)
set_input_tensor
(
input_tensor
)
context_manager
=
torch
.
autocast
(
"cuda"
)
if
enable_autocast
else
nullcontext
()
context_manager
=
torch
.
autocast
(
"cuda"
)
if
(
enable_autocast
or
torch
.
is_autocast_enabled
())
else
nullcontext
()
with
context_manager
:
with
context_manager
:
output_tensor
,
loss_func
=
forward_step_func
(
data_iterator
,
model
)
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