Run training on Amazon SageMaker

Transformers documentation

Run training on Amazon SageMaker

[105,251](https://github.com/huggingface/transformers)

Get started

[🤗 Transformers](/docs/transformers/index) [Quick tour](/docs/transformers/quicktour) [Installation](/docs/transformers/installation)

Tutorials

[Run inference with pipelines](/docs/transformers/pipeline_tutorial) [Write portable code with AutoClass](/docs/transformers/autoclass_tutorial) [Preprocess data](/docs/transformers/preprocessing) [Fine-tune a pretrained model](/docs/transformers/training) [Train with a script](/docs/transformers/run_scripts) [Set up distributed training with 🤗 Accelerate](/docs/transformers/accelerate) [Share your model](/docs/transformers/model_sharing) [Agents](/docs/transformers/transformers_agents)

Task Guides

Natural Language Processing

Audio

Computer Vision

Multimodal

Developer guides

[Use fast tokenizers from 🤗 Tokenizers](/docs/transformers/fast_tokenizers) [Run inference with multilingual models](/docs/transformers/multilingual) [Customize text generation strategy](/docs/transformers/generation_strategies) [Use model-specific APIs](/docs/transformers/create_a_model) [Share a custom model](/docs/transformers/custom_models) [Run training on Amazon SageMaker](/docs/transformers/sagemaker) [Export to ONNX](/docs/transformers/serialization) [Export to TFLite](/docs/transformers/tflite) [Export to TorchScript](/docs/transformers/torchscript) [Benchmarks](/docs/transformers/benchmarks) [Notebooks with examples](/docs/transformers/notebooks) [Community resources](/docs/transformers/community) [Custom Tools and Prompts](/docs/transformers/custom_tools) [Troubleshoot](/docs/transformers/troubleshooting)

Performance and scalability

[Overview](/docs/transformers/performance) [Training on one GPU](/docs/transformers/perf_train_gpu_one) [Training on many GPUs](/docs/transformers/perf_train_gpu_many) [Training on CPU](/docs/transformers/perf_train_cpu) [Training on many CPUs](/docs/transformers/perf_train_cpu_many) [Training on TPUs](/docs/transformers/perf_train_tpu) [Training on TPU with TensorFlow](/docs/transformers/perf_train_tpu_tf) [Training on Specialized Hardware](/docs/transformers/perf_train_special) [Inference on CPU](/docs/transformers/perf_infer_cpu) [Inference on one GPU](/docs/transformers/perf_infer_gpu_one) [Inference on many GPUs](/docs/transformers/perf_infer_gpu_many) [Inference on Specialized Hardware](/docs/transformers/perf_infer_special) [Custom hardware for training](/docs/transformers/perf_hardware) [Instantiating a big model](/docs/transformers/big_models) [Debugging](/docs/transformers/debugging) [Hyperparameter Search using Trainer API](/docs/transformers/hpo_train) [XLA Integration for TensorFlow Models](/docs/transformers/tf_xla)

Contribute

[How to contribute to transformers?](/docs/transformers/contributing) [How to add a model to 🤗 Transformers?](/docs/transformers/add_new_model) [How to convert a 🤗 Transformers model to TensorFlow?](/docs/transformers/add_tensorflow_model) [How to add a pipeline to 🤗 Transformers?](/docs/transformers/add_new_pipeline) [Testing](/docs/transformers/testing) [Checks on a Pull Request](/docs/transformers/pr_checks)

Conceptual guides

[Philosophy](/docs/transformers/philosophy) [Glossary](/docs/transformers/glossary) [What 🤗 Transformers can do](/docs/transformers/task_summary) [How 🤗 Transformers solve tasks](/docs/transformers/tasks_explained) [The Transformer model family](/docs/transformers/model_summary) [Summary of the tokenizers](/docs/transformers/tokenizer_summary) [Attention mechanisms](/docs/transformers/attention) [Padding and truncation](/docs/transformers/pad_truncation) [BERTology](/docs/transformers/bertology) [Perplexity of fixed-length models](/docs/transformers/perplexity) [Pipelines for webserver inference](/docs/transformers/pipeline_webserver)

API

Main Classes

[Agents and Tools](/docs/transformers/main_classes/agent) [Auto Classes](/docs/transformers/model_doc/auto) [Callbacks](/docs/transformers/main_classes/callback) [Configuration](/docs/transformers/main_classes/configuration) [Data Collator](/docs/transformers/main_classes/data_collator) [Keras callbacks](/docs/transformers/main_classes/keras_callbacks) [Logging](/docs/transformers/main_classes/logging) [Models](/docs/transformers/main_classes/model) [Text Generation](/docs/transformers/main_classes/text_generation) [ONNX](/docs/transformers/main_classes/onnx) [Optimization](/docs/transformers/main_classes/optimizer_schedules) [Model outputs](/docs/transformers/main_classes/output) [Pipelines](/docs/transformers/main_classes/pipelines) [Processors](/docs/transformers/main_classes/processors) [Quantization](/docs/transformers/main_classes/quantization) [Tokenizer](/docs/transformers/main_classes/tokenizer) [Trainer](/docs/transformers/main_classes/trainer) [DeepSpeed Integration](/docs/transformers/main_classes/deepspeed) [Feature Extractor](/docs/transformers/main_classes/feature_extractor) [Image Processor](/docs/transformers/main_classes/image_processor)

Models

Text models

Vision models

Audio models

Multimodal models

Reinforcement learning models

Time series models

Graph models

Internal Helpers

[Custom Layers and Utilities](/docs/transformers/internal/modeling_utils) [Utilities for pipelines](/docs/transformers/internal/pipelines_utils) [Utilities for Tokenizers](/docs/transformers/internal/tokenization_utils) [Utilities for Trainer](/docs/transformers/internal/trainer_utils) [Utilities for Generation](/docs/transformers/internal/generation_utils) [Utilities for Image Processors](/docs/transformers/internal/image_processing_utils) [Utilities for Audio processing](/docs/transformers/internal/audio_utils) [General Utilities](/docs/transformers/internal/file_utils) [Utilities for Time Series](/docs/transformers/internal/time_series_utils)

![Hugging Face's logo](/front/assets/huggingface_logo-noborder.svg)

Join the Hugging Face community

and get access to the augmented documentation experience

Collaborate on models, datasets and Spaces

Faster examples with accelerated inference

Switch between documentation themes

to get started

The documentation has been moved to [hf.co/docs/sagemaker](https://huggingface.co/docs/sagemaker). This page will be removed in `transformers` 5.0.

### [](#table-of-content)Table of Content

-   [Train Hugging Face models on Amazon SageMaker with the SageMaker Python SDK](https://huggingface.co/docs/sagemaker/train)
-   [Deploy Hugging Face models to Amazon SageMaker with the SageMaker Python SDK](https://huggingface.co/docs/sagemaker/inference)
-   [Frequently Asked Questions](https://huggingface.co/docs/sagemaker/faq)

[←Share a custom model](/docs/transformers/custom_models) [Export to ONNX→](/docs/transformers/serialization)

[Run training on Amazon SageMaker](#run-training-on-amazon-sagemaker) [Table of Content](#table-of-content)