From 0e48b2358deeb309ff2583884aa46c71c38dcca2 Mon Sep 17 00:00:00 2001 From: Sourab Mangrulkar <13534540+pacman100@users.noreply.github.com> Date: Fri, 1 Dec 2023 19:39:36 +0530 Subject: [PATCH] allow deepspeed without distributed launcher (#2204) --- src/accelerate/state.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/accelerate/state.py b/src/accelerate/state.py index 889a816ba47..a8fa33e3e13 100644 --- a/src/accelerate/state.py +++ b/src/accelerate/state.py @@ -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