Skip to content

Commit

Permalink
allow deepspeed without distributed launcher (#2204)
Browse files Browse the repository at this point in the history
  • Loading branch information
pacman100 authored Dec 1, 2023
1 parent 3499cf2 commit 0e48b23
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/accelerate/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,11 @@ def __init__(self, cpu: bool = False, **kwargs):
else:
self.device = self.default_device
else:
self.distributed_type = DistributedType.NO
self.distributed_type = (
DistributedType.NO
if os.environ.get("ACCELERATE_USE_DEEPSPEED", "false") == "false"
else DistributedType.DEEPSPEED
)
self.num_processes = 1
self.process_index = self.local_process_index = 0

Expand Down

0 comments on commit 0e48b23

Please sign in to comment.