You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When a dataframe is packed (creating a PackedColumns object) GPU memory usage goes up, reflecting the underlying rmm::device_buffer of the cudf::packed_columns. However, when the PackedColumns object is deleted (del packed), the memory usage consistently remains the same, implying that somewhere down the line, something is not being destroyed properly.
Steps/Code to reproduce bug
The dataframe size / number of runs here will vary on the amount of GPU memory available, but this gives me a MemoryError on a 32GB V100:
Additional context
After discussion with @brandon-b-miller and @shwina, it looks like we are encountering cython/cython#3226 here - because a member of cdef class _CPackedColumns is the cdef struct packed_columns, when we delete a _CPackedColumns object this struct isn't actually destroyed, leaving behind the device buffer taking up memory.
As discussed in the issue, a workaround for this is to instead use a cdef cppclass packed_columns, but ultimately a fix was made for this in Cython 3.0 with cython/cython#3228. I'm going to ask if this fix can be backported to 0.29.x, which would make our current implementation work, but in the meantime I'll submit a PR using the workaround. This issue will track the progress on our backport request.
The text was updated successfully, but these errors were encountered:
Describe the bug
When a dataframe is packed (creating a
PackedColumns
object) GPU memory usage goes up, reflecting the underlyingrmm::device_buffer
of thecudf::packed_columns
. However, when thePackedColumns
object is deleted (del packed
), the memory usage consistently remains the same, implying that somewhere down the line, something is not being destroyed properly.Steps/Code to reproduce bug
The dataframe size / number of runs here will vary on the amount of GPU memory available, but this gives me a
MemoryError
on a 32GB V100:Expected behavior
Python garbage collection should eventually handle any unreferenced
PackedColumns
objects and free up the GPU memory they use.Environment overview (please complete the following information)
Environment details
Click here to see environment details
Additional context
After discussion with @brandon-b-miller and @shwina, it looks like we are encountering cython/cython#3226 here - because a member of
cdef class _CPackedColumns
is thecdef struct packed_columns
, when we delete a_CPackedColumns
object this struct isn't actually destroyed, leaving behind the device buffer taking up memory.As discussed in the issue, a workaround for this is to instead use a
cdef cppclass packed_columns
, but ultimately a fix was made for this in Cython 3.0 with cython/cython#3228. I'm going to ask if this fix can be backported to 0.29.x, which would make our current implementation work, but in the meantime I'll submit a PR using the workaround. This issue will track the progress on our backport request.The text was updated successfully, but these errors were encountered: