Resolve the issue where BruteForceSampler fails to suggest all combinations#5893
Merged
gen740 merged 10 commits intooptuna:masterfrom Jan 29, 2025
Merged
Conversation
Contributor
|
This pull request has not seen any recent activity. |
BruteForceSampler fails to suggest all combinations
Member
|
@gen740 @contramundum53 Could you review this PR? |
contramundum53
requested changes
Jan 8, 2025
Contributor
|
This pull request has not seen any recent activity. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #5893 +/- ##
==========================================
+ Coverage 88.46% 88.48% +0.02%
==========================================
Files 205 205
Lines 13768 13786 +18
==========================================
+ Hits 12180 12199 +19
+ Misses 1588 1587 -1 ☔ View full report in Codecov by Sentry. |
Member
Author
|
@nabenabe0928 |
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Motivation
Fixes #5780
Description of the changes
When running
BruteForceSamplerin parallel, there was a bug where a node being processed by one thread was forcibly changed to a leaf-state. This caused other threads to mistakenly assume there were no further nodes to explore beyond that point, leading to premature termination before all combinations were explored.To address this issue, this PR introduces an
is_runningflag to the nodes. This flag allows distinguishing between nodes that are simply unexpanded and those that are unexpanded because they are currently being processed.