Before loading a dataset onto a GPU, how do you estimate whether it will fit?
- Exam domain
- MLOps19% of the exam
- Difficulty
- Medium
- In this mock
- 10 questions on this domainPractise this domain
Why the exam asks this
Objective in the exam guide: Assessing and verifying the memory size of a dataset
Assessing dataset memory size is named.
Why A is the answer
Measure in-memory size with memory_usage(deep=True) on a sample and scale up
In-memory size differs from compressed file size. Measuring a sample's memory use and scaling gives a realistic estimate to compare with device memory.
Remember: Measure in-memory size before loading.
How it works
Dataset memory size is measured and compared with available device memory.
In detail
- Disk size is not memory size.
- Measure a sample, then scale.
Every option, checked
Knowing why each wrong option fails is how you rule it out on exam day.
A. Measure in-memory size with memory_usage(deep=True) on a sample and scale upRight
Measure in-memory size before loading.
B. Assume every dataset fitsWrong
Many datasets do not fit.
C. Use the file size on disk, since compressed Parquet always matches in-memory size exactlyWrongMost tempting
Compressed Parquet expands in memory.
Why it tempts: File size is the obvious number.
D. Load it and see if it crashesWrong
Crashing wastes time.
Use case
An illustrative scenario, not a real incident.
Illustrative: a 10 GB Parquet file needs about 35 GB in memory, more than the 24 GB GPU.
See it in different ways
flowchart LR S0["Load a sample"] --> S1["Measure memory use"] --> S2["Scale to full rows"] --> S3["Add working headroom"] --> S4["Compare with GPU memory"]
How to read this chart
- Read it in order: Load a sample, then Measure memory use, then Scale to full rows, then Add working headroom, then Compare with GPU memory.
flowchart TD
Q{"Estimate plus headroom under device memory?"}
Q -->|"Yes"| A0["Load to one GPU"]
Q -->|"No"| A1["Dask-cuDF, smaller dtypes or spilling"]How to read this chart
- At "Estimate plus headroom under device memory?": if "Yes", go to "Load to one GPU"; if "No", go to "Dask-cuDF, smaller dtypes or spilling".