Your scikit-learn random forest is slow on 50 million rows. Which change keeps a familiar API and uses the GPU?
- Exam domain
- Machine Learning With RAPIDS16% of the exam
- Difficulty
- Easy
- 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
cuML and XGBoost are the named training tools.
Why C is the answer
Use cuML's random forest with the same style of API
cuML mirrors scikit-learn's fit and predict API with GPU implementations of many algorithms, including random forests.
Remember: cuML gives scikit-learn style models on GPU.
How it works
cuML provides GPU versions of common ML algorithms with a scikit-learn-like API.
In detail
- cuML mirrors scikit-learn.
- Many algorithms are GPU-accelerated.
Every option, checked
Knowing why each wrong option fails is how you rule it out on exam day.
A. Rewrite the model as a deep neural network in a different framework from scratchWrongMost tempting
A new framework is a big rewrite.
Why it tempts: Deep learning sounds like the GPU answer.
B. Use fewer rows and accept lower accuracyWrong
Fewer rows lowers accuracy.
C. Use cuML's random forest with the same style of APIRight
cuML gives scikit-learn style models on GPU.
D. Run scikit-learn on more CPU threads onlyWrong
More CPU threads help less than a GPU.
Use case
An illustrative scenario, not a real incident.
Illustrative: swapping the import to cuML trains the forest in 2 minutes instead of 40.
See it in different ways
mindmap
root(("RAPIDS"))
n1["cuDF"]
n2["DataFrames"]
n3["like pandas"]
n4["cuML"]
n5["Machine learning"]
n6["like scikit-learn"]
n7["cuGraph"]
n8["Graph analytics"]
n9["like NetworkX"]
n10["Dask-cuDF"]
n11["Many GPUs"]
n12["like Dask DataFrame"]How to read this chart
- The centre is "RAPIDS".
- "cuDF" covers "DataFrames", "like pandas".
- "cuML" covers "Machine learning", "like scikit-learn".
- "cuGraph" covers "Graph analytics", "like NetworkX".
- "Dask-cuDF" covers "Many GPUs", "like Dask DataFrame".
sequenceDiagram participant P0 as Notebook participant P1 as cuDF participant P2 as cuML P0->>P1: load data to GPU P1->>P2: fit model P2-->>P0: predictions
How to read this chart
- 1. Notebook sends "load data to GPU" to cuDF.
- 2. cuDF sends "fit model" to cuML.
- 3. Notebook gets a reply from cuML: "predictions".