NVIDIA / NVIDIA/cudf

[FEA] Support grouped ``corr`` in cudf-polars

Open
#22,908 0 comments 0 reactions 0 assignees View on GitHub
cudf-polars feature request
Dominant language
C++
Stars
9.8k
Forks
1.1k
Avg merge
3d 6m
Merged PRs (30d)
278

Description

**Is your feature request related to a problem? Please describe.**
I would like to support grouped `pl.corr` aggregations on the GPU. Today, a simple grouped correlation query cannot be translated by the GPU engine.

```python
import polars as pl
import cudf_polars # noqa: F401

lf = pl.LazyFrame(
{
"g": ["A", "A", "A", "B", "B", "B"],
"x": [1.0, 2.0, 3.0, 1.0, 4.0, 7.0],
"y": [1.0, 4.0, 9.0, 2.0, 5.0, 8.0],
}
)

q = lf.group_by("g").agg(pl.corr("x", "y").alias("xy_corr")).sort("g")

print(q.collect())
print(q.collect(engine=pl.GPUEngine(raise_on_fail=True)))
```

CPU result:

```text
shape: (2, 2)
┌─────┬──────────┐
│ g ┆ xy_corr │
│ --- ┆ --- │
│ str ┆ f64 │
╞═════╪══════════╡
│ A ┆ 0.989743 │
│ B ┆ 1.0 │
└─────┴──────────┘
```

Current GPU error includes:

```text
NotImplementedError: corr
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.