-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
CUDATreeLearner: free GPU memory in destructor if any allocated #4963
Merged
Merged
Changes from 3 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
4e9c9e9
CUDATreeLearner: free GPU memory in destruuctor if any allocated
denmoroz 0804d40
Minor changes: checking for num_gpu_feature_groups is not needed
denmoroz 86b36cc
Trigger CI again
denmoroz c553276
Merge branch 'microsoft:master' into fix-4952
denmoroz fd66751
Merge branch 'master' into fix-4952
denmoroz 70162d1
Merge branch 'fix-4952' of github.com:denmoroz/LightGBM into fix-4952
denmoroz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With a static schedule, and
num_gpu_
chunk size, I think there will be only 1 thread being used. So I can we simply remove this line?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@shiyu1994
To be honest I've just copy-pasted code from here which uses
omp parallel
, so I decided that probably it is done intentionally. My expectations were that cleanup for each GPU device will be executed in parallel for efficiency (ifnum_gpu_ > 1
). Do you think we should actually remove this?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After experimenting, I find that schedule(static, num_gpu_) will only result in a single thread. With
num_gpu_
block size, and withnum_gpu_
total iterations. So this would not parallelize the for loop.I think it is ok to keep the
omp parallel
in this PR. And we can fix this with another PR. Thank you!