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

Support conversion to/from cudf in dask.dataframe.core.to_backend #12380

Merged
merged 24 commits into from
Feb 8, 2023

Conversation

rjzamora
Copy link
Member

@rjzamora rjzamora commented Dec 13, 2022

Depends on dask/dask#9758

Description

This PR corresponds to the cudf component of dask/dask#9758

Checklist

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

@rjzamora rjzamora added 2 - In Progress Currently a work in progress dask Dask issue improvement Improvement / enhancement to an existing function non-breaking Non-breaking change labels Dec 13, 2022
@github-actions github-actions bot added the Python Affects Python cuDF API. label Dec 13, 2022
@rjzamora rjzamora marked this pull request as ready for review January 30, 2023 17:07
@rjzamora rjzamora requested a review from a team as a code owner January 30, 2023 17:07
@rjzamora rjzamora added 3 - Ready for Review Ready for review by team 4 - Needs Dask Reviewer and removed 2 - In Progress Currently a work in progress labels Jan 30, 2023
galipremsagar
galipremsagar previously approved these changes Jan 30, 2023
Copy link
Contributor

@galipremsagar galipremsagar left a comment

Choose a reason for hiding this comment

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

LGTM, minor comment.

python/dask_cudf/dask_cudf/backends.py Outdated Show resolved Hide resolved
@vyasr
Copy link
Contributor

vyasr commented Jan 30, 2023

Is this critical? We're entering an already-delayed code freeze tonight, so it would be better to push this to 23.04.

@codecov
Copy link

codecov bot commented Jan 30, 2023

Codecov Report

❗ No coverage uploaded for pull request base (branch-23.04@fea6288). Click here to learn what that means.
Patch has no changes to coverable lines.

Additional details and impacted files
@@               Coverage Diff               @@
##             branch-23.04   #12380   +/-   ##
===============================================
  Coverage                ?   85.85%           
===============================================
  Files                   ?      158           
  Lines                   ?    25204           
  Branches                ?        0           
===============================================
  Hits                    ?    21638           
  Misses                  ?     3566           
  Partials                ?        0           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Contributor

@wence- wence- left a comment

Choose a reason for hiding this comment

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

FWIW, although I think that this is probably safe, it doesn't really feel like the right kind of change we should be attempting to get in in code freeze; so I'm with @vyasr here that I think this is better to slip to 23.04.

python/dask_cudf/dask_cudf/tests/test_core.py Outdated Show resolved Hide resolved
python/dask_cudf/dask_cudf/backends.py Outdated Show resolved Hide resolved
if isinstance(data._meta, (cudf.DataFrame, cudf.Series, cudf.Index)):
# Already a cudf-backed collection
return data
return data.map_partitions(cls.to_backend_dispatch(), **kwargs)
Copy link
Contributor

Choose a reason for hiding this comment

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

Perhaps this is a question for the dask side of the implementation, but under what circumstances can kwargs be non-empty (and then relatedly, are there circumstances in which we already have a cudf-backed collection where non-empty kwargs could semantically require something different than data.map_partitions(identity))?

Copy link
Member Author

Choose a reason for hiding this comment

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

Good question - I updated things a bit to be explicit about supported/unsupported key-word arguments. I also added a bit more test coverage.

Context: We (probably) do want to make it possible to do things like ddf.to_backend("cudf", nan_as_null=False). However, I'm still unsure of the best way to document the supported to_backend kwargs for the various conversions.

Copy link
Contributor

Choose a reason for hiding this comment

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

Hmmm, can we link to the registered backend dispatch function which could explain what it accepts as keyword arguments?

Copy link
Member Author

Choose a reason for hiding this comment

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

I’ll give this a think, but not sure how/where to link to the dispatch-function args, since the available arguments to the user-facing API (to_backend) will depend on the specified backend. Any ideas?

@rjzamora rjzamora changed the base branch from branch-23.02 to branch-23.04 January 31, 2023 14:16
@rjzamora rjzamora dismissed galipremsagar’s stale review January 31, 2023 14:16

The base branch was changed.

@rjzamora rjzamora requested a review from a team as a code owner January 31, 2023 14:31
@rjzamora rjzamora requested a review from shwina January 31, 2023 14:31
@rjzamora
Copy link
Member Author

rjzamora commented Jan 31, 2023

FWIW, although I think that this is probably safe, it doesn't really feel like the right kind of change we should be attempting to get in in code freeze; so I'm with @vyasr here that I think this is better to slip to 23.04.

Thanks for the review @wence- ! Agree with you both that this should go in 23.04 - The Dask documentation can be updated pretty easily to specify that dask_cudf>23.02 will be required to use the to_backend API with gpu-backed DataFrame data.

@rjzamora rjzamora added 5 - Ready to Merge Testing and reviews complete, ready to merge and removed 3 - Ready for Review Ready for review by team 4 - Needs Dask Reviewer labels Feb 7, 2023
@rjzamora
Copy link
Member Author

rjzamora commented Feb 7, 2023

/merge

@rapids-bot rapids-bot bot merged commit b8ae0e4 into rapidsai:branch-23.04 Feb 8, 2023
@rjzamora rjzamora deleted the to-backend branch February 8, 2023 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
5 - Ready to Merge Testing and reviews complete, ready to merge dask Dask issue improvement Improvement / enhancement to an existing function non-breaking Non-breaking change Python Affects Python cuDF API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants