-
Notifications
You must be signed in to change notification settings - Fork 948
Fix integer overflows in pylibcudf from_column_view_of_arbitrary
#18758
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
Fix integer overflows in pylibcudf from_column_view_of_arbitrary
#18758
Conversation
python/pylibcudf/pylibcudf/libcudf/strings/strings_column_view.pxd
Outdated
Show resolved
Hide resolved
Other sources of overflow were fixed in #18734. Those fixes conflict partially with this one, but this fix is also necessary since that PR did not fix the chars case, so this PR is still necessary. |
libcudf size_of returns a size_t, not a size_type.
Can't unilaterally use int32 offsets.
Rather than reinventing the wheel, use the libcudf functionality.
4f2c8bf
to
919ab40
Compare
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.
Thanks for fixing up all the bindings for size_of
's return type as well, I didn't do that in my PR to get a fix in quickly but I agree that it is necessary.
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.
The default empty constructor for cudf::strings_column_view
was left out on purpose but I understand the struggle that is Cython.
Thanks, yes. |
Actually, by using cython's cpp_locals directive, I can avoid the need for the nullary ctor... |
Looks like I screwed something up :( |
Currently failing with errors like:
|
At least some of the tests pass if you initialize diff --git a/python/pylibcudf/pylibcudf/column.pyx b/python/pylibcudf/pylibcudf/column.pyx
index 41d7faad08..c5c056c049 100644
--- a/python/pylibcudf/pylibcudf/column.pyx
+++ b/python/pylibcudf/pylibcudf/column.pyx
@@ -353,7 +353,7 @@ cdef class Column:
# TODO: Check if children can ever change. If not, this could be
# computed once in the constructor and always be reused.
- cdef vector[column_view] c_children
+ cdef vector[column_view] c_children = vector[column_view]()
with gil:
if self._children is not None:
for child in self._children:
@@ -388,7 +388,7 @@ cdef class Column:
if self._mask is not None:
null_mask = <bitmask_type*>self._mask.ptr
- cdef vector[mutable_column_view] c_children
+ cdef vector[mutable_column_view] c_children = vector[mutable_column_view]()
with gil:
if self._children is not None:
for child in self._children: |
Given the nature of the changeset, some bug with the |
Ok will try reverting ea10cb3 |
Yeah, thanks all. |
/merge |
Description
Although the number of rows in a
column_view
cannot exceedsize_type
, the number of bytes surely can. So fix that.This fixes multi-GPU errors we are seeing in rapidsmpf when communicating buffers.
Checklist