未验证 提交 45c33ee5 编写于 作者: J Jeff Rasley 提交者: GitHub

local rank of -1 means not set (#720)

上级 6332e313
......@@ -480,7 +480,7 @@ class DeepSpeedEngine(Module):
local_rank_err = "DeepSpeed requires a command line parameter of --local_rank [int] and/or setting the LOCAL_RANK environment variable."
if hasattr(args, 'local_rank'):
assert type(args.local_rank) == int, local_rank_err
if "LOCAL_RANK" in os.environ:
if "LOCAL_RANK" in os.environ and args.local_rank >= 0:
env_local_rank = int(os.environ.get("LOCAL_RANK", -1))
assert env_local_rank == args.local_rank, \
f"Mismatch in local rank setting, args.local_rank={args.local_rank} but env['LOCAL_RANK']={env_local_rank}."
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册