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
7b585440
Commit
7b585440
authored
Aug 19, 2021
by
mshoeybi
Browse files
onlly support pp=1
parent
e923ec52
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
2 deletions
+4
-2
megatron/arguments.py
megatron/arguments.py
+1
-0
megatron/mpu/random.py
megatron/mpu/random.py
+3
-2
No files found.
megatron/arguments.py
View file @
7b585440
...
@@ -236,6 +236,7 @@ def parse_args(extra_args_provider=None, defaults={},
...
@@ -236,6 +236,7 @@ def parse_args(extra_args_provider=None, defaults={},
assert
args
.
checkpoint_activations
,
\
assert
args
.
checkpoint_activations
,
\
'for distribute-checkpointed-activations to work you '
\
'for distribute-checkpointed-activations to work you '
\
'need to enable checkpoint-activations'
'need to enable checkpoint-activations'
assert
args
.
pipeline_model_parallel_size
==
1
_print_args
(
args
)
_print_args
(
args
)
return
args
return
args
...
...
megatron/mpu/random.py
View file @
7b585440
...
@@ -289,7 +289,8 @@ class CheckpointFunction(torch.autograd.Function):
...
@@ -289,7 +289,8 @@ class CheckpointFunction(torch.autograd.Function):
return
(
None
,
None
)
+
grads
return
(
None
,
None
)
+
grads
def
checkpoint
(
function
,
*
args
):
def
checkpoint
(
function
,
distribute_checkpointed_activations
,
*
args
):
"""Checkpoint a model or part of the model.
"""Checkpoint a model or part of the model.
This has been directly copied from torch.utils.checkpoint."""
This has been directly copied from torch.utils.checkpoint."""
return
CheckpointFunction
.
apply
(
function
,
*
args
)
return
CheckpointFunction
.
apply
(
function
,
distribute_checkpointed_activations
,
*
args
)
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