Repository: huggingface/accelerate

Issue:
'SageMakerConfig' object has no attribute 'tpu_cluster'
### System Info

```Shell
- `Accelerate` version: 0.17.0.dev0
- Platform: Linux-6.0.12-76060006-generic-x86_64-with-glibc2.35
- Python version: 3.10.9
- Numpy version: 1.24.2
- PyTorch version (GPU?): 1.13.1+cu117 (True)
- `Accelerate` default config:
        - compute_environment: AMAZON_SAGEMAKER
        - distributed_type: NO
        - mixed_precision: no
        - use_cpu: False
        - dynamo_backend: NO
        - ec2_instance_type: ml.g4dn.xlarge
        - iam_role_name: accelerate_sagemaker_execution_role
        - profile: default
        - region: eu-west-1
        - num_machines: 1
        - gpu_ids: all
        - base_job_name: accelerate-sagemaker-1
        - pytorch_version: 1.10.2
        - transformers_version: 4.17.0
        - py_version: py38
```


### Information

- [X] 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

Steps to reproduce:

- Run `accelerate config`
- Choose SageMaker
- Use default values for the configuration

The newly added field `tpu_cluster` is not available but accessed.

```
Traceback (most recent call last):
  File "/opt/conda/bin/accelerate", line 8, in <module>
    sys.exit(main())
  File "/opt/conda/lib/python3.10/site-packages/accelerate/commands/accelerate_cli.py", line 45, in main
    args.func(args)
  File "/opt/conda/lib/python3.10/site-packages/accelerate/commands/launch.py", line 1095, in launch_command
    args.tpu_cluster = defaults.tpu_cluster and args.tpu
AttributeError: 'SageMakerConfig' object has no attribute 'tpu_cluster'
```

![image](https://user-images.githubusercontent.com/7000188/218992737-83dc6325-2bec-4b37-9dd5-507aa45d89f3.png)


### Expected behavior

```Shell
Works in 0.16.0, broken in 0.17.0.dev0
```



Discussion:

Resolving patch:
diff --git a/src/accelerate/commands/config/config_args.py b/src/accelerate/commands/config/config_args.py
--- a/src/accelerate/commands/config/config_args.py
+++ b/src/accelerate/commands/config/config_args.py
@@ -194,3 +194,4 @@ class SageMakerConfig(BaseConfig):
     py_version: str = SAGEMAKER_PYTHON_VERSION
     sagemaker_inputs_file: str = None
     sagemaker_metrics_file: str = None
+    additional_args: dict = None
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
@@ -1043,23 +1043,28 @@ def sagemaker_launcher(sagemaker_config: SageMakerConfig, args):
 
     # configure session
     print("Creating Estimator")
-    huggingface_estimator = HuggingFace(
-        image_uri=sagemaker_config.image_uri,
-        entry_point=entry_point,
-        source_dir=source_dir,
-        role=sagemaker_config.iam_role_name,
-        transformers_version=sagemaker_config.transformers_version,
-        pytorch_version=sagemaker_config.pytorch_version,
-        py_version=sagemaker_config.py_version,
-        base_job_name=sagemaker_config.base_job_name,
-        instance_count=sagemaker_config.num_machines,
-        instance_type=sagemaker_config.ec2_instance_type,
-        debugger_hook_config=False,
-        distribution=distribution,
-        hyperparameters=hyperparameters,
-        environment=environment,
-        metric_definitions=sagemaker_metrics,
-    )
+    args = {
+        "image_uri": sagemaker_config.image_uri,
+        "entry_point": entry_point,
+        "source_dir": source_dir,
+        "role": sagemaker_config.iam_role_name,
+        "transformers_version": sagemaker_config.transformers_version,
+        "pytorch_version": sagemaker_config.pytorch_version,
+        "py_version": sagemaker_config.py_version,
+        "base_job_name": sagemaker_config.base_job_name,
+        "instance_count": sagemaker_config.num_machines,
+        "instance_type": sagemaker_config.ec2_instance_type,
+        "debugger_hook_config": False,
+        "distribution": distribution,
+        "hyperparameters": hyperparameters,
+        "environment": environment,
+        "metric_definitions": sagemaker_metrics,
+    }
+
+    if sagemaker_config.additional_args is not None:
+        args = {**args, **sagemaker_config.additional_args}
+
+    huggingface_estimator = HuggingFace(**args)
 
     huggingface_estimator.fit(inputs=sagemaker_inputs)
     print(f"You can find your model data at: {huggingface_estimator.model_data}")


Test patch: