NVIDIA / NVIDIA/cudf

[FEA] Support grouped ``LazyFrame.rolling`` in cuDF-Polars

Open
#23,590 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

`LazyFrame.rolling(index_column=..., group_by=...).agg(...)` is supported by the GPU engine for single-partition/in-memory execution, but streaming multi-partition execution is not yet supported.

```python
def test_lazyframe_rolling_grouped(engine: GPUEngine) -> None:
"""``LazyFrame.rolling`` (grouped).

Status
------
- In-memory OK
- Streaming NOT supported

"""
lf = pl.LazyFrame(
{
"g": ["A", "A", "A", "B", "B"],
"idx": [1, 2, 3, 1, 2],
"val": [10, 20, 30, 40, 50],
}
).sort("g", "idx")
q = lf.rolling(index_column="idx", period="2i", group_by="g", closed="right").agg(
s=pl.col("val").sum(),
n=pl.len(),
)
assert_gpu_result_equal(q, engine=engine)
```

**Note**: The first implementation may be able to shuffle groups together and evaluate locally, but very large groups may need a more distributed strategy later. We can open a new/distinct issue to track the latter case if needed.

Contributor guide

Open the contributing guide

Research direction

Start with the `test_lazyframe_rolling_grouped` case and the `LazyFrame.rolling(index_column=..., group_by=...).agg(...)` entry point shown in the issue. Run the case with streaming multi-partition execution enabled, then trace the GPU engine path used after the existing in-memory support. Done means the grouped rolling query produces matching GPU results in streaming execution.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data-engineering, distributed-systems
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.