-
Notifications
You must be signed in to change notification settings - Fork 555
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 CumlArray.copy()
#4958
Remove CumlArray.copy()
#4958
Conversation
e62b3cb
to
249fd21
Compare
249fd21
to
617ca0e
Compare
Codecov ReportBase: 79.46% // Head: 79.51% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## branch-22.12 #4958 +/- ##
================================================
+ Coverage 79.46% 79.51% +0.04%
================================================
Files 183 183
Lines 11618 11612 -6
================================================
+ Hits 9232 9233 +1
+ Misses 2386 2379 -7
Flags with carried forward coverage won't be shown. Click here to find out more.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm definitely happy to see this go. I'm going to leave it for just a bit longer before merging to make sure there are no other objections, considering this touches such a core feature.
cc @lixfz for awareness, as I know you do some instance checking with cumlarray in https://github.com/DataCanvasIO/Hypernets (but don't see any |
@@ -349,19 +349,6 @@ def serialize(self) -> Tuple[dict, list]: | |||
frames = [CumlArray(f) for f in frames] | |||
return header, frames | |||
|
|||
@nvtx.annotate(message="common.CumlArray.copy", category="utils", | |||
domain="cuml_python") | |||
def copy(self) -> Buffer: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cuml Array will no longer inherit from cuDF Buffer very soon (see @wphicks PR for CPU/GPU) and it will very likely diverge more from it, so cuDF's Buffer changes don't need to be mirrored. What are the advantages of removing it?
I would at least consider doing the change after PR 4908 goes in with all the changes that it is doing to cumlarray, which is still in fluctuation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are the advantages of removing it?
Removal of unused code. In its current state, calling .copy()
raises an exception.
It should probably also be removed in #4908:
cuml/python/cuml/internals/array.py
Lines 639 to 649 in e6c56a8
def copy(self) -> CudfBuffer: | |
""" | |
Create a new Buffer containing a copy of the data contained | |
in this Buffer. | |
""" | |
from rmm._lib.device_buffer import copy_device_to_ptr | |
# TODO(wphicks): Generalize this for host/device | |
out = CudfBuffer.empty(size=self.size) | |
copy_device_to_ptr(self.ptr, out.ptr, self.size) | |
return out |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking back at why I added it, it was a provisional fix when cudf Buffer did some changes but ended up going a different route to fix things, and it is now wrong and not needed indeed, so fully agree, will merge!
@gpucibot merge |
cuDF's `Buffer` doesn't have `Buffer.empty()` since rapidsai/cudf#11447. Can we remove `CumlArray.copy()`? Authors: - Mads R. B. Kristensen (https://github.com/madsbk) Approvers: - William Hicks (https://github.com/wphicks) - Dante Gama Dessavre (https://github.com/dantegd) URL: rapidsai#4958
cuDF's
Buffer
doesn't haveBuffer.empty()
since rapidsai/cudf#11447. Can we removeCumlArray.copy()
?