Compute Clusters, Serverless and Kubernetes Compute
This lesson explains how compute clusters scale, how dedicated and Spot capacity differ, when serverless compute is used, and what Kubernetes compute requires.
Learning outcomes
After completing this lesson, you will be able to:
- Explain how minimum and maximum instances control cluster cost.
- Distinguish dedicated from Spot capacity.
- Describe when a job runs on serverless compute.
- Identify the responsibilities that come with Kubernetes compute.
How compute clusters scale
A compute cluster (type amlcompute) is a pool of VMs of one size. When jobs are queued, the cluster adds nodes up to max_instances; when nodes have been idle for idle_time_before_scale_down seconds, it removes them down to min_instances. The CLI defaults are a minimum of 0, a maximum of 4 and a scale-down delay of 120 seconds.
$schema: https://azuremlschemas.azureedge.net/latest/amlCompute.schema.json
name: cpu-cluster
type: amlcompute
size: Standard_DS3_v2
min_instances: 0
max_instances: 4
idle_time_before_scale_down: 300
tier: dedicatedA minimum of 0 means no cost when idle, at the price of a few minutes of start-up while the first node is allocated. A higher minimum keeps nodes warm for teams that submit many short jobs. The scale-down delay matters for pipelines: a delay a little longer than the gap between steps lets the next step reuse a node instead of waiting for a new one.
Dedicated and Spot capacity
Cluster nodes use either dedicated VMs, which are not taken away, or Spot capacity, set with the low_priority tier value, which uses spare Azure capacity at a large discount but can be evicted when Azure needs it back. Azure retired the separate low-priority VM offering on 31 March 2026, and existing low-priority configurations now run on Spot VMs.
A job on Spot capacity should write checkpoints to its outputs regularly so that it can resume after an eviction rather than start over. Serverless jobs can choose Spot through queue_settings: job_tier: Spot.
Serverless compute
Serverless compute lets a job run without any compute target to manage. When a command, sweep, automated ML or pipeline job does not name a compute target, Azure Machine Learning provisions suitable compute for it, runs it and releases the compute when it ends. A job can request a size and node count through resources, and a pipeline can use serverless compute for all steps with settings: default_compute: azureml:serverless.
$schema: https://azuremlschemas.azureedge.net/latest/commandJob.schema.json
command: python train.py --data ${{inputs.data}}
code: ./src
environment: azureml://registries/azureml/environments/sklearn-1.5/labels/latest
inputs:
data:
type: uri_file
path: azureml:churn-data:2
resources:
instance_type: Standard_E4s_v3
instance_count: 1Serverless jobs run with the user's identity or a user-assigned managed identity of the workspace, which must have access to the data; system-assigned identities are not supported for serverless compute. Serverless compute suits teams that run jobs occasionally or want the least administration; clusters remain useful when a team needs a fixed network configuration, a dedicated identity per cluster or warm nodes.
Kubernetes compute
An organization that already runs Azure Kubernetes Service clusters, or Azure Arc-enabled Kubernetes clusters on-premises or in other clouds, can attach them to a workspace as Kubernetes compute. The Azure Machine Learning extension is installed on the cluster, a namespace and instance types are defined, and the cluster can then run training jobs and Kubernetes online endpoints.
Kubernetes compute gives control and reuse of existing capacity, but the team is responsible for the cluster's upgrades, scaling, security and monitoring. Some features of managed endpoints, such as mirrored traffic, are not supported on Kubernetes online endpoints. Where there is no reason to operate a cluster, managed compute is the simpler choice.
Cheaper training that still finishes
A team trains a computer vision model every week on a GPU cluster of four dedicated NC-series nodes. Training takes six hours and has no deadline beyond the end of the week. Finance asks for a large cost reduction. Last month, a test on Spot capacity lost three hours of progress when nodes were evicted.
Switch the cluster to the low_priority tier, which uses Spot capacity at a deep discount, and change the training script to save checkpoints to the job's output every epoch and resume from the latest checkpoint at start. Evictions then cost only the work since the last checkpoint, and the weekly deadline leaves plenty of time for retries. Keep the minimum node count at 0.
Staying on dedicated nodes but reducing their number would cut cost less and lengthen training. Raising the minimum node count to keep nodes allocated would increase cost. Moving training to a compute instance would remove parallelism across nodes and still bill a dedicated VM.
A command job YAML has no compute property. Where does the job run?
Show answer
On serverless compute. Azure Machine Learning provisions and releases the compute for the job, so no cluster needs to be created or managed.
Exam Tips
Remember for the exam
- Clusters scale between min_instances and max_instances; a minimum of 0 costs nothing idle.
- Spot capacity (low_priority tier) is cheap but evictable; checkpoint long jobs.
- Omitting compute runs a job on serverless compute.
- Kubernetes compute reuses existing clusters, but you operate them.