Lesson 1 of 3 Compute Targets for Machine Learning

Understanding Compute Targets

This lesson explains which compute target suits each stage of the life cycle, how VM families and sizes differ, and how quotas limit what can be created.

Learning outcomes

After completing this lesson, you will be able to:

  • Choose a compute target for development, training and inference.
  • Distinguish NC and ND GPU families and InfiniBand sizes.
  • Explain how VM family quotas cause OutOfQuota errors.
  • Describe the quota headroom endpoints need.

Compute in the life cycle

Different stages of the machine learning life cycle need different compute. Interactive exploration needs one machine that a person can work on for hours. Training needs many machines for a short time, then none. Real-time inference needs machines that are always available and scale with requests. Azure Machine Learning offers a compute type for each of these patterns.

Compute typePurposeBilling pattern
Compute instanceDevelopment: notebooks, VS Code, testing scriptsWhile running; stop it when idle
Compute clusterTraining jobs, pipelines and batch scoringPer node while nodes exist; can scale to zero
Serverless computeJobs without managing a clusterPer job for the compute it uses
Kubernetes computeTraining and inference on your own AKS or Arc-enabled clusterThe cluster you operate
Managed online endpoint computeReal-time inferencePer instance while the deployment exists

VM sizes and families

Every compute target uses Azure VM sizes. CPU sizes such as the D and E series suit data preparation, classical algorithms and small models; memory-optimized E sizes suit large in-memory datasets. GPU sizes in the NC, ND and NV families suit deep learning: NC sizes for single-node training and inference, ND sizes for large-scale multi-GPU training with high-bandwidth interconnects, and NV sizes for visualization workloads.

Sizes with an r in their name, such as Standard_NC24rs_v3, support InfiniBand networking between nodes, which matters for multi-node distributed training because gradient synchronization between nodes is otherwise slow. Choosing the smallest size that meets the memory and time needs is the main lever on training cost.

Quotas

Azure limits how many cores of each VM family a subscription can use in a region. Azure Machine Learning applies these quotas per VM family across compute instances, clusters and managed online endpoints, and a request for more nodes than the quota allows fails or waits. GPU quota in particular is often zero by default and must be requested.

Managed online endpoints reserve extra quota for upgrades: a deployment needs roughly 20 percent more cores than its instance count implies, calculated as ceil(1.2 x instances) x cores per VM. An OutOfQuota error during deployment usually means this calculation exceeds the remaining quota, and the fix is a quota increase, a smaller size or fewer instances.

Queued jobs and quota

When a job sits in the Queued state for a long time on a cluster that has not reached its maximum node count, check the regional quota for the VM family before suspecting the job itself.

Choosing a compute target

A few questions decide the target in most scenarios. Is the work interactive? Then a compute instance. Is it a batch of jobs that should cost nothing between runs? Then a cluster with a minimum of zero nodes, or serverless compute if the team does not want to manage clusters at all. Must the work run on infrastructure the company already operates, for example for data residency or because GPUs are already owned? Then attached Kubernetes compute.

Compute cluster
ManagementYou define size, scale limits and identity
Scale to zeroYes, with minimum 0
Best forRepeated jobs with known needs
Choose when You want control of size, network and identity
Serverless compute
ManagementAzure Machine Learning chooses and manages
Scale to zeroAlways, by design
Best forOccasional jobs, minimal administration
Choose when You want the least compute administration
Kubernetes compute
ManagementYou operate the cluster and extension
Scale to zeroDepends on your cluster
Best forExisting clusters, on-premises or other clouds
Choose when You must use clusters you already run
Worked example

Matching compute to work

A team needs compute for three activities: two data scientists exploring data in notebooks during working hours, a nightly retraining pipeline that runs for 40 minutes on four CPU nodes, and a real-time scoring API that must answer within 100 milliseconds at all times. The team wants to minimize cost without losing these capabilities.

Each activity has its own compute. The data scientists each get a compute instance with idle shutdown and a schedule that stops it in the evening. The nightly pipeline runs on a compute cluster with a minimum of 0 and a maximum of 4 nodes, or on serverless compute, so nothing is billed outside the 40 minutes. The scoring API runs on a managed online endpoint deployment with enough instances for availability and autoscale for load.

Running the pipeline on the compute instances would save a resource but compete with interactive work and depend on the instances being on. Keeping a cluster at a minimum of four nodes would make the nightly run start faster but bill all day. Serving the API from a compute cluster is not possible, because clusters run jobs, not real-time endpoints.

Check yourself

Creating a GPU cluster succeeds, but jobs fail to scale out with an OutOfQuota error. What should be checked?

Show answer

The subscription's quota for that VM family in the region. Quota is assigned per VM family in vCPUs, and creating a cluster does not reserve it, so the job fails when nodes are requested.

Exam Tips

Remember for the exam

  • Compute instances for development, clusters or serverless for jobs, endpoints for real-time inference.
  • GPU families: NC for single-node work, ND for large multi-GPU training.
  • Sizes with r in the name support InfiniBand for multi-node training.
  • OutOfQuota errors mean the VM family quota is too small; endpoints need about 20 percent extra.