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

Fix get_device_memory_ids #1305

Merged

Conversation

wence-
Copy link
Contributor

@wence- wence- commented Jan 18, 2024

A recent change to the way StringColumns are implemented in cudf threw up that we were never correctly determining the number of device buffers belonging to cudf columns if they had children (e.g. list and struct columns) or masks (any nullable column). Handle those cases and update the test.

StringColumns used to store both the character data and offsets column
in their "children" slot which is not inspected by
get_device_memory_ids. A recent cudf change moved the character data
to the `.data` property, so it now shows up. Adapt expected number of
buffers in the test accordingly.
cudf Columns should be treated specially, since they hide device
buffers in mask, data, and children properties.
@wence- wence- requested a review from a team as a code owner January 18, 2024 15:21
@github-actions github-actions bot added the python python code needed label Jan 18, 2024
@wence- wence- added the non-breaking Non-breaking change label Jan 18, 2024
@madsbk madsbk added the bug Something isn't working label Jan 18, 2024
Copy link
Member

@pentschev pentschev left a comment

Choose a reason for hiding this comment

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

Looks mostly good to me, left a question whether we can make the test more robust.

Comment on lines +314 to +321
# Buffers are:
# 1. int data for objects[0].a
# 2. mask data for objects[0].a
# 3. int data for objects[0].b
# 4. int data for objects[0].index
# 5. int data for objects[1].levels[0]
# 6. char data for objects[1].levels[1]
# 7. offset data for objects[1].levels[1]
Copy link
Member

Choose a reason for hiding this comment

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

Should we assert their types instead of listing them as a comment?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

get_device_memory_ids just gathers DeviceBuffers which are untyped. This comment is so that a future reader of the test knows where the magic number 7 comes from.

Copy link
Member

Choose a reason for hiding this comment

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

Sounds good, thanks.

Copy link
Member

@madsbk madsbk left a comment

Choose a reason for hiding this comment

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

LGTM, thanks @wence-

@pentschev
Copy link
Member

Thanks @wence- !

@pentschev
Copy link
Member

/merge

@rapids-bot rapids-bot bot merged commit 34e7404 into rapidsai:branch-24.02 Jan 18, 2024
24 checks passed
@wence- wence- deleted the wence/fix/test-device-memory-ids branch January 18, 2024 17:09
younseojava pushed a commit to ROCm/dask-cuda-rocm that referenced this pull request Apr 16, 2024
A recent change to the way `StringColumn`s are implemented in cudf threw up that we were never correctly determining the number of device buffers belonging to cudf columns if they had children (e.g. list and struct columns) or masks (any nullable column). Handle those cases and update the test.

Authors:
  - Lawrence Mitchell (https://github.com/wence-)

Approvers:
  - Peter Andreas Entschev (https://github.com/pentschev)
  - Mads R. B. Kristensen (https://github.com/madsbk)

URL: rapidsai#1305
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working non-breaking Non-breaking change python python code needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants