A team wants to tune a PyTorch model with Ray Tune on Databricks. What is the first step?
- Exam domain
- Model Development44% of the exam
- Difficulty
- Medium
- In this mock
- 22 questions on this domainPractise this domain
Why the exam asks this
Model Development (44% of the exam)
Objective in the exam guide: Perform distributed hyperparameter tuning using Ray.
Distributed tuning with Ray is named.
Why B is the answer
Start Ray on the cluster with setup_ray_cluster
Ray on Databricks runs on top of the Spark cluster. Once the Ray cluster is up, Ray Tune distributes trials across it.
Remember: Start Ray on Spark first.
How it works
Ray runs on Databricks by starting a Ray cluster on Spark.
In detail
- Set up Ray on Spark.
- Then Ray Tune distributes trials.
Every option, checked
Knowing why each wrong option fails is how you rule it out on exam day.
A. Use Hyperopt's SparkTrialsWrongMost tempting
That is a different tool.
Why it tempts: SparkTrials sounds like the Spark answer.
B. Start Ray on the cluster with setup_ray_clusterRight
Start Ray on Spark first.
C. Install Ray on a laptop and point it at Unity CatalogWrong
Ray must run where the compute is.
D. Convert the model to Spark MLWrong
PyTorch is not converted to Spark ML.
Use case
An illustrative scenario, not a real incident.
Illustrative: a vision model is tuned with Ray Tune across four GPU workers.
See it in different ways
flowchart LR S0["setup_ray_cluster"] --> S1["Define trainable"] --> S2["Tuner.fit"] --> S3["Log to MLflow"] --> S4["shutdown_ray_cluster"]
How to read this chart
- Read it in order: setup_ray_cluster, then Define trainable, then Tuner.fit, then Log to MLflow, then shutdown_ray_cluster.
sequenceDiagram participant P0 as Notebook participant P1 as Spark cluster participant P2 as Ray cluster P0->>P1: setup_ray_cluster P1->>P2: Ray workers on executors P0->>P2: Ray Tune trials
How to read this chart
- 1. Notebook sends "setup_ray_cluster" to Spark cluster.
- 2. Spark cluster sends "Ray workers on executors" to Ray cluster.
- 3. Notebook sends "Ray Tune trials" to Ray cluster.