In a recent XGBoost version, how do you train a gradient-boosted model on an NVIDIA GPU?
- Exam domain
- Machine Learning With RAPIDS16% of the exam
- Difficulty
- Medium
- In this mock
- 8 questions on this domainPractise this domain
Why the exam asks this
Machine Learning With RAPIDS (16% of the exam)
Objective in the exam guide: GPU-accelerated model training with NVIDIA cuML and XGBoost
XGBoost on GPUs is named.
Why C is the answer
Set device to "cuda" with the hist tree method
Recent XGBoost releases select the GPU with device="cuda" and the hist tree method. Data can come from cuDF directly.
Remember: XGBoost uses device="cuda" for GPU training.
How it works
XGBoost supports GPU training by setting the device to CUDA.
In detail
- device="cuda" with hist.
- Feed cuDF data directly.
Every option, checked
Knowing why each wrong option fails is how you rule it out on exam day.
A. Disable early stoppingWrong
Early stopping is unrelated to GPU use.
B. Install a separate GPU-only fork and rewrite the training loop around its own interfaceWrongMost tempting
GPU support is built into XGBoost.
Why it tempts: Older guides mention separate builds.
C. Set device to "cuda" with the hist tree methodRight
XGBoost uses device="cuda" for GPU training.
D. Convert features to strings firstWrong
Features must be numeric or categorical types.
Use case
An illustrative scenario, not a real incident.
Illustrative: a churn model trains 15 times faster on one GPU with the same hyperparameters.
See it in different ways
flowchart LR S0["Load data with cuDF"] --> S1["Set device cuda"] --> S2["Train with hist"] --> S3["Early stop on validation"] --> S4["Save model"]
How to read this chart
- Read it in order: Load data with cuDF, then Set device cuda, then Train with hist, then Early stop on validation, then Save model.
flowchart TD
Q{"Tabular data, need strong accuracy?"}
Q -->|"Yes"| A0["Gradient boosting such as XGBoost"]
Q -->|"Need interpretability"| A1["Linear or small tree model"]How to read this chart
- At "Tabular data, need strong accuracy?": if "Yes", go to "Gradient boosting such as XGBoost"; if "Need interpretability", go to "Linear or small tree model".