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

balanced-k-means: fix a too large initial memory pool size #1148

Merged

Conversation

achirkin
Copy link
Contributor

calc_minibatch_size decides on the batch size under assumption that the workspace shouldn't exceed 1GB. It takes into account that fewer extra buffers are needed when the data type T is float. However, we don't take this into account when setting the initial memory pool size immediately after calculating max_minibatch_size. As a result, under some conditions, the algorithm attempts to allocate more memory than available. This PR sets the limit of the initial pool size to 1GB to fix the issue.

@achirkin achirkin requested a review from a team as a code owner January 17, 2023 15:31
@github-actions github-actions bot added the cpp label Jan 17, 2023
@achirkin achirkin added bug Something isn't working non-breaking Non-breaking change 2 - In Progress Currenty a work in progress and removed cpp labels Jan 17, 2023
@achirkin
Copy link
Contributor Author

Tagging @Nyrio for awareness, since you're working on balanced k-means.

@Nyrio
Copy link
Contributor

Nyrio commented Jan 17, 2023

Wouldn't it be better to update the calculation of the initial pool size to avoid assuming that we need to store the distance matrix? Similar to how we calculate the batch size.

@codecov-commenter
Copy link

Codecov Report

Base: 87.99% // Head: 87.99% // No change to project coverage 👍

Coverage data is based on head (405e66b) compared to base (efd42c9).
Patch has no changes to coverable lines.

Additional details and impacted files
@@              Coverage Diff              @@
##           branch-23.02    #1148   +/-   ##
=============================================
  Coverage         87.99%   87.99%           
=============================================
  Files                21       21           
  Lines               483      483           
=============================================
  Hits                425      425           
  Misses               58       58           

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.

@github-actions github-actions bot added the cpp label Jan 18, 2023
@achirkin achirkin added 3 - Ready for Review and removed 2 - In Progress Currenty a work in progress labels Jan 19, 2023
@achirkin achirkin requested a review from tfeher January 19, 2023 09:24
Copy link
Contributor

@tfeher tfeher left a comment

Choose a reason for hiding this comment

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

Thanks Artem for the update, LGTM!

@cjnolet
Copy link
Member

cjnolet commented Jan 19, 2023

/merge

@rapids-bot rapids-bot bot merged commit 7215c8a into rapidsai:branch-23.02 Jan 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3 - Ready for Review bug Something isn't working cpp non-breaking Non-breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants