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
ModelZoo
OFA_pytorch
Commits
2f261e8f
Commit
2f261e8f
authored
Sep 19, 2024
by
dcuai
Browse files
Update configs.py—"LOCAL_RANK"
parent
b201526a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
fairseq/fairseq/dataclass/configs.py
fairseq/fairseq/dataclass/configs.py
+8
-2
No files found.
fairseq/fairseq/dataclass/configs.py
View file @
2f261e8f
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
#
#
# This source code is licensed under the MIT license found in the
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
# LICENSE file in the root directory of this source tree.
import
os
import
sys
import
sys
from
dataclasses
import
_MISSING_TYPE
,
dataclass
,
field
from
dataclasses
import
_MISSING_TYPE
,
dataclass
,
field
from
typing
import
Any
,
List
,
Optional
from
typing
import
Any
,
List
,
Optional
...
@@ -271,12 +271,18 @@ class DistributedTrainingConfig(FairseqDataclass):
...
@@ -271,12 +271,18 @@ class DistributedTrainingConfig(FairseqDataclass):
},
},
)
)
device_id
:
int
=
field
(
device_id
:
int
=
field
(
default
=
0
,
default
=
int
(
os
.
environ
[
"LOCAL_RANK"
])
,
metadata
=
{
metadata
=
{
"help"
:
"which GPU to use (usually configured automatically)"
,
"help"
:
"which GPU to use (usually configured automatically)"
,
"argparse_alias"
:
"--local_rank"
,
"argparse_alias"
:
"--local_rank"
,
},
},
)
)
local_rank
:
int
=
field
(
default
=
int
(
os
.
environ
[
"LOCAL_RANK"
]),
metadata
=
{
"help"
:
"which GPU to use (usually configured automatically)"
,
},
)
distributed_no_spawn
:
bool
=
field
(
distributed_no_spawn
:
bool
=
field
(
default
=
False
,
default
=
False
,
metadata
=
{
metadata
=
{
...
...
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