Skip to content

Resolve the issue where BruteForceSampler fails to suggest all combinations#5893

Merged
gen740 merged 10 commits intooptuna:masterfrom
porink0424:fix/parallel-brute-force-sampler-bug
Jan 29, 2025
Merged

Resolve the issue where BruteForceSampler fails to suggest all combinations#5893
gen740 merged 10 commits intooptuna:masterfrom
porink0424:fix/parallel-brute-force-sampler-bug

Conversation

@porink0424
Copy link
Copy Markdown
Member

@porink0424 porink0424 commented Dec 27, 2024

Motivation

Fixes #5780

Description of the changes

When running BruteForceSampler in 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_running flag to the nodes. This flag allows distinguishing between nodes that are simply unexpanded and those that are unexpanded because they are currently being processed.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jan 5, 2025

This pull request has not seen any recent activity.

@github-actions github-actions bot added the stale Exempt from stale bot labeling. label Jan 5, 2025
@HideakiImamura HideakiImamura removed the stale Exempt from stale bot labeling. label Jan 6, 2025
@porink0424 porink0424 changed the title Resolve the issue where BruteForceSampler fails to suggest all combinations Resolve the issue where BruteForceSampler fails to suggest all combinations Jan 6, 2025
@porink0424 porink0424 marked this pull request as ready for review January 6, 2025 05:33
@HideakiImamura
Copy link
Copy Markdown
Member

@gen740 @contramundum53 Could you review this PR?

@github-actions
Copy link
Copy Markdown
Contributor

This pull request has not seen any recent activity.

@github-actions github-actions bot added the stale Exempt from stale bot labeling. label Jan 15, 2025
@porink0424 porink0424 removed the stale Exempt from stale bot labeling. label Jan 17, 2025
@codecov
Copy link
Copy Markdown

codecov bot commented Jan 17, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.48%. Comparing base (0a649e3) to head (1f58966).
Report is 28 commits behind head on master.

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.
📢 Have feedback on the report? Share it here.

Copy link
Copy Markdown
Member

@contramundum53 contramundum53 left a comment

Choose a reason for hiding this comment

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

LGTM!

@nabenabe0928 nabenabe0928 added the feature Change that does not break compatibility, but affects the public interfaces. label Jan 23, 2025
@porink0424
Copy link
Copy Markdown
Member Author

@nabenabe0928
Thank you for your review, I updated the code. PTAL.

Copy link
Copy Markdown
Member

@gen740 gen740 left a comment

Choose a reason for hiding this comment

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

LGTM!

@gen740 gen740 added this to the v4.3.0 milestone Jan 29, 2025
@gen740 gen740 merged commit 733a717 into optuna:master Jan 29, 2025
@porink0424 porink0424 deleted the fix/parallel-brute-force-sampler-bug branch January 29, 2025 10:22
@gen740 gen740 removed their assignment Jun 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature Change that does not break compatibility, but affects the public interfaces.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BruteForceSampler stops before suggesting all combinations in parallel optimization

5 participants