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

Add assert_column_memory_* #9882

Conversation

isVoid
Copy link
Contributor

@isVoid isVoid commented Dec 9, 2021

This PR refactors test_index.py::test_index_copy_deep and adds test utility function assert_column_memory_eq and assert_column_memory_ne, which tests if two cudf columns possess (or not possess) the same piece of memory.

@isVoid isVoid requested a review from a team as a code owner December 9, 2021 20:25
@isVoid isVoid requested review from trxcllnt and shwina December 9, 2021 20:25
@github-actions github-actions bot added the Python Affects Python cuDF API. label Dec 9, 2021
@isVoid isVoid added improvement Improvement / enhancement to an existing function 3 - Ready for Review Ready for review by team non-breaking Non-breaking change labels Dec 9, 2021
@codecov
Copy link

codecov bot commented Dec 9, 2021

Codecov Report

Merging #9882 (8500407) into branch-22.04 (1e5b01f) will increase coverage by 0.00%.
The diff coverage is 0.00%.

Impacted file tree graph

@@              Coverage Diff              @@
##           branch-22.04    #9882   +/-   ##
=============================================
  Coverage         10.50%   10.50%           
=============================================
  Files               126      127    +1     
  Lines             21218    21215    -3     
=============================================
  Hits               2228     2228           
+ Misses            18990    18987    -3     
Impacted Files Coverage Δ
python/cudf/cudf/testing/_utils.py 0.00% <0.00%> (ø)
python/cudf/cudf/core/frame.py 0.00% <0.00%> (ø)
python/cudf/cudf/core/index.py 0.00% <0.00%> (ø)
python/cudf/cudf/core/series.py 0.00% <0.00%> (ø)
python/cudf/cudf/core/dataframe.py 0.00% <0.00%> (ø)
python/cudf/cudf/core/multiindex.py 0.00% <0.00%> (ø)
python/cudf/cudf/core/_base_index.py 0.00% <0.00%> (ø)
python/cudf/cudf/core/indexed_frame.py 0.00% <0.00%> (ø)
python/cudf/cudf/core/groupby/groupby.py 0.00% <0.00%> (ø)
python/cudf/cudf/core/mixins/__init__.py 0.00% <0.00%> (ø)
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1e5b01f...8500407. Read the comment docs.

@github-actions
Copy link

github-actions bot commented Jan 8, 2022

This PR has been labeled inactive-30d due to no recent activity in the past 30 days. Please close this PR if it is no longer required. Otherwise, please respond with a comment indicating any updates. This PR will be labeled inactive-90d if there is no activity in the next 60 days.

Comment on lines 315 to 321
def assert_column_memory_eq(
lhs: cudf.core.column.ColumnBase, rhs: cudf.core.column.ColumnBase
):
assert lhs.base_data_ptr == rhs.base_data_ptr
assert lhs.base_mask_ptr == rhs.base_mask_ptr
for lhs_child, rhs_child in zip(lhs.base_children, rhs.base_children):
assert_column_memory_eq(lhs_child, rhs_child)
Copy link
Contributor

Choose a reason for hiding this comment

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

Wouldn't this also return True for columns that have the same base pointers but different sizes?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Right.. Is adding check for size sufficient?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes - an additional check for size should be enough.

@isVoid
Copy link
Contributor Author

isVoid commented Jan 20, 2022

I'm wondering.. is it possible for two columns locating on different nodes in a multi-node setup to have the same memory address but are in fact two separate objects? cc @shwina

@shwina
Copy link
Contributor

shwina commented Jan 20, 2022

Probably? But I don't think this API should be concerned with that scenario.

@shwina
Copy link
Contributor

shwina commented Jan 20, 2022

Moved this over to the 22.04 project board. Please retarget when you have a chance :)

@shwina shwina changed the base branch from branch-22.02 to branch-22.04 January 20, 2022 21:24
@isVoid isVoid requested a review from shwina January 21, 2022 06:16
@isVoid
Copy link
Contributor Author

isVoid commented Jan 31, 2022

rerun tests

@github-actions
Copy link

github-actions bot commented Mar 2, 2022

This PR has been labeled inactive-30d due to no recent activity in the past 30 days. Please close this PR if it is no longer required. Otherwise, please respond with a comment indicating any updates. This PR will be labeled inactive-90d if there is no activity in the next 60 days.

@isVoid isVoid requested a review from shwina March 7, 2022 23:01
@isVoid
Copy link
Contributor Author

isVoid commented Mar 8, 2022

@gpucibot merge

@rapids-bot rapids-bot bot merged commit 555fb63 into rapidsai:branch-22.04 Mar 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3 - Ready for Review Ready for review by team improvement Improvement / enhancement to an existing function non-breaking Non-breaking change Python Affects Python cuDF API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants