Commit 2f261e8f authored by dcuai's avatar dcuai
Browse files

Update configs.py—"LOCAL_RANK"

parent b201526a
...@@ -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={
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment