[FEA] Enable cuDF spilling in cudf.pandas by default
- Dominant language
- C++
- Stars
- 9.8k
- Forks
- 1.1k
- Avg merge
- 3d 6m
- Merged PRs (30d)
- 278
Description
It's fairly common for workflows to involve processing 1-2 large tables (e.g., financial transaction data, website clicks, or sensor readings) and 1-2 smaller tables (e.g., customer, stock, store, or sensor IDs and attributes).
We'd like to enable people using pandas for these workloads today to seamlessly accelerate their code, but these kinds of workflows are at risk of running out of memory due to often requiring multiple dataframes to be active at once.
For example, loading the following CSV file containing ~12.5 GB of data (19 GB on disk) requires a peak of about 36 GB of GPU memory. If a user's workflow will have already created nearly any cuDF objects, they'll be at high risk of running out of memory on a 40 GB A100.
```python
import cudf
import pandas as pd
N = 260000000
K = 5
dtypes = {f"x{i}": float for i in range(K)}
dtypes["id"] = int
df = cudf.datasets.randomdata(
nrows=N,
dtypes=dtypes,
seed=12,
)
print(df.memory_usage().sum() / 1e9)
df.to_csv("df1.csv", chunksize=1e7)
12.48
```
```python
import cudf
df = cudf.read_csv("df1.csv")
# Baseline GPU memory: 417.00 MB. Peak GPU memory: 35835.00 MB
```
As cudf.pandas already uses the CPU when a workflow would otherwise throw an error in cuDF, we should explore enabling cuDF spilling to potentially prevent the out-of-memory errors arising from operations that would have succeeded if not for other cuDF objects in memory.
Contributor guide
Assessment
This issue has not been assessed yet.