##
+base_job_name: accelerate-sagemaker-1 +compute_environment: AMAZON_SAGEMAKER distributed_type: 'NO' dynamo_backend: 'NO' +ec2_instance_type: ml.p3.2xlarge +gpu_ids: all +iam_role_name: MY_IAM_ROLE_NAME mixed_precision: 'no' +num_machines: 1 +profile: MY_PROFILE_NAME +py_version: py38 +pytorch_version: 1.10.2 +region: us-east-1 +transformers_version: 4.17.0 use_cpu: false##
def parse_args(): parser = argparse.ArgumentParse( description="sample task" ) parser.add_argument( "--some_bool_arg", - action="store_true", + type=bool, + default=False, )## If the YAML was generated through the `accelerate config` command: ``` accelerate launch {script_name.py} {--arg1} {--arg2} ... ``` If the YAML is saved to a `~/config.yaml` file: ``` accelerate launch --config_file ~/config.yaml {script_name.py} {--arg1} {--arg2} ... ``` ## SageMaker does not support argparse actions. As a result if a script parameter would normally be a boolean, you need to specify the type as `bool` in the script and provide an explicit `True` or `False` value. Also, when using SageMaker all output artifacts should use `/opt/ml/model` or `os.environ["SM_MODEL_DIR"]` as your save directory. After training, artifacts in this directory are uploaded to S3. ## To learn more checkout the related documentation: - How to use 🤗 Accelerate with SageMaker - Examples showcasing AWS SageMaker integration of 🤗 Accelerate - The Command Line