Repository: huggingface/accelerate

Issue:
NotImplementedError: Unknown launcher none
### System Info
Using slurm so not all of this will be accurate (i.e. we are using GPU)
```Shell
- `Accelerate` version: 0.13.1
- Platform: Linux-5.10.135-122.509.amzn2.x86_64-x86_64-with-glibc2.2.5
- Python version: 3.8.5
- Numpy version: 1.23.4
- PyTorch version (GPU?): 1.12.1+cu113 (False)
- `Accelerate` default config:
        - compute_environment: LOCAL_MACHINE
        - distributed_type: NO
        - mixed_precision: no
        - use_cpu: False
        - num_processes: 1
        - machine_rank: 0
        - num_machines: 1
        - gpu_ids: all
        - main_process_ip: None
        - main_process_port: None
        - rdzv_backend: static
        - same_network: True
        - main_training_function: main
        - deepspeed_config: {}
        - fsdp_config: {}
        - downcast_bf16: no
```


### Information

- [ ] The official example scripts
- [X] My own modified scripts

### Tasks

- [ ] One of the scripts in the examples/ folder of Accelerate or an officially supported `no_trainer` script in the `examples` folder of the `transformers` repo (such as `run_no_trainer_glue.py`)
- [X] My own task or dataset (give details below)

### Reproduction

Launching a job using this command fails
`accelerate launch --use_deepspeed --num_processes=$(( 8 * $COUNT_NODE )) --num_machines=$COUNT_NODE --machine_rank $THEID --main_process_ip $MASTER_ADDR --main_process_port $MASTER_PORT --zero_stage=2 --gradient_clipping=0.5 --gradient_accumulation_steps=1 --deepspeed_hostfile hostfile train.py`.

with the following error 

```
NotImplementedError: Unknown launcher none
```
The `deepspeed` launcher is called with 
`'['deepspeed', '--no_local_rank', '--hostfile', 
'hostfile', '--launcher', 'None', '--num_gpus', '8', 'train.py'] `

It seems we could check in the [deepspeed_launcher](https://github.com/huggingface/accelerate/blob/415b73853a7b4b2350bfd38305a2c9041c5701ed/src/accelerate/commands/launch.py#L588) if launcher is `None` and set to a default value if we don't want to raise an error here? Happy to open a PR for this if you think it would be beneficial + could suggest on what a good default launcher would be 😄 



### Expected behavior

```Shell
The launcher should either fail and say you need to provide a launcher type or just choose a default.
```



Discussion:
cc @pacman100 
Hello @zanussbaum, Thank you for notifying this issue. As you suggested, a good default launcher is required and it can be "pdsh" launcher which is inline with the DeepSpeed default. Do you want to open a PR with this fix?

Resolving patch:
diff --git a/src/accelerate/commands/launch.py b/src/accelerate/commands/launch.py
--- a/src/accelerate/commands/launch.py
+++ b/src/accelerate/commands/launch.py
@@ -592,6 +592,12 @@ def deepspeed_launcher(args):
     num_machines = getattr(args, "num_machines")
     main_process_ip = getattr(args, "main_process_ip")
     main_process_port = getattr(args, "main_process_port")
+
+    # make sure launcher is not None
+    if args.deepspeed_multinode_launcher is None:
+        # set to default pdsh
+        setattr(args, "deepspeed_multinode_launcher", DEEPSPEED_MULTINODE_LAUNCHERS[0])
+
     if num_machines > 1 and args.deepspeed_multinode_launcher != DEEPSPEED_MULTINODE_LAUNCHERS[1]:
         cmd = ["deepspeed", "--no_local_rank"]
         cmd.extend(["--hostfile", str(args.deepspeed_hostfile), "--launcher", str(args.deepspeed_multinode_launcher)])


Test patch: