"git@developer.sourcefind.cn:renzhc/diffusers_dcu.git" did not exist on "4ace7d0483d9b5016575a2d51119c33172c005ed"
Commit 3cecbc1d authored by Jeff Rasley's avatar Jeff Rasley
Browse files

properly set engine.local_rank if it's set to -1

parent 5e522efc
...@@ -458,10 +458,10 @@ class DeepSpeedEngine(Module): ...@@ -458,10 +458,10 @@ class DeepSpeedEngine(Module):
# Configure based on command line arguments # Configure based on command line arguments
def _configure_with_arguments(self, args, mpu): def _configure_with_arguments(self, args, mpu):
self.local_rank = args.local_rank if hasattr( if hasattr(args, 'local_rank') and args.local_rank >= 0:
args, self.local_rank = args.local_rank
'local_rank') else int(os.environ.get("LOCAL_RANK", else:
-1)) self.local_rank = int(os.environ.get("LOCAL_RANK", -1))
config_file = args.deepspeed_config if hasattr(args, config_file = args.deepspeed_config if hasattr(args,
'deepspeed_config') else None 'deepspeed_config') else None
......
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