Stay organized with collections
Save and categorize content based on your preferences.
This page explains Vertex AI's PyTorch integration and provides resources
that show you how to use PyTorch on Vertex AI. Vertex AI's PyTorch
integration makes it easier for you to train, deploy, and orchestrate PyTorch
models in production.
Run code in notebooks
Vertex AI provides two options for running your code in
notebooks, Colab Enterprise and Vertex AI Workbench.
To learn more about these options, see
choose a notebook solution.
Prebuilt containers for training
Vertex AI provides prebuilt Docker container images for model training.
These containers are organized by machine learning frameworks and framework
versions and include common dependencies that you might want to use in your
training code. To learn about which PyTorch versions have prebuilt training
containers and how to train models with a prebuilt training container, see
Prebuilt containers for custom training.
Prebuilt containers for serving inferences
Vertex AI provides prebuilt Docker container images for serving both
batch and online inferences.
These containers are organized by machine learning frameworks and framework
versions and include common dependencies that you might want to use in your
inference code. To learn about which PyTorch versions have prebuilt inference
containers and how to serve models with a prebuilt inference container, see
Prebuilt containers for custom training.
Distributed training
You can run distributed training of PyTorch models on Vertex AI. For
multi-worker training, you can use Reduction Server to optimize performance
even further for all-reduce collective operations. To learn more about
distributed training on Vertex AI, see
Distributed training.
Resources for using PyTorch on Vertex AI
To learn more and start using PyTorch in Vertex AI, see the following
resources:
Tutorial: Use Vertex AI to train a PyTorch image
classification model in one of Vertex AI's prebuilt container environments
by using the Google Cloud console.
To follow step-by-step guidance for this task directly in the
Google Cloud console, click Guide me:
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-28 UTC."],[],[],null,["# PyTorch integration\n\n| To see an example of PyTorch integration,\n| run the \"Training, tuning and deploying a PyTorch text sentiment classification model\" notebook in one of the following\n| environments:\n|\n| [Open in Colab](https://colab.research.google.com/github/GoogleCloudPlatform/vertex-ai-samples/blob/main/notebooks/official/training/pytorch-text-sentiment-classification-custom-train-deploy.ipynb)\n|\n|\n| \\|\n|\n| [Open in Colab Enterprise](https://console.cloud.google.com/vertex-ai/colab/import/https%3A%2F%2Fraw.githubusercontent.com%2FGoogleCloudPlatform%2Fvertex-ai-samples%2Fmain%2Fnotebooks%2Fofficial%2Ftraining%2Fpytorch-text-sentiment-classification-custom-train-deploy.ipynb)\n|\n|\n| \\|\n|\n| [Open\n| in Vertex AI Workbench](https://console.cloud.google.com/vertex-ai/workbench/deploy-notebook?download_url=https%3A%2F%2Fraw.githubusercontent.com%2FGoogleCloudPlatform%2Fvertex-ai-samples%2Fmain%2Fnotebooks%2Fofficial%2Ftraining%2Fpytorch-text-sentiment-classification-custom-train-deploy.ipynb)\n|\n|\n| \\|\n|\n[View on GitHub](https://github.com/GoogleCloudPlatform/vertex-ai-samples/blob/main/notebooks/official/training/pytorch-text-sentiment-classification-custom-train-deploy.ipynb) \n\nThis page explains Vertex AI's PyTorch integration and provides resources\nthat show you how to use PyTorch on Vertex AI. Vertex AI's PyTorch\nintegration makes it easier for you to train, deploy, and orchestrate PyTorch\nmodels in production.\n\nRun code in notebooks\n---------------------\n\nVertex AI provides two options for running your code in\nnotebooks, Colab Enterprise and Vertex AI Workbench.\nTo learn more about these options, see\n[choose a notebook solution](/vertex-ai/docs/workbench/notebook-solution).\n\nPrebuilt containers for training\n--------------------------------\n\nVertex AI provides prebuilt Docker container images for model training.\nThese containers are organized by machine learning frameworks and framework\nversions and include common dependencies that you might want to use in your\ntraining code. To learn about which PyTorch versions have prebuilt training\ncontainers and how to train models with a prebuilt training container, see\n[Prebuilt containers for custom training](/vertex-ai/docs/training/pre-built-containers#pytorch).\n\nPrebuilt containers for serving inferences\n------------------------------------------\n\nVertex AI provides prebuilt Docker container images for serving both\nbatch and online inferences.\nThese containers are organized by machine learning frameworks and framework\nversions and include common dependencies that you might want to use in your\ninference code. To learn about which PyTorch versions have prebuilt inference\ncontainers and how to serve models with a prebuilt inference container, see\n[Prebuilt containers for custom training](/vertex-ai/docs/predictions/pre-built-containers).\n\nDistributed training\n--------------------\n\nYou can run distributed training of PyTorch models on Vertex AI. For\nmulti-worker training, you can use Reduction Server to optimize performance\neven further for all-reduce collective operations. To learn more about\ndistributed training on Vertex AI, see\n[Distributed training](/vertex-ai/docs/training/distributed-training).\n\nResources for using PyTorch on Vertex AI\n----------------------------------------\n\nTo learn more and start using PyTorch in Vertex AI, see the following\nresources:\n\n- [How to train and tune PyTorch models on Vertex AI](https://cloud.google.com/blog/topics/developers-practitioners/pytorch-google-cloud-how-train-and-tune-pytorch-models-vertex-ai): Learn how to use [Vertex AI Training](/vertex-ai/docs/training/overview) to build and train a sentiment text classification model using PyTorch and [Vertex AI Hyperparameter Tuning](/vertex-ai/docs/training/using-hyperparameter-tuning) to tune hyperparameters of PyTorch models.\n- [How to deploy PyTorch models on Vertex AI](https://cloud.google.com/blog/topics/developers-practitioners/pytorch-google-cloud-how-deploy-pytorch-models-vertex-ai): Walk through the deployment of a Pytorch model using [TorchServe](https://pytorch.org/serve/) as a custom container, by deploying the model artifacts to a [Vertex AI Inference](/vertex-ai/docs/predictions/overview) service.\n- [Orchestrating PyTorch ML Workflows on Vertex AI Pipelines](https://cloud.google.com/blog/topics/developers-practitioners/orchestrating-pytorch-ml-workflows-vertex-ai-pipelines): See how to build and orchestrate ML pipelines for training and deploying PyTorch models on Google Cloud Vertex AI using [Vertex AI Pipelines](/vertex-ai/docs/pipelines/introduction).\n- [Scalable ML Workflows using PyTorch on Kubeflow Pipelines and Vertex Pipelines](https://cloud.google.com/blog/topics/developers-practitioners/scalable-ml-workflows-using-pytorch-kubeflow-pipelines-and-vertex-pipelines): Take a look at examples of [PyTorch](https://pytorch.org/)-based ML workflows on OSS [Kubeflow Pipelines](https://www.kubeflow.org/docs/components/pipelines/), (part of the Kubeflow project) and [Vertex AI Pipelines](/vertex-ai/docs/pipelines). We share [new PyTorch built-in components](https://github.com/kubeflow/pipelines/tree/master/components/PyTorch/pytorch-kfp-components) added to the Kubeflow Pipelines.\n- [Serving PyTorch image models with prebuilt containers on\n Vertex AI](https://github.com/GoogleCloudPlatform/vertex-ai-samples/blob/main/notebooks/official/prediction/pytorch_image_classification_with_prebuilt_serving_containers.ipynb): This notebook deploys a PyTorch image classification model on Vertex AI using prebuilt PyTorch serving images.\n\nWhat's next\n-----------\n\n- Tutorial: Use Vertex AI to train a PyTorch image classification model in one of Vertex AI's prebuilt container environments by using the Google Cloud console.\n\n *** ** * ** ***\n\n To follow step-by-step guidance for this task directly in the\n Google Cloud console, click **Guide me**:\n\n [Guide me](https://console.cloud.google.com/freetrial?redirectPath=/?walkthrough_id=vertex-pytorch-custom-training)\n\n *** ** * ** ***"]]