Main Content

Deep Learning in the Cloud

If you do not have a suitable GPU available for training your deep neural networks, you can speed up your deep learning applications with one or more high-performance GPUs in the cloud. Working in the cloud requires some initial setup, but using cloud resources can significantly reduce training time or allow you to train more networks in the same amount of time.

You can accelerate training using one or more GPUs on a single machine or using a cluster of machines with GPUs. You can train a single network using multiple GPUs, or train multiple networks at once.

After you set up MATLAB® or MATLAB Parallel Server™ in your chosen cloud platform, you can perform deep learning with minimal changes to the code you run on your local machine. For more information about adapting your deep learning code for different parallel environments, see Scale Up Deep Learning in Parallel, on GPUs, and in the Cloud.

Note

If you run MATLAB on a single machine in the cloud and you connect via ssh or remote desktop protocol (RDP), then network execution and training uses the same code as if you were running on your local machine.

Using a GPU or parallel options requires Parallel Computing Toolbox™. Using a GPU also requires a supported GPU device. For information on supported devices, see GPU Computing Requirements (Parallel Computing Toolbox). Using a remote cluster also requires MATLAB Parallel Server.

Access MATLAB in the Cloud

MathWorks® provides several ways of accessing MATLAB in public clouds such as Amazon® Web Services (AWS®) and Azure® that are configurable depending on your needs. To utilize public cloud offerings, you must have an account with your chosen cloud platform.

These cloud offerings make it easy for you to run MATLAB in the cloud by using preconfigured machine templates. You do not have to install MATLAB yourself.

The following tables shows some of the options for accessing MATLAB in the cloud.

Cloud SolutionType of ResourceAdditional InformationLearn More

MathWorks Cloud Center

Single machine or cluster

MathWorks Cloud Center

MATLAB Deep Learning Container

Single machine

  • Run container anywhere, including in the cloud or local hardware.

  • Customize and save container image.

  • Includes commonly used toolboxes for deep learning applications and workflows.

Azure Marketplace

Single machine or cluster

  • Fully customizable.

  • Configure region and network settings.

  • Deploy into existing cloud infrastructure.

Reference architecture templates for AWS and Azure

Single machine or cluster

  • Fully customizable.

  • Configure region and network settings.

  • Deploy into existing cloud infrastructure.

For information on accessing GPU using these cloud solutions, see Run MATLAB using GPUs in the Cloud (Parallel Computing Toolbox).

Work with Big Data in the Cloud

Storing data in the cloud can make it easier for you to access for cloud applications without needing to upload or download large amounts of data each time you create cloud resources. Both AWS and Azure offer data storage services, such as AWS S3 and Azure Blob Storage, respectively.

To avoid the time and cost associated with transferring large quantities of data, it is recommended that you set up cloud resources for your deep learning applications using the same cloud provider and region that you use to store your data in the cloud.

To access data stored in the cloud from MATLAB, you must configure your machine with your access credentials. You can configure access from inside MATLAB using environment variables. For more information on how to set environment variables to access cloud data from your client MATLAB, see Work with Remote Data. For more information on how to set environment variables on parallel workers in a remote cluster, see Set Environment Variables on Workers (Parallel Computing Toolbox).

For examples showing how to upload data to the cloud and how to access that data from MATLAB, see Work with Deep Learning Data in AWS and Work with Deep Learning Data in Azure.

Related Topics