diff --git a/docs/source/index.rst b/docs/source/index.rst
index efdeb8f88..ceef4fc91 100644
--- a/docs/source/index.rst
+++ b/docs/source/index.rst
@@ -144,6 +144,11 @@ Supported integrations
     quicktour
     installation
 
+.. toctree::
+    :maxdepth: 2
+    :caption: Guides
+
+    sagemaker
 
 .. toctree::
     :maxdepth: 2
diff --git a/docs/source/sagemaker.rst b/docs/source/sagemaker.rst
new file mode 100644
index 000000000..b889c99b3
--- /dev/null
+++ b/docs/source/sagemaker.rst
@@ -0,0 +1,169 @@
+.. 
+    Copyright 2021 The HuggingFace Team. All rights reserved.
+
+    Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
+    the License. You may obtain a copy of the License at
+
+        http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
+    an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
+    specific language governing permissions and limitations under the License.
+
+Amazon SageMaker
+=======================================================================================================================
+
+Hugging Face and Amazon introduced new `Hugging Face Deep Learning Containers (DLCs)
+<https://github.com/aws/deep-learning-containers/blob/master/available_images.md#huggingface-training-containers>`_ to
+make it easier than ever to train Hugging Face Transformer models in `Amazon SageMaker
+<https://aws.amazon.com/sagemaker/>`_.
+
+To learn how to use the new 🤗 DLCs with the Amazon SageMaker to run your 🤗 Accelerate scripts and raw training loops.0
+
+
+
+Getting Started
+-----------------------------------------------------------------------------------------------------------------------
+
+Setup & Installation
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+
+Before you can run your 🤗 Accelerate scripts on Amazon SageMaker you need to sign up for an AWS account. If you do not
+have an AWS account yet learn more `here <https://docs.aws.amazon.com/sagemaker/latest/dg/gs-set-up.html>`__.
+
+After you have your AWS Account you need to install the ``sagemaker`` sdk for 🤗 Accelerate with.
+
+.. code-block:: 
+
+    pip install "accelerate[sagemaker]" --upgrade
+
+
+🤗 Accelerate currently uses the 🤗 DLCs, with ``transformers``, ``datasets`` and ``tokenizers`` pre-installed. 🤗
+Accelerate is not in the DLC yet (will soon be added!) so to use it within Amazon SageMaker you need to create a
+``requirements.txt`` in the same directory where your training script is located and add it as dependency.
+
+.. code-block:: 
+
+    accelerate
+
+You should also add any other dependencies you have to this ``requirements.txt``.
+
+
+Configure 🤗 Accelerate
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+You can configure the launch configuration for Amazon SageMaker the same as you do for non SageMaker training jobs with
+the 🤗 Accelerate CLI.
+
+.. code-block:: 
+
+    accelerate config
+    # In which compute environment are you running? ([0] This machine, [1] AWS (Amazon SageMaker)): 1
+
+
+🤗 Accelerate will go through a questionnaire about your Amazon SageMaker setup and create a config file you can edit.
+
+.. note::
+    🤗 Accelerate is not saving any of your credentials.
+
+
+Prepare a 🤗 Accelerate fine-tuning script
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+The training script is very similar to a training script you might run outside of SageMaker, but to save your model
+after training you need to specify either ``/opt/ml/model`` or use ``os.environ["SM_MODEL_DIR"]`` as your save
+directory. After training, artifacts in this directory are uploaded to S3.
+
+
+.. code-block:: diff
+
+    - torch.save('/opt/ml/model`)
+    + accelerator.save('/opt/ml/model')
+
+
+.. warning::
+    SageMaker doesn’t support argparse actions. If you want to use, for example, boolean hyperparameters, you need to
+    specify type as bool in your script and provide an explicit True or False value for this hyperparameter. `[REF]
+    <https://sagemaker.readthedocs.io/en/stable/frameworks/pytorch/using_pytorch.html#prepare-a-pytorch-training-script>`__.
+
+
+Launch Training
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+You can launch your training with 🤗 Accelerate CLI with
+
+.. code-block:: 
+
+    accelerate launch path_to_script.py --args_to_the_script
+
+
+This will launch your training script using your configuration. The only thing you have to do is provide all the
+arguments needed by your training script as named arguments.
+
+**Examples**
+
+.. note::
+    If you run one of the example scripts, don't forget to add ``accelerator.save('/opt/ml/model')`` to it.
+
+.. code-block:: 
+
+    accelerate launch ./examples/sagemaker_example.py 
+
+
+Outputs:
+
+.. code-block:: 
+
+    Configuring Amazon SageMaker environment
+    Converting Arguments to Hyperparameters
+    Creating Estimator
+    2021-04-08 11:56:50 Starting - Starting the training job...
+    2021-04-08 11:57:13 Starting - Launching requested ML instancesProfilerReport-1617883008: InProgress
+    .........
+    2021-04-08 11:58:54 Starting - Preparing the instances for training.........
+    2021-04-08 12:00:24 Downloading - Downloading input data
+    2021-04-08 12:00:24 Training - Downloading the training image..................
+    2021-04-08 12:03:39 Training - Training image download completed. Training in progress..
+    ........
+    epoch 0: {'accuracy': 0.7598039215686274, 'f1': 0.8178438661710037}
+    epoch 1: {'accuracy': 0.8357843137254902, 'f1': 0.882249560632689}
+    epoch 2: {'accuracy': 0.8406862745098039, 'f1': 0.8869565217391304}
+    ........
+    2021-04-08 12:05:40 Uploading - Uploading generated training model
+    2021-04-08 12:05:40 Completed - Training job completed
+    Training seconds: 331
+    Billable seconds: 331
+    You can find your model data at: s3://your-bucket/accelerate-sagemaker-1-2021-04-08-11-56-47-108/output/model.tar.gz
+
+
+
+Advanced Features
+-----------------------------------------------------------------------------------------------------------------------
+
+Distributed Training: Data Parallelism
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+*currently in development, will be supported soon.*
+
+Distributed Training: Model Parallelism
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+*currently in development, will be supported soon.*
+
+Python packages and dependencies
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+🤗 Accelerate currently uses the 🤗 DLCs, with ``transformers``, ``datasets`` and ``tokenizers`` pre-installed. If you
+want to use different/other Python packages you can do this by adding them to the ``requirements.txt``. These packages
+will be installed before your training script is started.
+
+Remote scripts: Use scripts located on Github
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+*undecided if feature is needed. Contact us if you would like this feature.*
+
+Use Spot Instances
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+*undecided if feature is needed. Contact us if you would like this feature.*
diff --git a/examples/nlp_example.py b/examples/nlp_example.py
index aad2b8b65..220c6ddcc 100644
--- a/examples/nlp_example.py
+++ b/examples/nlp_example.py
@@ -162,8 +162,8 @@ def collate_fn(examples):
 
 def main():
     parser = argparse.ArgumentParser(description="Simple example of training script.")
-    parser.add_argument("--fp16", action="store_true", help="If passed, will use FP16 training.")
-    parser.add_argument("--cpu", action="store_true", help="If passed, will train on the CPU.")
+    parser.add_argument("--fp16", type=bool, default=False, help="If passed, will use FP16 training.")
+    parser.add_argument("--cpu", type=bool, default=False, help="If passed, will train on the CPU.")
     args = parser.parse_args()
     config = {"lr": 2e-5, "num_epochs": 3, "correct_bias": True, "seed": 42, "batch_size": 16}
     training_function(config, args)
diff --git a/examples/requirements.txt b/examples/requirements.txt
new file mode 100644
index 000000000..65b6b04c3
--- /dev/null
+++ b/examples/requirements.txt
@@ -0,0 +1 @@
+accelerate # used to be installed in Amazon SageMaker environment
\ No newline at end of file
diff --git a/setup.py b/setup.py
index e2ce2cfbc..b2700c015 100644
--- a/setup.py
+++ b/setup.py
@@ -56,7 +56,7 @@
         ]
     },
     python_requires=">=3.6.0",
