CertSafari
    Databricks Certified Machine Learning Associate· Lessons

    Domain 1 · Lesson 2/48

    Databricks Runtime for Machine Learning: libraries, GPUs and access mode

    Identify the advantages of using ML runtimes

    17 min read
    2.11% of exam
    10 sources
    Published 22 Oct 2026
    Docs as of 17 Oct 2026

    What you will be able to do

    • Explain what Databricks Runtime ML pre-installs and why that beats installing ML libraries at cluster start
    • Describe how top-tier libraries are updated and how a pre-installed library gets deprecated and removed
    • Configure GPU compute on the ML runtime and say what the GPU variant installs for you
    • Predict which workloads Photon and Graviton speed up, and which they do not
    • State the access mode the ML runtime needs for Unity Catalog and when AI Runtime is the better choice for GPU work

    Key concept

    Databricks Runtime for Machine Learning — A classic-compute runtime that comes with the common ML and deep learning libraries already installed and tested together, so a cluster is ready for training the moment it starts. You turn it on with the Machine learning checkbox when creating compute.

    1.A cluster that starts with the ML stack installed

    Databricks Runtime for Machine Learning (Databricks Runtime ML) is a version of the Databricks Runtime built for model training. When you create compute with it, you get ML and deep learning infrastructure already in place. That includes the libraries most teams install by hand: scikit-learn, XGBoost, PyTorch, TensorFlow and MLflow. The runtime does not just install these packages. They are tested together, so the versions on a given release are known to work alongside each other.

    Here is the problem it solves. A team on the general-purpose runtime runs a setup step every time a cluster starts, pip install-ing scikit-learn, XGBoost and MLflow before any notebook can run. Every project repeats that step, and every cluster waits for it. Making the install faster or moving it somewhere else still leaves the team maintaining it. Choosing the ML runtime when the cluster is created removes the step completely, and every project starts from the same library set.

    Install scripts also cause problems of their own. Init scripts can bring in library conflicts that break workloads, and installing libraries at the compute level makes environments drift apart across jobs. The runtime's own library set is versioned with the runtime, so two clusters on the same ML release have the same libraries. One caveat: the ML runtime installs a large set of libraries, and these can conflict with your own dependencies. Pick it when your work actually needs the ML stack.

    You can still add libraries. The pre-installed set is a starting point, not a limit. Pick the scope based on who needs the library:

    Ways to add a library on top of the ML runtime
    MechanismWho sees the libraryWhen it is installed
    Compute-scoped libraryAll notebooks running on that compute resourceAttached to the compute resource
    Init scriptThe whole compute resourceDuring compute creation
    Notebook-scoped Python library (%pip install)Only the current notebook sessionWhen the notebook runs it

    Checkpoint 1 of 9· Check yourself

    A data science team uses the general-purpose Databricks Runtime. Each time a cluster starts, a setup step runs pip install for scikit-learn, XGBoost and MLflow, and notebooks wait until it finishes. Every project repeats this step. What removes the step?

    Checkpoint 2 of 9· Exam question

    A data science team currently spins up a general-purpose Databricks Runtime cluster and then runs a setup script on every cluster start to install scikit-learn, XGBoost, and MLflow before any notebook can execute. The team wants to remove this manual step and standardize the environment for every new project. Which change addresses this directly?

    Sources1234

    2.Top-tier libraries and the maintenance policy

    Libraries in the ML runtime are updated with each release, but not all of them get the same treatment. Databricks marks a subset as top-tier libraries. These are updated to the latest package release with every runtime release, unless that would cause a dependency conflict. They also get advanced support, testing and built-in optimizations. The current top-tier list is datasets, GraphFrames, MLflow, PyTorch, scikit-learn, streaming, TensorBoard and transformers. Libraries are added to or removed from this list only in major releases. The list does change: starting with Databricks Runtime 18.0 ML, TensorFlow and spark-tensorflow-connector are no longer top-tier.

    A pre-installed library is not guaranteed forever. Databricks removes one when it is no longer actively maintained or when no stable release works on the new runtime. "Not actively maintained" has specific triggers: no new commits in three months together with no new release in more than nine months, an archived repository, or an announced end of maintenance. Hyperopt is a real example. It is not included in Databricks Runtime ML after 16.4 LTS ML, and code that relied on it had to move to something else.

    A removal is announced before it happens, in three places:

    • a deprecation warning in the runtime release notes, saying the library leaves in the next major ML release
    • a notification when you import the library
    • updated Databricks documentation marking the library as planned for removal

    If you see that import-time notification, you have three options. You can install the library yourself, stay on an earlier ML runtime, or move to a supported replacement. Staying on an old runtime is a short-term fix. The lasting answer is the replacement the current runtime supports.

    Distributed deep learning shows how this plays out. Databricks recommends training neural networks on a single machine when possible. When the model or data won't fit in one machine's memory, Databricks Runtime ML includes TorchDistributor, the DeepSpeed distributor and Ray. TorchDistributor is an open-source PySpark module that runs PyTorch training as Spark jobs across the cluster's workers. It is available on Databricks Runtime ML 13.0 and above, and it comes pre-installed on the ML runtime.

    Launching a PyTorch training function with TorchDistributor on the ML runtimepython
    from pyspark.ml.torch.distributor import TorchDistributor
    
    def train_fn(learning_rate):
            # ...
    
    num_processes=2
    distributor = TorchDistributor(num_processes=num_processes, local_mode=True)
    
    distributor.run(train_fn, 1e-3)

    Checkpoint 3 of 9· Check yourself

    Your team's training code depends on PyTorch and scikit-learn in Databricks Runtime ML. Both are top-tier libraries. What does that status mean when a new ML runtime release ships?

    Checkpoint 4 of 9· Exam question

    A team is migrating a PyTorch model training job that currently uses HorovodRunner to distribute training across multiple GPU workers on a Databricks Runtime for Machine Learning cluster. They want a supported path that does not depend on a library Databricks is phasing out of the ML runtime. Which approach should they take?

    Sources5678

    3.GPU variants of the ML runtime

    GPU compute uses the ML runtime too, and the runtime handles the hardest part of the setup: matching drivers to libraries. To create GPU compute, check the Machine learning checkbox and choose a GPU instance type as the worker type. You do not pick a separate GPU runtime by hand. The GPU ML version is selected automatically from the worker type. Through the Clusters API, you either set "use_ml_runtime": true with kind = CLASSIC_PREVIEW, or set spark_version to a GPU-enabled version such as 15.4.x-gpu-ml-scala2.12.

    On GPU instances, Databricks installs the NVIDIA driver and GPU libraries on the Spark driver and on every worker:

    • the CUDA Toolkit, under /usr/local/cuda
    • cuDNN, the NVIDIA CUDA Deep Neural Network library
    • NCCL, the NVIDIA Collective Communications Library used for communication between GPUs

    Library versions are tied to the release. Each Databricks Runtime ML version lists its own library versions in its release notes. So for a fine-tuning job, choose a GPU-enabled ML runtime release. It comes with drivers matched to that release and GPU builds of PyTorch and TensorFlow. Compiling frameworks from source on a standard runtime is the slow path, and Unity Catalog does not add GPU libraries to a cluster. Unity Catalog handles data governance, not drivers.

    The standard runtime does have one GPU use: custom Docker images. To build your own GPU image with Databricks Container Services, you must select a standard runtime version, not Databricks Runtime ML for GPU. Those images are based on the official CUDA containers, and you cannot change their NVIDIA driver version because it has to match the host.

    Checkpoint 5 of 9· Check yourself

    An engineer sets up classic compute for a PyTorch fine-tuning job on GPU instances. Which of these settings will cause a problem?

    Checkpoint 6 of 9· Exam question

    A machine learning engineer is configuring a cluster to fine-tune a deep learning model and needs the cluster to use GPU-accelerated instance types with the correct NVIDIA CUDA drivers and GPU-enabled builds of TensorFlow and PyTorch already in place. What should the engineer do when creating the cluster?

    Sources9

    4.What Photon and Graviton actually speed up

    On CPU compute running Databricks Runtime 15.2 ML or above, you can enable Photon. Photon accelerates work that runs on the JVM side of Spark: Spark SQL, Spark DataFrames, feature engineering, GraphFrames and xgboost4j. Code in non-JVM languages such as Python is not expected to improve, and neither are Spark RDDs or Pandas UDFs. An ML workload is usually a mix of Spark data preparation and Python model training, and only the first part gets faster.

    The exception in that list is xgboost4j, the JVM build of XGBoost. Photon helps it, while the Python XGBoost package gets no benefit. Photon also has limited compatibility with Spark RDD APIs and Spark MLlib, and processing large datasets through either can cause Spark memory issues. Photon gives the biggest gains on SQL and DataFrame work with heavy transformations such as joins, aggregations and large table scans.

    Graviton is a different kind of option. It is an AWS instance family, not an engine, and Databricks Runtime 15.4 LTS ML and above support it. It covers more of the ML stack than Photon does. It can speed up the Python gradient-boosting libraries that Photon cannot help, and it may also give better price-to-performance than other EC2 instance types.

    Photon versus Graviton on Databricks Runtime ML
    AspectPhotonGraviton
    What it isAcceleration you enable on the computeAWS instance type
    Minimum ML runtime15.2 ML15.4 LTS ML
    Speeds upSpark SQL, Spark DataFrames, feature engineering, GraphFrames, xgboost4jSpark, Photon, feature engineering, XGBoost, LightGBM, Spark MLlib gradient boosting
    Caveat or extra benefitNo gain for Spark RDDs, Pandas UDFs, Python XGBoost, PyTorch, TensorFlow; limited compatibility with Spark MLlibMay give better price-to-performance than other AWS EC2 instance types

    Checkpoint 7 of 9· Check yourself

    On CPU compute, the slow part of a pipeline is model training with the Python XGBoost and LightGBM packages. Feature preparation is already fast. Which change is most likely to speed up the training?

    Sources14

    5.Dedicated access mode, and AI Runtime for GPU work

    To read Unity Catalog data from Databricks Runtime ML, the compute must use Dedicated access mode. A Dedicated compute resource is assigned to a single user or to a group. You rarely set this by hand. Checking the Machine learning checkbox switches the access mode to Dedicated and assigns you as the dedicated user. Under Advanced, you can reassign the compute to another user or to a group. When a group owns it, each member's permissions are reduced to the group's permissions, so members can share the cluster safely.

    The runtime version matters here too. On dedicated access mode, two features need Databricks Runtime 15.4 LTS ML or above: fine-grained access control, and querying tables created by Lakeflow pipelines, including streaming tables and materialized views. A cluster on an older ML release can reach Unity Catalog but cannot read a materialized view.

    For GPU work there is now a second option. AI Runtime is serverless GPU compute built for custom deep learning, such as fine-tuning LLMs or training computer vision models. It is in Public Preview. For custom fine-tuning or training on GPUs, Databricks recommends AI Runtime over Databricks Runtime ML. There is no cluster configuration, driver selection or autoscaling policy to manage, provisioning is faster, and you can start from a Standard environment or an AI environment that comes with packages such as Transformers and Ray.

    Choosing between the two ML compute offerings
    AspectDatabricks Runtime MLAI Runtime
    Compute modelClassic compute you configureServerless GPU, no cluster infrastructure to manage
    WorkloadsClassic ML and deep learning, on CPU or GPUCustom single-node and multi-node deep learning
    Hardware optionsCPU and GPU instance types, including AWS GravitonA10 GPUs and H100 GPUs
    LibrariesPre-installed libraries such as PyTorch, TensorFlow and XGBoostDefault base environment, or AI environment with packages like Transformers and Ray

    Databricks Runtime ML is still the right choice for CPU-based classic ML, for Spark-integrated pipelines, and when you need the full pre-installed library set on a cluster you control. AI Runtime is the better choice for a GPU deep learning job that you want running quickly without managing drivers or clusters. On AI Runtime, only the 8xH100 and 8xB300 accelerators support multi-GPU distributed training. The 1xA10 and 1xH100 options are single-GPU.

    Checkpoint 8 of 9· Check yourself

    A cluster runs Databricks Runtime 14.3 ML in Dedicated access mode. It reads ordinary Unity Catalog tables without trouble, but a query on a materialized view created by a Lakeflow pipeline fails. What fixes this?

    Checkpoint 9 of 9· Check yourself

    Which compute does Databricks recommend for fine-tuning a custom LLM on GPUs when the team wants the job running quickly without managing drivers or clusters?

    Sources110

    Sources

    (10)

    Every claim above is drawn from one of these pages, quoted as it was written on the date shown.

    1. 1.
      “automates the creation of a compute resource with pre-built machine learning and deep learning infrastructure including the most common ML and DL libraries”
      ↩︎ A cluster that starts with the ML stack installed
      “To install a library that is available only to a specific notebook session, use Notebook-scoped Python libraries.”
      ↩︎ A cluster that starts with the ML stack installed
      “Photon improves performance for applications using Spark SQL, Spark DataFrames, feature engineering, GraphFrames, and xgboost4j.”
      ↩︎ What Photon and Graviton actually speed up
      “It is not expected to improve performance on applications using Spark RDDs, Pandas UDFs, and non-JVM languages such as Python.”
      ↩︎ What Photon and Graviton actually speed up
      “Graviton instances may also provide better price-to-performance value than other AWS EC2 instance types.”
      ↩︎ What Photon and Graviton actually speed up
      “To access data in Unity Catalog on a compute resource running Databricks Runtime ML, you must set the access mode to Dedicated.”
      ↩︎ Dedicated access mode, and AI Runtime for GPU work
      “When a compute resource has Dedicated access mode, the resource can be assigned to a single user or a group.”
      ↩︎ Dedicated access mode, and AI Runtime for GPU work
      “This automatically sets the access mode to Dedicated with your account as the dedicated user.”
      ↩︎ Dedicated access mode, and AI Runtime for GPU work
      “When using dedicated access mode, the following features are only available on Databricks Runtime 15.4 LTS ML and above:”
      ↩︎ Dedicated access mode, and AI Runtime for GPU work
      “Databricks recommends using AI Runtime instead of Databricks Runtime ML”
      ↩︎ Dedicated access mode, and AI Runtime for GPU work
      “Python packages such as XGBoost, PyTorch, and TensorFlow will not see an improvement with Photon.”
      ↩︎ Exam trap 1
      “To access data in Unity Catalog on a compute resource running Databricks Runtime ML, you must set the access mode to Dedicated.”
      ↩︎ Exam trap 4
      “Python packages such as XGBoost, PyTorch, and TensorFlow will not see an improvement with Photon.”
      ↩︎ Prediction
      “Using Graviton instance types can improve performance for Spark, Photon, feature engineering, machine learning libraries such as XGBoost and LightGBM”
      ↩︎ Checkpoint
      “Databricks recommends using AI Runtime instead of Databricks Runtime ML.”
      ↩︎ Checkpoint
    2. 2.
      “pre-configured cluster environments with major ML libraries pre-installed and tested together”
      ↩︎ A cluster that starts with the ML stack installed
      “pre-configured cluster environments with major ML libraries pre-installed and tested together”
      ↩︎ Key concept
    3. 3.
      “Includes popular libraries like PyTorch, TensorFlow, and XGBoost, which receive frequent updates and optimized support.”
      ↩︎ A cluster that starts with the ML stack installed
    4. 4.
      “Init scripts can introduce unexpected behaviors, including library conflicts that break workloads and make environments less predictable.”
      ↩︎ A cluster that starts with the ML stack installed
      “Installing libraries at the compute level creates environment drift across jobs.”
      ↩︎ A cluster that starts with the ML stack installed
      “Databricks Runtime for ML installs a large set of libraries that can conflict with your own dependencies if not needed”
      ↩︎ A cluster that starts with the ML stack installed
      “it is most beneficial for SQL workloads and DataFrame operations involving complex transformations, such as joins, aggregations, and data scans on large tables”
      ↩︎ What Photon and Graviton actually speed up
    5. 5.
      “Top-tier libraries are added or removed only with major releases.”
      ↩︎ Top-tier libraries and the maintenance policy
      “Starting with Databricks Runtime 18.0 ML, TensorFlow and spark-tensorflow-connector are no longer top-tier libraries.”
      ↩︎ Top-tier libraries and the maintenance policy
      “No new commits in three months and no new releases in more than nine months.”
      ↩︎ Top-tier libraries and the maintenance policy
      “A notification is displayed when importing the library, indicating that the library will be removed in the next major Databricks Runtime ML release.”
      ↩︎ Top-tier libraries and the maintenance policy
      “you can either install the library manually or use an earlier version of Databricks Runtime ML”
      ↩︎ Top-tier libraries and the maintenance policy
      “updating to the latest package releases with each runtime release (barring dependency conflicts)”
      ↩︎ Checkpoint
    6. 6.
      “Hyperopt is not included in Databricks Runtime for Machine Learning after 16.4 LTS ML.”
      ↩︎ Top-tier libraries and the maintenance policy
      “Hyperopt is not included in Databricks Runtime for Machine Learning after 16.4 LTS ML.”
      ↩︎ Exam trap 3
    7. 7.
      “For these workloads, Databricks Runtime ML includes the TorchDistributor, DeepSpeed distributor and Ray packages.”
      ↩︎ Top-tier libraries and the maintenance policy
      “so it lets you launch PyTorch training jobs as Spark jobs”
      ↩︎ Top-tier libraries and the maintenance policy
    8. 8.
      “Most of these errors can likely be resolved with TorchDistributor, which is available on Databricks Runtime ML 13.0 and above.”
      ↩︎ Top-tier libraries and the maintenance policy
    9. 9.
      “The GPU ML version is chosen automatically based on the worker type.”
      ↩︎ GPU variants of the ML runtime
      “Databricks installs the NVIDIA driver and libraries required to use GPUs on Spark driver and worker instances”
      ↩︎ GPU variants of the ML runtime
      “For the versions of the libraries included, see the release notes for the specific Databricks Runtime version you are using.”
      ↩︎ GPU variants of the ML runtime
      “To create custom images for GPU compute, you must select a standard runtime version instead of Databricks Runtime ML for GPU.”
      ↩︎ GPU variants of the ML runtime
      “Photon is not supported with GPU instance types.”
      ↩︎ GPU variants of the ML runtime
      “The GPU ML version is chosen automatically based on the worker type.”
      ↩︎ Exam trap 2
      “The Photon acceleration checkbox must be unchecked. Photon is not supported with GPU instance types.”
      ↩︎ Checkpoint

    Ready to test yourself?

    Practise the 6 questions on this subdomain.

    Spotted a mistake, or was something unclear? Tell us.