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
6106127c
Commit
6106127c
authored
May 03, 2020
by
Raul Puri
Browse files
optionally allow no cpu
parent
569b3dab
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
megatron/initialize.py
megatron/initialize.py
+4
-3
No files found.
megatron/initialize.py
View file @
6106127c
...
@@ -29,11 +29,12 @@ from megatron.global_vars import set_global_variables
...
@@ -29,11 +29,12 @@ from megatron.global_vars import set_global_variables
def
initialize_megatron
(
extra_args_provider
=
None
,
args_defaults
=
{},
def
initialize_megatron
(
extra_args_provider
=
None
,
args_defaults
=
{},
ignore_unknown_args
=
False
):
ignore_unknown_args
=
False
,
allow_no_cuda
=
False
):
"""Set global variables, initialize distributed, and
"""Set global variables, initialize distributed, and
set autoresume and random seeds."""
set autoresume and random seeds."""
# Make sure cuda is available.
if
not
allow_no_cuda
:
assert
torch
.
cuda
.
is_available
(),
'Megatron requires CUDA.'
# Make sure cuda is available.
assert
torch
.
cuda
.
is_available
(),
'Megatron requires CUDA.'
# Parse args, build tokenizer, and set adlr-autoresume,
# Parse args, build tokenizer, and set adlr-autoresume,
# tensorboard-writer, and timers.
# tensorboard-writer, and timers.
...
...
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