Simplify cpu_to_gpu and gpu_to_cpu#6395
Merged
rapids-bot[bot] merged 2 commits intorapidsai:branch-25.04from Mar 5, 2025
Merged
Simplify cpu_to_gpu and gpu_to_cpu#6395rapids-bot[bot] merged 2 commits intorapidsai:branch-25.04from
cpu_to_gpu and gpu_to_cpu#6395rapids-bot[bot] merged 2 commits intorapidsai:branch-25.04from
Conversation
This is fixing a few warts I noticed when fixing a bug in some related
code a while ago. In particular, there's no reason to store the desired
order as an attribute on the cls as `{name}_order` - you can just pull
it off the descriptor directly when needed. The rest is some pythonic
improvements, but logically everything should be the same as it was
before.
betatim
approved these changes
Mar 5, 2025
Member
betatim
left a comment
There was a problem hiding this comment.
LGTM
A more general comment/thought related to this area:
One thing I've not liked about get_attr_names is that we rely on the attribute names in scikit-learn and cuml matching (and not changing/this list being up to date). We could solve the problem of keeping the list up to date by using vars(estimator) (maybe with a conditional), but it seems sometimes get_attr_names only contains fitted attributes (ending in _) but sometimes it also contains private attributes. So it seems hopeless to try and automatically discover this list. It seems quite fragile to transfer private attributes, unless we are just transferring them to store them "for later" when we want to transfer back?
viclafargue
approved these changes
Mar 5, 2025
Member
Author
|
/merge |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is fixing a few warts I noticed when fixing a bug in some related code a while ago. In particular, there's no reason to store the desired order as an attribute on the cls as
{name}_order(added here) - you can just pull it off the descriptor directly when needed. The rest is some pythonic improvements, but logic-wise everything should be the same as it was before.