[R-package] limit number of threads used in tests and examples (fixes #5987)#5988
Merged
[R-package] limit number of threads used in tests and examples (fixes #5987)#5988
Conversation
Collaborator
|
We will revert this PR when the "global option" works? |
Collaborator
Author
|
The parts of it about limiting number of threads in tests and examples, yes. The renaming of those two internal functions should be permanent, now that CRAN is complaining about them. |
shiyu1994
approved these changes
Jul 19, 2023
Collaborator
Author
|
Thanks @shiyu1994 ! I'll merge this and submit a new version to CRAN right now. Will |
Collaborator
Author
|
Ok @shiyu1994 I just submitted on CRAN as v4.0.0.1. Please check your inbox. Thanks for your help!
|
Contributor
|
This pull request has been automatically locked since there has not been any recent activity since it was closed. To start a new related discussion, open a new issue at https://github.com/microsoft/LightGBM/issues including a reference to this. |
This file contains hidden or 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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.

Fixes #5987.
This PR fixes the two issues that blocked the release of
{lightgbm}v4.0.0 to CRAN a few days ago, documented in #5987..-separated names to instead use_Notes for Reviewers
Once this is approved, I'll push a release containing this PR to CRAN, as v4.0.0.1 (since a new submission requires a new release number, and to avoid creating a new actual LightGBM release of all other components).
Why is this touching so many lines?
I tried many variations of the idea from #5102 (comment), using a global option (specified in
R-package/tests/testthat.Ror at the tops of test files) to pass through a number of threads set inBooster$new(). Unfortunately, they all resulted in segmentation faults (😬) fromtestthat. Maybe related to some interplay between the fact that{testthat}runs tests in sub-processes and the fact that session options are initialized when packages are loaded?I'm not sure. For now, to try to get a release up before the CRAN summer break, I think we should just hard-code
num_threadsto 2 in as many places as possible... can work out a more elegant solution later, when there isn't time pressure.Other references I consulted while trying to find a better solution