A team has a large pandas script and wants it to run on an NVIDIA GPU with as few code changes as possible. What should they try first?
- Exam domain
- Data Manipulation and Preparation23% of the exam
- Difficulty
- Easy
- In this mock
- 11 questions on this domainPractise this domain
Why the exam asks this
Data Manipulation and Preparation (23% of the exam)
Objective in the exam guide: Data integration, joining, and manipulation using NVIDIA cuDF and pandas
cuDF and pandas are named together in the first objective.
Why C is the answer
Run it with the cudf.pandas accelerator mode
cudf.pandas runs existing pandas code on the GPU where cuDF supports the operation and falls back to the CPU where it does not, with no rewrite.
Remember: cudf.pandas accelerates pandas code unchanged.
How it works
cuDF is a GPU DataFrame library with a pandas-like API. cudf.pandas accelerates pandas code with CPU fallback.
In detail
- cudf.pandas needs no code changes.
- Unsupported operations fall back to CPU.
Every option, checked
Knowing why each wrong option fails is how you rule it out on exam day.
A. Move the data to a spreadsheetWrong
Spreadsheets cannot hold large data.
B. Rewrite every function in CUDA C++ by hand, starting with the joins and group-by operationsWrongMost tempting
Hand-written CUDA is a large rewrite.
Why it tempts: Writing CUDA sounds like the real GPU way.
C. Run it with the cudf.pandas accelerator modeRight
cudf.pandas accelerates pandas code unchanged.
D. Convert all DataFrames to Python listsWrong
Lists are slower than DataFrames.
Use case
An illustrative scenario, not a real incident.
Illustrative: loading the cudf.pandas extension in a notebook cuts a join-heavy script from 12 minutes to 40 seconds.
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".
flowchart TD
Q{"Can you change the code?"}
Q -->|"No or little"| A0["cudf.pandas accelerator"]
Q -->|"Yes"| A1["Use cuDF directly"]How to read this chart
- At "Can you change the code?": if "No or little", go to "cudf.pandas accelerator"; if "Yes", go to "Use cuDF directly".