-    install_requires=["torch>=1.4.0"],
+    install_requires=["torch>=1.4.0", "pyaml>=20.4.0"],
     extras_require=extras,
     classifiers=[
         "Development Status :: 5 - Production/Stable",
diff --git a/src/accelerate/commands/config/config_args.py b/src/accelerate/commands/config/config_args.py
index fe2cb122a..a05debfda 100644
--- a/src/accelerate/commands/config/config_args.py
+++ b/src/accelerate/commands/config/config_args.py
@@ -42,13 +42,19 @@ def load_config_from_file(config_file):
     config_file = config_file if config_file is not None else default_config_file
     with open(config_file, "r", encoding="utf-8") as f:
         if config_file.endswith(".json"):
-            if json.load(f).get("compute_environment", ComputeEnvironment.LOCAL_MACHINE):
+            if (
+                json.load(f).get("compute_environment", ComputeEnvironment.LOCAL_MACHINE)
+                is ComputeEnvironment.LOCAL_MACHINE
+            ):
                 config_class = ClusterConfig
             else:
                 config_class = SageMakerConfig
             return config_class.from_json_file(json_file=config_file)
         else:
-            if yaml.safe_load(f).get("compute_environment", ComputeEnvironment.LOCAL_MACHINE):
+            if (
+                yaml.safe_load(f).get("compute_environment", ComputeEnvironment.LOCAL_MACHINE)
+                is ComputeEnvironment.LOCAL_MACHINE
+            ):
                 config_class = ClusterConfig
             else:
                 config_class = SageMakerConfig
@@ -121,5 +127,5 @@ class SageMakerConfig(BaseConfig):
     region: str = "us-east-1"
     num_machines: int = 1
     base_job_name: str = f"accelerate-sagemaker-{num_machines}"
-    pytroch_version: str = "1.6"
+    pytorch_version: str = "1.6"
     transformers_version: str = "4.4"
diff --git a/src/accelerate/commands/config/sagemaker.py b/src/accelerate/commands/config/sagemaker.py
index 25fd3e6cb..feff0aecf 100644
--- a/src/accelerate/commands/config/sagemaker.py
+++ b/src/accelerate/commands/config/sagemaker.py
@@ -97,7 +97,8 @@ def get_sagemaker_input():
         os.environ["AWS_PROFILE"] = aws_profile
     else:
         print(
-            "Accelerate will expose AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY environment variables on the machine"
+            "Note you will need to provide AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY when you launch you training script with,"
+            "`accelerate launch --aws_access_key_id XXX --aws_secret_access_key YYY`"
         )
         aws_access_key_id = _ask_field("AWS Access Key ID: ")
         os.environ["AWS_ACCESS_KEY_ID"] = aws_access_key_id
diff --git a/src/accelerate/commands/launch.py b/src/accelerate/commands/launch.py
index cd3ae65cc..382636253 100644
--- a/src/accelerate/commands/launch.py
+++ b/src/accelerate/commands/launch.py
@@ -20,10 +20,14 @@
 import os
 import subprocess
 import sys
+from ast import literal_eval
 from pathlib import Path
+from typing import Dict, List
 
 from accelerate.commands.config import default_config_file, load_config_from_file
+from accelerate.commands.config.config_args import SageMakerConfig
 from accelerate.state import ComputeEnvironment, DistributedType
+from accelerate.utils import is_sagemaker_available
 
 
 class _AddOneArg:
@@ -80,6 +84,18 @@ def launch_command_parser(subparsers=None):
         default=None,
         help="The name of the main function to be executed in your script (only for TPU training).",
     )
