---
title: Migrate classic GPU workloads to AI Runtime
description: "Migrate deep learning workloads from classic compute to AI Runtime serverless GPUs: replace TorchDistributor, update data loading, and move checkpoints."
canonical_url: https://docs.databricks.com/aws/en/machine-learning/ai-runtime/guides/migrate-classic-workloads
---

# Migrate classic GPU workloads to AI Runtime

If you are moving an existing deep learning workload from a classic Databricks cluster (with Databricks Runtime ML) to serverless (with AI Runtime), follow these steps. To learn why Databricks recommends AI Runtime for these workloads, see [Why use AI Runtime instead of classic compute](https://docs.databricks.com/aws/en/machine-learning/ai-runtime/guides/why-ai-runtime.md).

1. **Replace cluster-dependent code.** Remove any references to Spark-based distributed training (for example, `TorchDistributor`) and replace them with the [`@distributed`](https://docs.databricks.com/aws/en/machine-learning/ai-runtime/connecting/distributed-training.md) decorator from the [Databricks AI Runtime SDK](https://api-docs.databricks.com/python/databricks-sdk-air/index.html) (`databricks.air`).
2. **Update data loading.** Replace direct DBFS paths with Unity Catalog volumes paths (`/Volumes/...`). Replace local Spark DataFrame operations with Spark Connect. For streaming file-based data from volumes, use `UCVolumeDataset` from `databricks.air.data`. See [Load data on AI Runtime](https://docs.databricks.com/aws/en/machine-learning/ai-runtime/develop-workloads/dataloading.md).
3. **Set up your environment.** Some Databricks Runtime ML pre-installed libraries aren't available on AI Runtime. Set up a serverless GPU environment and install the packages your workload needs with `%pip install`. See [Set up your AI Runtime environment](https://docs.databricks.com/aws/en/machine-learning/ai-runtime/develop-workloads/environment.md).
4. **Update checkpoint paths.** Move checkpoints from DBFS or local storage to Unity Catalog volumes (`/Volumes/<catalog>/<schema>/<volume>/...`). For distributed checkpointing, use `UCVolumeWriter` and `UCVolumeReader` from `databricks.air.data`, which stage I/O through local NVMe. See [Checkpoint with Distributed Checkpoint (DCP)](https://docs.databricks.com/aws/en/machine-learning/ai-runtime/guides/performance-and-resiliency.md#uc-checkpoints).
5. **Review your MLflow configuration.** On AI Runtime, the `.distributed()` API creates MLflow runs automatically. To customize the experiment, set it with an absolute path. To resume interrupted runs, set a run name. See [What MLflow provides](https://docs.databricks.com/aws/en/machine-learning/ai-runtime/monitor-deploy/tracking-observability.md#mlflow-integration).
6. **Test interactively first.** Validate your workload in an interactive notebook before scheduling it as a job.

This migration path applies to workloads that fit on one of the [supported single-node AI Runtime accelerators](https://docs.databricks.com/aws/en/machine-learning/ai-runtime/overview.md#hardware-options).

> [!TIP]
>
> Tell [Genie Code](https://docs.databricks.com/aws/en/genie-code/index.md) to do this for you:
>
> ```text
> Migrate this Databricks Runtime ML GPU notebook to AI Runtime.
> ```
