Skip to content

Use numpy.empty() instead of bytearray to allocate host memory for spilling - #12399

Merged
rapids-bot[bot] merged 9 commits into
NVIDIA:branch-23.02from
madsbk:spilling_avoid_bytearray
Jan 11, 2023
Merged

rapids-bot[bot] merged 9 commits into
NVIDIA:branch-23.02from
madsbk:spilling_avoid_bytearray

Conversation

@madsbk

@madsbk madsbk commented Dec 16, 2022

Copy link
Copy Markdown
Contributor

A bytearray is zero-initialized using calloc, which we don't need.  Additionally, numpy.empty both skips the zero-initialization and uses hugepages when available numpy/numpy#14216. 

@github-actions github-actions Bot added the Python Affects Python cuDF API. label Dec 16, 2022
@madsbk madsbk added improvement Improvement / enhancement to an existing function non-breaking Non-breaking change labels Dec 16, 2022
@codecov

codecov Bot commented Dec 16, 2022 •

Copy link
Copy Markdown

Codecov Report

Base: 86.58% // Head: 85.65% // Decreases project coverage by -0.92% ⚠️

Coverage data is based on head (2795cdf) compared to base (b6dccb3).
Patch has no changes to coverable lines.

Additional details and impacted files
@@               Coverage Diff                @@
##           branch-23.02   #12399      +/-   ##
================================================
- Coverage         86.58%   85.65%   -0.93%     
================================================
  Files               155      155              
  Lines             24368    24812     +444     
================================================
+ Hits              21098    21253     +155     
- Misses             3270     3559     +289     
Impacted Files Coverage Δ
python/cudf/cudf/_version.py 1.41% <0.00%> (-98.59%) ⬇️
python/cudf/cudf/core/buffer/spill_manager.py 72.50% <0.00%> (-7.50%) ⬇️
python/cudf/cudf/core/buffer/spillable_buffer.py 90.04% <0.00%> (-2.81%) ⬇️
python/cudf/cudf/utils/dtypes.py 77.85% <0.00%> (-1.61%) ⬇️
python/cudf/cudf/options.py 86.11% <0.00%> (-1.59%) ⬇️
python/cudf/cudf/core/single_column_frame.py 94.30% <0.00%> (-1.27%) ⬇️
...ython/custreamz/custreamz/tests/test_dataframes.py 98.38% <0.00%> (-1.01%) ⬇️
python/dask_cudf/dask_cudf/io/parquet.py 91.81% <0.00%> (-0.59%) ⬇️
python/cudf/cudf/core/multiindex.py 91.66% <0.00%> (-0.51%) ⬇️
python/cudf/cudf/core/algorithms.py 90.00% <0.00%> (-0.48%) ⬇️
... and 39 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.
📢 Do you have feedback about the report comment? Let us know in this issue.

@madsbk
madsbk marked this pull request as ready for review December 16, 2022 13:21
@madsbk
madsbk requested a review from a team as a code owner December 16, 2022 13:21
@madsbk
madsbk requested review from isVoid and shwina December 16, 2022 13:21

@vyasr vyasr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I suspect that there are places in our code that use e.g. numpy.zeros that could also be improved in this way, but that's out of scope for this PR.

@jakirkham jakirkham left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks great! Thanks Mads 😄

Is there anywhere else we should be doing this?

@madsbk

madsbk commented Jan 11, 2023

Copy link
Copy Markdown
Contributor Author

Thanks @jakirkham and @vyasr, I think it can be merged

@jakirkham

Copy link
Copy Markdown
Contributor

/merge

@rapids-bot
rapids-bot Bot merged commit 074c359 into NVIDIA:branch-23.02 Jan 11, 2023
@madsbk
madsbk deleted the spilling_avoid_bytearray branch January 19, 2023 07:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

3 participants