+    parser.add_argument(
+        "--aws_access_key_id",
+        type=str,
+        default=None,
+        help="The AWS_ACCESS_KEY_ID used to launch the Amazon SageMaker training job",
+    )
+    parser.add_argument(
+        "--aws_secret_access_key",
+        type=str,
+        default=None,
+        help="The AWS_SECRET_ACCESS_KEY used to launch the Amazon SageMaker training job",
+    )
     parser.add_argument(
         "training_script",
         type=str,
@@ -168,11 +184,107 @@ def tpu_launcher(args):
         xmp.spawn(main_function, args=(), nprocs=args.num_processes)
 
 
-def sagemaker_launcher(sagemaker_config, args):
-    raise NotImplementedError(
-        "Support for starting SageMaker training is not yet implemented. But you can create configs for it."
+def _convert_nargs_to_dict(nargs: List[str]) -> Dict[str, str]:
+    if len(nargs) < 0:
+        return {}
+    # helper function to infer type for argsparser
+
+    def _infer_type(s):
+        try:
+            s = float(s)
+
+            if s // 1 == s:
+                return int(s)
+            return s
+        except ValueError:
+            return s
+
+    parser = argparse.ArgumentParser()
+    _, unknown = parser.parse_known_args(nargs)
+    for index, argument in enumerate(unknown):
+        if argument.startswith(("-", "--")):
+            action = None
+            if index + 1 < len(unknown):  # checks if next index would be in list
+                if unknown[index + 1].startswith(("-", "--")):  # checks if next element is an key
+                    # raise an error if element is store_true or store_false
+                    raise ValueError(
+                        "SageMaker doesn’t support argparse actions for `store_true` or `store_false`. Please define explicit types"
+                    )
+            else:  # raise an error if last element is store_true or store_false
+                raise ValueError(
+                    "SageMaker doesn’t support argparse actions for `store_true` or `store_false`. Please define explicit types"
+                )
+            # adds argument to parser based on action_store true
+            if action is None:
+                parser.add_argument(argument, type=_infer_type)
+            else:
+                parser.add_argument(argument, action=action)
+
+    return {
+        key: (literal_eval(value) if value == "True" or value == "False" else value)
+        for key, value in parser.parse_args(nargs).__dict__.items()
+    }
+
+
+def sagemaker_launcher(sagemaker_config: SageMakerConfig, args):
+    if not is_sagemaker_available():
+        raise ImportError(
+            "Please install sagemaker to be able to launch training on Amazon SageMaker with `pip install accelerate[sagemaker]`"
+        )
+    from sagemaker.huggingface import HuggingFace
+
+    # configure environment
+    print("Configuring Amazon SageMaker environment")
+    os.environ["AWS_DEFAULT_REGION"] = sagemaker_config.region
+
+    # configure credentials
+    if sagemaker_config.profile is not None:
+        os.environ["AWS_PROFILE"] = sagemaker_config.profile
+    elif args.aws_access_key_id is not None and args.aws_secret_access_key is not None:
+        os.environ["AWS_ACCESS_KEY_ID"] = args.aws_access_key_id
+        os.environ["AWS_SECRET_ACCESS_KEY"] = args.aws_secret_access_key
+    else:
+        raise EnvironmentError(
+            "You need to provide an aws_access_key_id and aws_secret_access_key when not using aws_profile"
+        )
+
+    # extract needed arguments
+    source_dir = os.path.dirname(args.training_script)
+    if not source_dir:  # checks if string is empty
+        source_dir = "."
+    entry_point = os.path.basename(args.training_script)
+    if not entry_point.endswith(".py"):
+        raise ValueError(f'Your training script should be a python script and not "{entry_point}"')
+
+    print("Converting Arguments to Hyperparameters")
+    hyperparameters = _convert_nargs_to_dict(args.training_script_args)
+
+    environment = {"USE_FP16": args.fp16}  # Environment variables to be set for use during training job
+
+    # configure distribution set up
+    distribution = None  # TODO: not yet implemented
+
+    # configure session
+    print("Creating Estimator")
+    huggingface_estimator = HuggingFace(
+        entry_point=entry_point,
+        source_dir=source_dir,
+        role=sagemaker_config.iam_role_name,
+        transformers_version="4.4",
+        pytorch_version="1.6",
+        py_version="py36",
+        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,
     )
 
+    huggingface_estimator.fit()
+    print(f"You can find your model data at: {huggingface_estimator.model_data}")
+
 
 def launch_command(args):
     # Sanity checks
diff --git a/src/accelerate/utils.py b/src/accelerate/utils.py
index 21b635996..68299c790 100644
--- a/src/accelerate/utils.py
+++ b/src/accelerate/utils.py
@@ -31,6 +31,10 @@ def is_boto3_available():
     return importlib.util.find_spec("boto3") is not None
 
 
+def is_sagemaker_available():
+    return importlib.util.find_spec("sagemaker") is not None
+
+
 class RNGType(Enum):
     TORCH = "torch"
     CUDA = "cuda"
diff --git a/tests/test_sagemaker.py b/tests/test_sagemaker.py
new file mode 100644
index 000000000..f2d587a39
--- /dev/null
+++ b/tests/test_sagemaker.py
@@ -0,0 +1,62 @@
+import unittest
+from dataclasses import dataclass
+
+import pytest
+from accelerate.commands.config.config_args import SageMakerConfig
+from accelerate.commands.launch import _convert_nargs_to_dict
+from accelerate.state import ComputeEnvironment
+
+
+@dataclass
+class MockLaunchConfig(SageMakerConfig):
+    compute_environment = ComputeEnvironment.AMAZON_SAGEMAKER
+    fp16 = True
+    ec2_instance_type = "ml.p3.2xlarge"
+    iam_role_name = "accelerate_sagemaker_execution_role"
+    profile = "hf-sm"
+    region = "us-east-1"
+    num_machines = 1
+    base_job_name = "accelerate-sagemaker-1"
+    pytorch_version = "1.6"
+    transformers_version = "4.4"
+    training_script = "train.py"
+    success_training_script_args = [
+        "--model_name_or_path",
+        "bert",
+        "--do_train",
+        "False",
+        "--epochs",
+        "3",
+        "--learning_rate",
+        "5e-5",
+        "--max_steps",
+        "50.5",
+    ]
+    fail_training_script_args = [
+        "--model_name_or_path",
+        "bert",
+        "--do_train",
+        "--do_test",
+        "False",
+        "--do_predict",
+        "--epochs",
+        "3",
+        "--learning_rate",
+        "5e-5",
+        "--max_steps",
+        "50.5",
+    ]
+
+
+class SageMakerLaunch(unittest.TestCase):
+    def test_args_convert(self):
+        # If no defaults are changed, `to_kwargs` returns an empty dict.
+        converted_args = _convert_nargs_to_dict(MockLaunchConfig.success_training_script_args)
+        assert isinstance(converted_args["model_name_or_path"], str)
+        assert isinstance(converted_args["do_train"], bool)
+        assert isinstance(converted_args["epochs"], int)
+        assert isinstance(converted_args["learning_rate"], float)
+        assert isinstance(converted_args["max_steps"], float)
+
+        with pytest.raises(ValueError):
+            _convert_nargs_to_dict(MockLaunchConfig.fail_training_script_args)


Review comments: body: ```suggestion
## Getting Started
```
diff_hunk: @@ -0,0 +1,134 @@
+<!---
+Copyright 2021 The HuggingFace Team. All rights reserved.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+# Amazon SageMaker
+
+Hugging Face and Amazon introduced new [Hugging Face Deep Learning Containers (DLCs)](https://github.com/aws/deep-learning-containers/blob/master/available_images.md#huggingface-training-containers) to make it easier than ever to train Hugging Face Transformer models in [Amazon SageMaker](https://aws.amazon.com/sagemaker/).
+
+To learn how to use the new 🤗 DLCs with the Amazon SageMaker to run your 🤗 Accelerate scripts and raw training loops.0
+
+---
+
+## Getting Started: Train a 🤗 Transformers Model
body: ```suggestion
🤗 Accelerate currently uses the 🤗 DLCs, with `transformers`, `datasets` and `tokenizers` pre-installed. 🤗 Accelerate is not in the DLC yet (swill soon be added!) so to use it within Amazon SageMaker you need to create a `requirements.txt` in the same directory where your training script is located and add it as dependency.
```
diff_hunk: @@ -0,0 +1,134 @@
+<!---
+Copyright 2021 The HuggingFace Team. All rights reserved.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+# Amazon SageMaker
+
+Hugging Face and Amazon introduced new [Hugging Face Deep Learning Containers (DLCs)](https://github.com/aws/deep-learning-containers/blob/master/available_images.md#huggingface-training-containers) to make it easier than ever to train Hugging Face Transformer models in [Amazon SageMaker](https://aws.amazon.com/sagemaker/).
+
+To learn how to use the new 🤗 DLCs with the Amazon SageMaker to run your 🤗 Accelerate scripts and raw training loops.0
+
+---
+
+## Getting Started: Train a 🤗 Transformers Model
+
+### Setup & Installation
+
+Before you can run your 🤗 Accelerate scripts on Amazon SageMaker you need to sign up for an AWS account. If you do not have an AWS account yet learn more [here](https://docs.aws.amazon.com/sagemaker/latest/dg/gs-set-up.html). 
+
+After you have your AWS Account you need to install the `sagemaker` sdk for 🤗 Accelerate with. 
+
+```python
+pip install "accelerate[sagemaker]" --upgrade
+```
+
+🤗 Accelerate currently uses the 🤗 DLCs, with `transformers`, `datasets` and `tokenizers` pre-installed. To be able to use 🤗 Accelerate within Amazon SageMaker you need to create a `requirements.txt` in the same directory where your training script is located and add it as dependency.
body: ```suggestion
You should also add any other dependencies you have to this `requirements.txt`. 
```
diff_hunk: @@ -0,0 +1,134 @@
+<!---
+Copyright 2021 The HuggingFace Team. All rights reserved.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+# Amazon SageMaker
+
+Hugging Face and Amazon introduced new [Hugging Face Deep Learning Containers (DLCs)](https://github.com/aws/deep-learning-containers/blob/master/available_images.md#huggingface-training-containers) to make it easier than ever to train Hugging Face Transformer models in [Amazon SageMaker](https://aws.amazon.com/sagemaker/).
+
+To learn how to use the new 🤗 DLCs with the Amazon SageMaker to run your 🤗 Accelerate scripts and raw training loops.0
+
+---
+
+## Getting Started: Train a 🤗 Transformers Model
+
+### Setup & Installation
+
+Before you can run your 🤗 Accelerate scripts on Amazon SageMaker you need to sign up for an AWS account. If you do not have an AWS account yet learn more [here](https://docs.aws.amazon.com/sagemaker/latest/dg/gs-set-up.html). 
+
+After you have your AWS Account you need to install the `sagemaker` sdk for 🤗 Accelerate with. 
+
+```python
+pip install "accelerate[sagemaker]" --upgrade
+```
+
+🤗 Accelerate currently uses the 🤗 DLCs, with `transformers`, `datasets` and `tokenizers` pre-installed. To be able to use 🤗 Accelerate within Amazon SageMaker you need to create a `requirements.txt` in the same directory where your training script is located and add it as dependency.
+
+```python
+accelerate
+```
+
+You can also add other dependencies to this `requirements.txt`. 
body: What do you mean here? Shouldn't it be in the example?
diff_hunk: @@ -0,0 +1,134 @@
+<!---
+Copyright 2021 The HuggingFace Team. All rights reserved.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+# Amazon SageMaker
+
+Hugging Face and Amazon introduced new [Hugging Face Deep Learning Containers (DLCs)](https://github.com/aws/deep-learning-containers/blob/master/available_images.md#huggingface-training-containers) to make it easier than ever to train Hugging Face Transformer models in [Amazon SageMaker](https://aws.amazon.com/sagemaker/).
+
+To learn how to use the new 🤗 DLCs with the Amazon SageMaker to run your 🤗 Accelerate scripts and raw training loops.0
+
+---
+
+## Getting Started: Train a 🤗 Transformers Model
+
+### Setup & Installation
+
+Before you can run your 🤗 Accelerate scripts on Amazon SageMaker you need to sign up for an AWS account. If you do not have an AWS account yet learn more [here](https://docs.aws.amazon.com/sagemaker/latest/dg/gs-set-up.html). 
+
+After you have your AWS Account you need to install the `sagemaker` sdk for 🤗 Accelerate with. 
+
+```python
+pip install "accelerate[sagemaker]" --upgrade
+```
+
+🤗 Accelerate currently uses the 🤗 DLCs, with `transformers`, `datasets` and `tokenizers` pre-installed. To be able to use 🤗 Accelerate within Amazon SageMaker you need to create a `requirements.txt` in the same directory where your training script is located and add it as dependency.
+
+```python
+accelerate
+```
+
+You can also add other dependencies to this `requirements.txt`. 
+
+
+### Configure 🤗 Accelerate 
+
+You can configure the launch configuration for Amazon SageMaker the same as you do for non SageMaker training jobs with the 🤗 Accelerate CLI. 
+
+```bash
+accelerate config
+# In which compute environment are you running? ([0] This machine, [1] AWS (Amazon SageMaker)): 1
+```
+
+🤗 Accelerate will go through a questionnaire about your Amazon SageMaker setup and create a config file you can edit. 
+
+_**Note**: 🤗 Accelerate is not saving any of your credentials._
+
+
+### Prepare a 🤗 Accelerate fine-tuning script.
+
+The training script is very similar to a training script you might run outside of SageMaker, but to save your model after training you need to specify either `/opt/ml/model` or use `os.environ["SM_MODEL_DIR"]` as your save directory. After training, artifacts in this directory are uploaded to S3.
+
+```diff
+- torch.save()
++ accelerator.save('/opt/ml/model')
+```
+
+### Launch Training
+
+You can launch your training with 🤗 Accelerate CLI with
+
+```bash
+accelerate launch path_to_script.py --args_to_the_script
+```
+
+This will launch your training script using your configuration. The only thing you have to do is provide all the arguments needed by your training script as named arguments.
+
+**Examples**
+
+_**Note**: If you run one of the example scripts, don't for get to add `accelerator.save('/opt/ml/model')`to it._
body: I see you did something for those later on, is it still necessary? We should make sure we support those as they are very common, or if they are not, it should be made clear in the docs.
diff_hunk: @@ -162,8 +162,8 @@ def collate_fn(examples):
 
 def main():
     parser = argparse.ArgumentParser(description="Simple example of training script.")
-    parser.add_argument("--fp16", action="store_true", help="If passed, will use FP16 training.")
-    parser.add_argument("--cpu", action="store_true", help="If passed, will train on the CPU.")
+    parser.add_argument("--fp16", type=bool, default=False, help="If passed, will use FP16 training.")
+    parser.add_argument("--cpu", type=bool, default=False, help="If passed, will train on the CPU.")
body: Should we amke one folder for each example? The CV example would require more.
diff_hunk: @@ -0,0 +1 @@
+accelerate # used to be installed in Amazon SageMaker environment
body: There should be something for `store_false` too.
diff_hunk: @@ -168,11 +184,100 @@ def tpu_launcher(args):
         xmp.spawn(main_function, args=(), nprocs=args.num_processes)
 
 
-def sagemaker_launcher(sagemaker_config, args):
-    raise NotImplementedError(
-        "Support for starting SageMaker training is not yet implemented. But you can create configs for it."
+def _convert_nargs_to_dict(nargs: List[str]) -> Dict[str, str]:
+    if len(nargs) < 0:
+        return {}
+    # helper function to infer type for argsparser
+
+    def _infer_type(s):
+        try:
+            s = float(s)
+
+            if s // 1 == s:
+                return int(s)
+            return s
+        except ValueError:
+            return s
+
+    parser = argparse.ArgumentParser()
+    _, unknown = parser.parse_known_args(nargs)
+    for index, argument in enumerate(unknown):
+        if argument.startswith(("-", "--")):
+            action = None
+            if index + 1 < len(unknown):  # checks if next index would be in list
+                if unknown[index + 1].startswith(("-", "--")):  # checks if next element is an key
+                    action = "store_true"
+            else:  # action_true parameter is last element
+                action = "store_true"
body: The current example doesn't show how to save models at all. So that's why I added it here.
diff_hunk: @@ -0,0 +1,134 @@
+<!---
+Copyright 2021 The HuggingFace Team. All rights reserved.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+
+# Amazon SageMaker
+
+Hugging Face and Amazon introduced new [Hugging Face Deep Learning Containers (DLCs)](https://github.com/aws/deep-learning-containers/blob/master/available_images.md#huggingface-training-containers) to make it easier than ever to train Hugging Face Transformer models in [Amazon SageMaker](https://aws.amazon.com/sagemaker/).
+
+To learn how to use the new 🤗 DLCs with the Amazon SageMaker to run your 🤗 Accelerate scripts and raw training loops.0
+
+---
+
+## Getting Started: Train a 🤗 Transformers Model
+
+### Setup & Installation
+
+Before you can run your 🤗 Accelerate scripts on Amazon SageMaker you need to sign up for an AWS account. If you do not have an AWS account yet learn more [here](https://docs.aws.amazon.com/sagemaker/latest/dg/gs-set-up.html). 
+
+After you have your AWS Account you need to install the `sagemaker` sdk for 🤗 Accelerate with. 
+
+```python
+pip install "accelerate[sagemaker]" --upgrade
+```
+
+🤗 Accelerate currently uses the 🤗 DLCs, with `transformers`, `datasets` and `tokenizers` pre-installed. To be able to use 🤗 Accelerate within Amazon SageMaker you need to create a `requirements.txt` in the same directory where your training script is located and add it as dependency.
+
+```python
+accelerate
+```
+
+You can also add other dependencies to this `requirements.txt`. 
+
+
+### Configure 🤗 Accelerate 
+
+You can configure the launch configuration for Amazon SageMaker the same as you do for non SageMaker training jobs with the 🤗 Accelerate CLI. 
+
+```bash
+accelerate config
+# In which compute environment are you running? ([0] This machine, [1] AWS (Amazon SageMaker)): 1
+```
+
+🤗 Accelerate will go through a questionnaire about your Amazon SageMaker setup and create a config file you can edit. 
+
+_**Note**: 🤗 Accelerate is not saving any of your credentials._
+
+
+### Prepare a 🤗 Accelerate fine-tuning script.
+
+The training script is very similar to a training script you might run outside of SageMaker, but to save your model after training you need to specify either `/opt/ml/model` or use `os.environ["SM_MODEL_DIR"]` as your save directory. After training, artifacts in this directory are uploaded to S3.
+
+```diff
+- torch.save()
++ accelerator.save('/opt/ml/model')
+```
+
+### Launch Training
+
+You can launch your training with 🤗 Accelerate CLI with
+
+```bash
+accelerate launch path_to_script.py --args_to_the_script
+```
+
+This will launch your training script using your configuration. The only thing you have to do is provide all the arguments needed by your training script as named arguments.
+
+**Examples**
+
+_**Note**: If you run one of the example scripts, don't for get to add `accelerator.save('/opt/ml/model')`to it._
body: SageMaker cannot pass `store_true` or `store_false` to a script executed. 

> Note that SageMaker doesn’t support argparse actions. If you want to use, for example, boolean hyperparameters, you need to specify type as bool in your script and provide an explicit True or False value for this hyperparameter when instantiating PyTorch Estimator.

https://sagemaker.readthedocs.io/en/stable/frameworks/pytorch/using_pytorch.html#prepare-a-pytorch-training-script

should we add it to the documentation then? 
diff_hunk: @@ -162,8 +162,8 @@ def collate_fn(examples):
 
 def main():
     parser = argparse.ArgumentParser(description="Simple example of training script.")
-    parser.add_argument("--fp16", action="store_true", help="If passed, will use FP16 training.")
-    parser.add_argument("--cpu", action="store_true", help="If passed, will train on the CPU.")
+    parser.add_argument("--fp16", type=bool, default=False, help="If passed, will use FP16 training.")
+    parser.add_argument("--cpu", type=bool, default=False, help="If passed, will train on the CPU.")
body: for the CV example to work we would only need to add `timm`. `torchvision` should be inside the DLC since it uses the AWS PyTorch DLC as base

diff_hunk: @@ -0,0 +1 @@
+accelerate # used to be installed in Amazon SageMaker environment
body: puh. I that even possible? like how can someone cloud tell the difference between `store_true` and `store_false` without knowing the script... 
diff_hunk: @@ -168,11 +184,100 @@ def tpu_launcher(args):
         xmp.spawn(main_function, args=(), nprocs=args.num_processes)
 
 
-def sagemaker_launcher(sagemaker_config, args):
-    raise NotImplementedError(
-        "Support for starting SageMaker training is not yet implemented. But you can create configs for it."
+def _convert_nargs_to_dict(nargs: List[str]) -> Dict[str, str]:
+    if len(nargs) < 0:
+        return {}
+    # helper function to infer type for argsparser
+
+    def _infer_type(s):
+        try:
+            s = float(s)
+
+            if s // 1 == s:
+                return int(s)
+            return s
+        except ValueError:
+            return s
+
+    parser = argparse.ArgumentParser()
+    _, unknown = parser.parse_known_args(nargs)
+    for index, argument in enumerate(unknown):
+        if argument.startswith(("-", "--")):
+            action = None
+            if index + 1 < len(unknown):  # checks if next index would be in list
+                if unknown[index + 1].startswith(("-", "--")):  # checks if next element is an key
+                    action = "store_true"
+            else:  # action_true parameter is last element
+                action = "store_true"
body: Yes, it should be properly documented.
diff_hunk: @@ -162,8 +162,8 @@ def collate_fn(examples):
 
 def main():
     parser = argparse.ArgumentParser(description="Simple example of training script.")
-    parser.add_argument("--fp16", action="store_true", help="If passed, will use FP16 training.")
-    parser.add_argument("--cpu", action="store_true", help="If passed, will train on the CPU.")
+    parser.add_argument("--fp16", type=bool, default=False, help="If passed, will use FP16 training.")
+    parser.add_argument("--cpu", type=bool, default=False, help="If passed, will train on the CPU.")
body: I have no idea what you're doing it here then. Also I though the script could not have `--store_true`/`--store_false`

On top of the documentation, we should add a nice error message here if the parser has arguments with `--store_true`/`--store_false`.
diff_hunk: @@ -168,11 +184,100 @@ def tpu_launcher(args):
         xmp.spawn(main_function, args=(), nprocs=args.num_processes)
 
 
-def sagemaker_launcher(sagemaker_config, args):
-    raise NotImplementedError(
-        "Support for starting SageMaker training is not yet implemented. But you can create configs for it."
+def _convert_nargs_to_dict(nargs: List[str]) -> Dict[str, str]:
+    if len(nargs) < 0:
+        return {}
+    # helper function to infer type for argsparser
+
+    def _infer_type(s):
+        try:
+            s = float(s)
+
+            if s // 1 == s:
+                return int(s)
+            return s
+        except ValueError:
+            return s
+
+    parser = argparse.ArgumentParser()
+    _, unknown = parser.parse_known_args(nargs)
+    for index, argument in enumerate(unknown):
+        if argument.startswith(("-", "--")):
+            action = None
+            if index + 1 < len(unknown):  # checks if next index would be in list
+                if unknown[index + 1].startswith(("-", "--")):  # checks if next element is an key
+                    action = "store_true"
+            else:  # action_true parameter is last element
+                action = "store_true"
body: I reworked the documentation to use `.rst` to highlight it as a warning. ([see PR comment](https://github.com/huggingface/accelerate/pull/26#issuecomment-818525901))
diff_hunk: @@ -162,8 +162,8 @@ def collate_fn(examples):
 
 def main():
     parser = argparse.ArgumentParser(description="Simple example of training script.")
-    parser.add_argument("--fp16", action="store_true", help="If passed, will use FP16 training.")
-    parser.add_argument("--cpu", action="store_true", help="If passed, will train on the CPU.")
+    parser.add_argument("--fp16", type=bool, default=False, help="If passed, will use FP16 training.")
+    parser.add_argument("--cpu", type=bool, default=False, help="If passed, will train on the CPU.")
body: For SageMaker to work I needed to convert the `args.training_script_args` from `--foo bar --john 2 --store_true --another key` to
 ```python
{
"foo":"bar",
"john": 2,
"store_true": True,
"another": "key"
}
```
To achieve this I built this dynamic args parser, which takes the `args.training_script_args` and creates an `argsparser` out of it to apply afterward on `args.training_script_args` to create this `dict`. 

While creating this I haven't thought of `store_false`, since I never have seen it in real use, that's why I expected that there is only `store_true` and implemented it like that. 

diff_hunk: @@ -168,11 +184,100 @@ def tpu_launcher(args):
         xmp.spawn(main_function, args=(), nprocs=args.num_processes)
 
 
-def sagemaker_launcher(sagemaker_config, args):
-    raise NotImplementedError(
-        "Support for starting SageMaker training is not yet implemented. But you can create configs for it."
+def _convert_nargs_to_dict(nargs: List[str]) -> Dict[str, str]:
+    if len(nargs) < 0:
+        return {}
+    # helper function to infer type for argsparser
+
+    def _infer_type(s):
+        try:
+            s = float(s)
+
+            if s // 1 == s:
+                return int(s)
+            return s
+        except ValueError:
+            return s
+
+    parser = argparse.ArgumentParser()
+    _, unknown = parser.parse_known_args(nargs)
+    for index, argument in enumerate(unknown):
+        if argument.startswith(("-", "--")):
+            action = None
+            if index + 1 < len(unknown):  # checks if next index would be in list
+                if unknown[index + 1].startswith(("-", "--")):  # checks if next element is an key
+                    action = "store_true"
+            else:  # action_true parameter is last element
+                action = "store_true"
body: Should we add `timm` to the `requirements.txt` to make both examples runnable out of the box?
diff_hunk: @@ -0,0 +1 @@
+accelerate # used to be installed in Amazon SageMaker environment
body: As discussed I adjusted the convert script to raise an error if someone uses `store` actions and added a case into the test. 
diff_hunk: @@ -168,11 +184,100 @@ def tpu_launcher(args):
         xmp.spawn(main_function, args=(), nprocs=args.num_processes)
 
 
-def sagemaker_launcher(sagemaker_config, args):
-    raise NotImplementedError(
-        "Support for starting SageMaker training is not yet implemented. But you can create configs for it."
+def _convert_nargs_to_dict(nargs: List[str]) -> Dict[str, str]:
+    if len(nargs) < 0:
+        return {}
+    # helper function to infer type for argsparser
+
+    def _infer_type(s):
+        try:
+            s = float(s)
+
+            if s // 1 == s:
+                return int(s)
+            return s
+        except ValueError:
+            return s
+
+    parser = argparse.ArgumentParser()
+    _, unknown = parser.parse_known_args(nargs)
+    for index, argument in enumerate(unknown):
+        if argument.startswith(("-", "--")):
+            action = None
+            if index + 1 < len(unknown):  # checks if next index would be in list
+                if unknown[index + 1].startswith(("-", "--")):  # checks if next element is an key
+                    action = "store_true"
+            else:  # action_true parameter is last element
+                action = "store_true"
body: ```suggestion
have an AWS account yet learn more `here <https://docs.aws.amazon.com/sagemaker/latest/dg/gs-set-up.html>`__.
```
diff_hunk: @@ -0,0 +1,169 @@
+.. 
+    Copyright 2021 The HuggingFace Team. All rights reserved.
+
+    Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
+    the License. You may obtain a copy of the License at
+
+        http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
+    an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
+    specific language governing permissions and limitations under the License.
+
+Amazon SageMaker
+=======================================================================================================================
+
+Hugging Face and Amazon introduced new `Hugging Face Deep Learning Containers (DLCs)
+<https://github.com/aws/deep-learning-containers/blob/master/available_images.md#huggingface-training-containers>`_ to
+make it easier than ever to train Hugging Face Transformer models in `Amazon SageMaker
+<https://aws.amazon.com/sagemaker/>`_.
+
+To learn how to use the new 🤗 DLCs with the Amazon SageMaker to run your 🤗 Accelerate scripts and raw training loops.0
+
+
+
+Getting Started
+-----------------------------------------------------------------------------------------------------------------------
+
+Setup & Installation
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+
+Before you can run your 🤗 Accelerate scripts on Amazon SageMaker you need to sign up for an AWS account. If you do not
+have an AWS account yet learn more `here <https://docs.aws.amazon.com/sagemaker/latest/dg/gs-set-up.html>`_.
body: ```suggestion
    <https://sagemaker.readthedocs.io/en/stable/frameworks/pytorch/using_pytorch.html#prepare-a-pytorch-training-script>`__.
```
diff_hunk: @@ -0,0 +1,169 @@
+.. 
+    Copyright 2021 The HuggingFace Team. All rights reserved.
+
+    Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
+    the License. You may obtain a copy of the License at
+
+        http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
+    an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
+    specific language governing permissions and limitations under the License.
+
+Amazon SageMaker
+=======================================================================================================================
+
+Hugging Face and Amazon introduced new `Hugging Face Deep Learning Containers (DLCs)
+<https://github.com/aws/deep-learning-containers/blob/master/available_images.md#huggingface-training-containers>`_ to
+make it easier than ever to train Hugging Face Transformer models in `Amazon SageMaker
+<https://aws.amazon.com/sagemaker/>`_.
+
+To learn how to use the new 🤗 DLCs with the Amazon SageMaker to run your 🤗 Accelerate scripts and raw training loops.0
+
+
+
+Getting Started
+-----------------------------------------------------------------------------------------------------------------------
+
+Setup & Installation
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+
+Before you can run your 🤗 Accelerate scripts on Amazon SageMaker you need to sign up for an AWS account. If you do not
+have an AWS account yet learn more `here <https://docs.aws.amazon.com/sagemaker/latest/dg/gs-set-up.html>`_.
+
+After you have your AWS Account you need to install the ``sagemaker`` sdk for 🤗 Accelerate with.
+
+.. code-block:: 
+
+    pip install "accelerate[sagemaker]" --upgrade
+
+
+🤗 Accelerate currently uses the 🤗 DLCs, with ``transformers``, ``datasets`` and ``tokenizers`` pre-installed. 🤗
+Accelerate is not in the DLC yet (swill soon be added!) so to use it within Amazon SageMaker you need to create a
+``requirements.txt`` in the same directory where your training script is located and add it as dependency.
+
+.. code-block:: 
+
+    accelerate
+
+You should also add any other dependencies you have to this ``requirements.txt``.
+
+
+Configure 🤗 Accelerate
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+You can configure the launch configuration for Amazon SageMaker the same as you do for non SageMaker training jobs with
+the 🤗 Accelerate CLI.
+
+.. code-block:: 
+
+    accelerate config
+    # In which compute environment are you running? ([0] This machine, [1] AWS (Amazon SageMaker)): 1
+
+
+🤗 Accelerate will go through a questionnaire about your Amazon SageMaker setup and create a config file you can edit.
+
+.. note::
+    🤗 Accelerate is not saving any of your credentials.
+
+
+Prepare a 🤗 Accelerate fine-tuning script
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+The training script is very similar to a training script you might run outside of SageMaker, but to save your model
+after training you need to specify either ``/opt/ml/model`` or use ``os.environ["SM_MODEL_DIR"]`` as your save
+directory. After training, artifacts in this directory are uploaded to S3.
+
+
+.. code-block:: diff
+
+    - torch.save()
+    + accelerator.save('/opt/ml/model')
+
+
+.. warning::
+    SageMaker doesn’t support argparse actions. If you want to use, for example, boolean hyperparameters, you need to
+    specify type as bool in your script and provide an explicit True or False value for this hyperparameter. `[REF]
+    <https://sagemaker.readthedocs.io/en/stable/frameworks/pytorch/using_pytorch.html#prepare-a-pytorch-training-script>`_
body: fp16 might not be accepted by the script so it should not be added like this. It should be added in the env instead, in the variable `"USE_FP16"` (which is what accelerate will look for).
diff_hunk: @@ -168,11 +184,105 @@ def tpu_launcher(args):
         xmp.spawn(main_function, args=(), nprocs=args.num_processes)
 
 
-def sagemaker_launcher(sagemaker_config, args):
-    raise NotImplementedError(
-        "Support for starting SageMaker training is not yet implemented. But you can create configs for it."
+def _convert_nargs_to_dict(nargs: List[str]) -> Dict[str, str]:
+    if len(nargs) < 0:
+        return {}
+    # helper function to infer type for argsparser
+
+    def _infer_type(s):
+        try:
+            s = float(s)
+
+            if s // 1 == s:
+                return int(s)
+            return s
+        except ValueError:
+            return s
+
+    parser = argparse.ArgumentParser()
+    _, unknown = parser.parse_known_args(nargs)
+    for index, argument in enumerate(unknown):
+        if argument.startswith(("-", "--")):
+            action = None
+            if index + 1 < len(unknown):  # checks if next index would be in list
+                if unknown[index + 1].startswith(("-", "--")):  # checks if next element is an key
+                    # raise an error if element is store_true or store_false
+                    raise ValueError(
+                        "SageMaker doesn’t support argparse actions for `store_true` or `store_false`. Please define explicit types"
+                    )
+            else:  # raise an error if last element is store_true or store_false
+                raise ValueError(
+                    "SageMaker doesn’t support argparse actions for `store_true` or `store_false`. Please define explicit types"
+                )
+            # adds argument to parser based on action_store true
+            if action is None:
+                parser.add_argument(argument, type=_infer_type)
+            else:
+                parser.add_argument(argument, action=action)
+
+    return {
+        key: (literal_eval(value) if value == "True" or value == "False" else value)
+        for key, value in parser.parse_args(nargs).__dict__.items()
+    }
+
+
+def sagemaker_launcher(sagemaker_config: SageMakerConfig, args):
+    if not is_sagemaker_available():
+        raise ImportError(
+            "Please install sagemaker to be able to launch training on Amazon SageMaker with `pip install accelerate[sagemaker]`"
+        )
+    from sagemaker.huggingface import HuggingFace
+
+    # configure environment
+    print("Configuring Amazon SageMaker environment")
+    os.environ["AWS_DEFAULT_REGION"] = sagemaker_config.region
+
+    # configure credentials
+    if sagemaker_config.profile is not None:
+        os.environ["AWS_PROFILE"] = sagemaker_config.profile
+    elif args.aws_access_key_id is not None and args.aws_secret_access_key is not None:
+        os.environ["AWS_ACCESS_KEY_ID"] = args.aws_access_key_id
+        os.environ["AWS_SECRET_ACCESS_KEY"] = args.aws_secret_access_key
+    else:
+        raise EnvironmentError(
+            "You need to provide an aws_access_key_id and aws_secret_access_key when not using aws_profile"
+        )
+
+    # extract needed arguments
+    source_dir = os.path.dirname(args.training_script)
+    if not source_dir:  # checks if string is empty
+        source_dir = "."
+    entry_point = os.path.basename(args.training_script)
+    if not entry_point.endswith(".py"):
+        raise ValueError(f'Your training script should be a python script and not "{entry_point}"')
+
+    print("Converting Arguments to Hyperparameters")
+    converted_hyperparameters = _convert_nargs_to_dict(args.training_script_args)
+    hyperparameters = {"fp16": args.fp16, **converted_hyperparameters}
body: ```suggestion
Accelerate is not in the DLC yet (will soon be added!) so to use it within Amazon SageMaker you need to create a
```
diff_hunk: @@ -0,0 +1,169 @@
+.. 
+    Copyright 2021 The HuggingFace Team. All rights reserved.
+
+    Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
+    the License. You may obtain a copy of the License at
+
+        http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
+    an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
+    specific language governing permissions and limitations under the License.
+
+Amazon SageMaker
+=======================================================================================================================
+
+Hugging Face and Amazon introduced new `Hugging Face Deep Learning Containers (DLCs)
+<https://github.com/aws/deep-learning-containers/blob/master/available_images.md#huggingface-training-containers>`_ to
+make it easier than ever to train Hugging Face Transformer models in `Amazon SageMaker
+<https://aws.amazon.com/sagemaker/>`_.
+
+To learn how to use the new 🤗 DLCs with the Amazon SageMaker to run your 🤗 Accelerate scripts and raw training loops.0
+
+
+
+Getting Started
+-----------------------------------------------------------------------------------------------------------------------
+
+Setup & Installation
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+
+Before you can run your 🤗 Accelerate scripts on Amazon SageMaker you need to sign up for an AWS account. If you do not
+have an AWS account yet learn more `here <https://docs.aws.amazon.com/sagemaker/latest/dg/gs-set-up.html>`__.
+
+After you have your AWS Account you need to install the ``sagemaker`` sdk for 🤗 Accelerate with.
+
+.. code-block:: 
+
+    pip install "accelerate[sagemaker]" --upgrade
+
+
+🤗 Accelerate currently uses the 🤗 DLCs, with ``transformers``, ``datasets`` and ``tokenizers`` pre-installed. 🤗
+Accelerate is not in the DLC yet (swill soon be added!) so to use it within Amazon SageMaker you need to create a
body: I would also add the `/opt/ml/model` here for consistency
```suggestion
    - torch.save('/opt/ml/model`)
```
diff_hunk: @@ -0,0 +1,169 @@
+.. 
+    Copyright 2021 The HuggingFace Team. All rights reserved.
+
+    Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
+    the License. You may obtain a copy of the License at
+
+        http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
+    an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
+    specific language governing permissions and limitations under the License.
+
+Amazon SageMaker
+=======================================================================================================================
+
+Hugging Face and Amazon introduced new `Hugging Face Deep Learning Containers (DLCs)
+<https://github.com/aws/deep-learning-containers/blob/master/available_images.md#huggingface-training-containers>`_ to
+make it easier than ever to train Hugging Face Transformer models in `Amazon SageMaker
+<https://aws.amazon.com/sagemaker/>`_.
+
+To learn how to use the new 🤗 DLCs with the Amazon SageMaker to run your 🤗 Accelerate scripts and raw training loops.0
+
+
+
+Getting Started
+-----------------------------------------------------------------------------------------------------------------------
+
+Setup & Installation
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+
+Before you can run your 🤗 Accelerate scripts on Amazon SageMaker you need to sign up for an AWS account. If you do not
+have an AWS account yet learn more `here <https://docs.aws.amazon.com/sagemaker/latest/dg/gs-set-up.html>`__.
+
+After you have your AWS Account you need to install the ``sagemaker`` sdk for 🤗 Accelerate with.
+
+.. code-block:: 
+
+    pip install "accelerate[sagemaker]" --upgrade
+
+
+🤗 Accelerate currently uses the 🤗 DLCs, with ``transformers``, ``datasets`` and ``tokenizers`` pre-installed. 🤗
+Accelerate is not in the DLC yet (swill soon be added!) so to use it within Amazon SageMaker you need to create a
+``requirements.txt`` in the same directory where your training script is located and add it as dependency.
+
+.. code-block:: 
+
+    accelerate
+
+You should also add any other dependencies you have to this ``requirements.txt``.
+
+
+Configure 🤗 Accelerate
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+You can configure the launch configuration for Amazon SageMaker the same as you do for non SageMaker training jobs with
+the 🤗 Accelerate CLI.
+
+.. code-block:: 
+
+    accelerate config
+    # In which compute environment are you running? ([0] This machine, [1] AWS (Amazon SageMaker)): 1
+
+
+🤗 Accelerate will go through a questionnaire about your Amazon SageMaker setup and create a config file you can edit.
+
+.. note::
+    🤗 Accelerate is not saving any of your credentials.
+
+
+Prepare a 🤗 Accelerate fine-tuning script
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+The training script is very similar to a training script you might run outside of SageMaker, but to save your model
+after training you need to specify either ``/opt/ml/model`` or use ``os.environ["SM_MODEL_DIR"]`` as your save
+directory. After training, artifacts in this directory are uploaded to S3.
+
+
+.. code-block:: diff
+
+    - torch.save()
body: ```suggestion
    If you run one of the example scripts, don't forget to add ``accelerator.save('/opt/ml/model')`` to it.
```
diff_hunk: @@ -0,0 +1,169 @@
+.. 
+    Copyright 2021 The HuggingFace Team. All rights reserved.
+
+    Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
+    the License. You may obtain a copy of the License at
+
+        http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
+    an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
+    specific language governing permissions and limitations under the License.
+
+Amazon SageMaker
+=======================================================================================================================
+
+Hugging Face and Amazon introduced new `Hugging Face Deep Learning Containers (DLCs)
+<https://github.com/aws/deep-learning-containers/blob/master/available_images.md#huggingface-training-containers>`_ to
+make it easier than ever to train Hugging Face Transformer models in `Amazon SageMaker
+<https://aws.amazon.com/sagemaker/>`_.
+
+To learn how to use the new 🤗 DLCs with the Amazon SageMaker to run your 🤗 Accelerate scripts and raw training loops.0
+
+
+
+Getting Started
+-----------------------------------------------------------------------------------------------------------------------
+
+Setup & Installation
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+
+Before you can run your 🤗 Accelerate scripts on Amazon SageMaker you need to sign up for an AWS account. If you do not
+have an AWS account yet learn more `here <https://docs.aws.amazon.com/sagemaker/latest/dg/gs-set-up.html>`__.
+
+After you have your AWS Account you need to install the ``sagemaker`` sdk for 🤗 Accelerate with.
+
+.. code-block:: 
+
+    pip install "accelerate[sagemaker]" --upgrade
+
+
+🤗 Accelerate currently uses the 🤗 DLCs, with ``transformers``, ``datasets`` and ``tokenizers`` pre-installed. 🤗
+Accelerate is not in the DLC yet (swill soon be added!) so to use it within Amazon SageMaker you need to create a
+``requirements.txt`` in the same directory where your training script is located and add it as dependency.
+
+.. code-block:: 
+
+    accelerate
+
+You should also add any other dependencies you have to this ``requirements.txt``.
+
+
+Configure 🤗 Accelerate
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+You can configure the launch configuration for Amazon SageMaker the same as you do for non SageMaker training jobs with
+the 🤗 Accelerate CLI.
+
+.. code-block:: 
+
+    accelerate config
+    # In which compute environment are you running? ([0] This machine, [1] AWS (Amazon SageMaker)): 1
+
+
+🤗 Accelerate will go through a questionnaire about your Amazon SageMaker setup and create a config file you can edit.
+
+.. note::
+    🤗 Accelerate is not saving any of your credentials.
+
+
+Prepare a 🤗 Accelerate fine-tuning script
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+The training script is very similar to a training script you might run outside of SageMaker, but to save your model
+after training you need to specify either ``/opt/ml/model`` or use ``os.environ["SM_MODEL_DIR"]`` as your save
+directory. After training, artifacts in this directory are uploaded to S3.
+
+
+.. code-block:: diff
+
+    - torch.save()
+    + accelerator.save('/opt/ml/model')
+
+
+.. warning::
+    SageMaker doesn’t support argparse actions. If you want to use, for example, boolean hyperparameters, you need to
+    specify type as bool in your script and provide an explicit True or False value for this hyperparameter. `[REF]
+    <https://sagemaker.readthedocs.io/en/stable/frameworks/pytorch/using_pytorch.html#prepare-a-pytorch-training-script>`__.
+
+
+Launch Training
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+You can launch your training with 🤗 Accelerate CLI with
+
+.. code-block:: 
+
+    accelerate launch path_to_script.py --args_to_the_script
+
+
+This will launch your training script using your configuration. The only thing you have to do is provide all the
+arguments needed by your training script as named arguments.
+
+**Examples**
+
+.. note::
+    If you run one of the example scripts, don't for get to add ``accelerator.save('/opt/ml/model')`` to it.

Discussion: body: ![screencapture-127-0-0-1-5500-docs-build-html-sagemaker-html-2021-04-13-09_51_47](https://user-images.githubusercontent.com/32632186/114516657-e68efa00-9c3d-11eb-9706-b5c76d21cbc0.png)