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

Expunge as_frame conversions in Column algorithms #14491

Merged

Conversation

wence-
Copy link
Contributor

@wence- wence- commented Nov 24, 2023

Description

Previously a number of algorithms on Columns first converted to a single column frame and called a frame-based algorithm (which calls directly into libcudf using the column we first thought of). This is unnecessary since we already have the column to hand when calling the same algorithm at the column level. Moreover, in many cases where the algorithm is a user-facing API, the frame-based approach does more work (for example conversions and dtype matching).

By removing this round trip we reduce some (unnecessary) overhead, and also make the memory footprint and behaviour of column-based methods more transparent.

Checklist

  • I am familiar with the Contributing Guidelines.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

Previously a number of algorithms on Columns first converted to a
single column frame and called a frame-based algorithm (which calls
directly into libcudf using the column we first thought of). This is
unnecessary since we already have the column to hand when calling the
same algorithm at the column level. Moreover, in many cases where the
algorithm is a user-facing API, the frame-based approach does more
work (for example conversions and dtype matching).

By removing this round trip we reduce some (unnecessary) overhead, and
also make the memory footprint and behaviour of column-based methods
more transparent.

- Closes rapidsai#13565
@wence- wence- added improvement Improvement / enhancement to an existing function breaking Breaking change labels Nov 24, 2023
@wence- wence- requested a review from a team as a code owner November 24, 2023 14:35
@github-actions github-actions bot added the Python Affects Python cuDF API. label Nov 24, 2023
Copy link
Contributor

@bdice bdice left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine to me. Can you comment a bit on exactly how this reduces the memory footprint? I thought a frame (with no index) would be a low-cost wrapper in most cases. Is it just removing the memory allocated by any conversion steps?

@wence-
Copy link
Contributor Author

wence- commented Nov 24, 2023

Looks fine to me. Can you comment a bit on exactly how this reduces the memory footprint? I thought a frame (with no index) would be a low-cost wrapper in most cases. Is it just removing the memory allocated by any conversion steps?

Yes, it's the removal of dtype conversions.

@wence-
Copy link
Contributor Author

wence- commented Nov 24, 2023

/merge

@rapids-bot rapids-bot bot merged commit db6745b into rapidsai:branch-24.02 Nov 24, 2023
67 checks passed
@wence- wence- deleted the wence/fix/column-as-frame-usage branch November 24, 2023 17:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking Breaking change improvement Improvement / enhancement to an existing function Python Affects Python cuDF API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[ENH] Remove unnecessary as_frame conversions in cudf Column API
3 participants