Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove cudf._lib.groupby in favor of inlining pylibcudf #17582

Merged
merged 19 commits into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion python/cudf/cudf/_lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# the License.
# =============================================================================

set(cython_sources column.pyx groupby.pyx scalar.pyx strings_udf.pyx types.pyx utils.pyx)
set(cython_sources column.pyx scalar.pyx strings_udf.pyx types.pyx utils.pyx)
set(linked_libraries cudf::cudf)

rapids_cython_create_modules(
Expand Down
5 changes: 1 addition & 4 deletions python/cudf/cudf/_lib/__init__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
# Copyright (c) 2020-2024, NVIDIA CORPORATION.
import numpy as np

from . import (
groupby,
strings_udf,
)
from . import strings_udf

MAX_COLUMN_SIZE = np.iinfo(np.int32).max
MAX_COLUMN_SIZE_STR = "INT32_MAX"
Expand Down
281 changes: 0 additions & 281 deletions python/cudf/cudf/_lib/groupby.pyx

This file was deleted.

4 changes: 2 additions & 2 deletions python/cudf/cudf/core/_internals/aggregation.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@

class Aggregation:
def __init__(self, agg: plc.aggregation.Aggregation) -> None:
self.c_obj = agg
self.plc_obj = agg

@property
def kind(self) -> str:
name = self.c_obj.kind().name
name = self.plc_obj.kind().name
return _agg_name_map.get(name, name)

@classmethod
Expand Down
4 changes: 2 additions & 2 deletions python/cudf/cudf/core/column/column.py
Original file line number Diff line number Diff line change
Expand Up @@ -1605,7 +1605,7 @@ def scan(self, scan_op: str, inclusive: bool, **kwargs) -> Self:
return type(self).from_pylibcudf( # type: ignore[return-value]
plc.reduce.scan(
self.to_pylibcudf(mode="read"),
aggregation.make_aggregation(scan_op, kwargs).c_obj,
aggregation.make_aggregation(scan_op, kwargs).plc_obj,
plc.reduce.ScanType.INCLUSIVE
if inclusive
else plc.reduce.ScanType.EXCLUSIVE,
Expand Down Expand Up @@ -1637,7 +1637,7 @@ def reduce(self, reduction_op: str, dtype=None, **kwargs) -> ScalarLike:
with acquire_spill_lock():
plc_scalar = plc.reduce.reduce(
self.to_pylibcudf(mode="read"),
aggregation.make_aggregation(reduction_op, kwargs).c_obj,
aggregation.make_aggregation(reduction_op, kwargs).plc_obj,
dtype_to_pylibcudf_type(col_dtype),
)
result_col = type(self).from_pylibcudf(
Expand Down
Loading
Loading