원클릭으로
review-cudf-polars-expressions
Use when implementing or reviewing support for Polars Expressions in cudf-polars
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Use when implementing or reviewing support for Polars Expressions in cudf-polars
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Reproduce cudf CI failures locally. Provide a GitHub Actions job URL to auto-discover parameters, or supply the container image and CI script directly.
Benchmark a cuDF branch, WIP changes, or a PR against the `main` branch
Official NVIDIA-authored guidance for NVIDIA cuDF GPU DataFrames, pandas acceleration, dask-cuDF, ETL, joins, groupby, CSV/Parquet I/O, nullable semantics, and multi-GPU DataFrame workloads.
Debug and fix pandas test suite failures under the cudf.pandas compatibility layer. Use when given pytest node IDs of failing pandas tests that need to be fixed for cudf.pandas compatibility.
Use this skill to review GitHub pull requests for cudf
Build and test cudf Java bindings (cudf-java) inside a cudf devcontainer. Use when the user asks to build, compile, or test Java code in the cudf repository.
| name | review-cudf-polars-expressions |
| description | Use when implementing or reviewing support for Polars Expressions in cudf-polars |
This rule describes guidelines and implementation patterns for supporting Polars' Expression Python APIs in cudf-polars. A successful implementation:
python/cudf_polars/pyproject.tomlpre-commit checks.For example, to clone Polars matching the Polars version in a fictional, conda development environment named "cudf-dev"
POLARS_VERSION=$(conda run -n cudf-dev python -c "import polars as pl; print(pl.__version__)")
git clone https://github.com/pola-rs/polars.git --single-branch --branch py-$POLARS_VERSION /tmp/polars
If you are unable to clone Polars, the Polars repository is located at https://github.com/pola-rs/polars.
First, review the Polars implementation of the expression and understand its behavior without cudf-polars.
py-polars/src/polars/expr directory in a Polars repository.crates/polars-python/src/lazyframe/visitor/expr_nodes.rs file in a Polars repositoryNext, further understand the runtime behavior of the expressions by:
py-polars/tests directory that use the expression.Now, review if the Polars expression is currently supported and correct with cudf-polars.
Run the same examples generated in Step 1 with pl.GPUEngine(executor="streaming", raise_on_fail=True) passed to the engine argument of collect so failures do not fall back to CPU Polars. If the example data was relatively small, this should test the single partition path of cudf-polars.
Additionally run another variation of the Step 1 examples with pl.GPUEngine(executor="streaming", raise_on_fail=True, executor_options={"max_rows_per_partition": 2}) passed to the engine argument of collect. With a large enough input data for the examples, this configuration would test the multiple partition path of cudf-polars.
Note the following failure and fallback cases:
crates/polars-python/src/lazyframe/visitor/expr_nodes.rs. A fix therefore would be needed upstream in Polars in order to proceed with the next steps.Start with scoping an implementation for the single partition path for cudf-polars. This ensures that the multiple partition path can fall back to this implementation.
python/cudf_polars/cudf_polars/dsl/expressions directory.pylibcudf API to find the appropriate function or functions needed for the implementation.
libcudf public API as a function may be appropriate but not exposed through pylibcudf. If needed, expose this API through pylibcudf as part of the implementation. pylibcudf will need to be rebuilt from source in order to test the implementation.pylibcudf functions where possible. Evaluate using pylibcudf.expressions where sensible for combining several operations.pylibcudf methods that are deprecated.null_count or size that minimizes pylibcudf calls.to_arrow or to_pylist unless absolutely necessary.pylibcudf APIs calls are passed a stream object so they do not use their default stream argument.python/REVIEW_GUIDELINES.md__init__ method instead of the do_evaluate methods of the Expr subclasses.is_pointwise on the Expr subclass correctly reflects if the expression is a pointwise operation.Next, if the expression is non-pointwise, add a multiple partition implementation in python/cudf_polars/cudf_polars/streaming/expressions.py
TODO: Add more guidance on a multiple partition implementation.
Finally, add unit tests to an existing or new file in the python/cudf_polars/tests/expressions directory to test the implementation.
engine fixture from python/cudf_polars/tests/conftest.py to test all applicable cudf-polars engine types including single and multiple partition execution.python/cudf_polars/tests to check if existing tests used this expressions. Unit tests may have existed that asserted that this expression was not supported.pytest.mark.skipif with a boolean variable from python/cudf_polars/cudf_polars/utils/versions.py if a unit test exercises a Polars expression or an argument that doesn't exist since a particular Polars version within the cudf-polars support window defined in python/cudf_polars/pyproject.toml.assert_gpu_result_equal for expressions that return floats, consider specifying check_exact=False if necessary.When running the unit tests:
git stash the new implementation (i.e. all changes not in python/cudf_polars/tests) and only run the newly added tests to validate they fail without the new implementation.git stash apply the stashed files and run all unit tests in python/cudf_polars/tests. Address failures from the newly added tests or existing tests that fail because they use the Polars expressions being implemented.