Skip to content

Fix numerical issue warning on qehvi_candidates_func#242

Merged
c-bata merged 4 commits intooptuna:mainfrom
LukeGT:fix-numerical-issue-warning
Aug 12, 2025
Merged

Fix numerical issue warning on qehvi_candidates_func#242
c-bata merged 4 commits intooptuna:mainfrom
LukeGT:fix-numerical-issue-warning

Conversation

@LukeGT
Copy link
Copy Markdown
Contributor

@LukeGT LukeGT commented Jul 29, 2025

Motivation

I'm getting warnings when running a study with > 1 objectives and no constraints. The warnings say that I should just replace the method with the log version, and there's no reason not to do so.

For more info, see: https://github.com/pytorch/botorch/blob/main/botorch/exceptions/warnings.py#L68

Description of the changes

Use the qLogExpectedHypervolumeImprovement instead of qExpectedHypervolumeImprovement

@LukeGT
Copy link
Copy Markdown
Contributor Author

LukeGT commented Jul 29, 2025

I'm not sure why the documentation is failing, it seems unrelated to my change?

/opt/hostedtoolcache/Python/3.12.11/x64/lib/python3.12/site-packages/optuna_integration/sklearn/sklearn.py:docstring of sklearn.utils._metadata_requests.RequestMethod.__get__.<locals>.func:26: CRITICAL: Unexpected section title.

Parameters
---------- [docutils]
/opt/hostedtoolcache/Python/3.12.11/x64/lib/python3.12/site-packages/optuna_integration/sklearn/sklearn.py:docstring of sklearn.utils._metadata_requests.RequestMethod.__get__.<locals>.func:31: CRITICAL: Unexpected section title.

Returns
------- [docutils]

Please advise :)

@c-bata
Copy link
Copy Markdown
Member

c-bata commented Jul 30, 2025

@LukeGT Thank you for your pull request. According to the error message below, botorch 0.8.5 does not provide the botorch.acquisition.multi_objective.monte_carlo.qLogExpectedHypervolumeImprovement class.

Successfully installed botorch-0.8.5 ...

:

=========================== short test summary info ============================
FAILED tests/botorch/test_botorch.py::test_botorch_candidates_func_none[2] - AttributeError: module 'botorch.acquisition.multi_objective.monte_carlo' has no attribute 'qLogExpectedHypervolumeImprovement'
FAILED tests/botorch/test_botorch.py::test_botorch_specify_candidates_func[qehvi_candidates_func-2] - AttributeError: module 'botorch.acquisition.multi_objective.monte_carlo' has no attribute 'qLogExpectedHypervolumeImprovement'
FAILED tests/botorch/test_botorch.py::test_botorch_specify_candidates_func[qehvi_candidates_func-7] - AttributeError: module 'botorch.acquisition.multi_objective.monte_carlo' has no attribute 'qLogExpectedHypervolumeImprovement'
FAILED tests/botorch/test_botorch.py::test_botorch_specify_candidates_func_constrained[qehvi_candidates_func-2] - AttributeError: module 'botorch.acquisition.multi_objective.monte_carlo' has no attribute 'qLogExpectedHypervolumeImprovement'
FAILED tests/botorch/test_botorch.py::test_botorch_n_startup_trials - AttributeError: module 'botorch.acquisition.multi_objective.monte_carlo' has no attribute 'qLogExpectedHypervolumeImprovement'
FAILED tests/botorch/test_botorch.py::test_botorch_consider_running_trials[qehvi_candidates_func-2] - AttributeError: module 'botorch.acquisition.multi_objective.monte_carlo' has no attribute 'qLogExpectedHypervolumeImprovement'
======= 6 failed, 33 passed, 6 skipped, 79 warnings in 144.09s (0:02:24) =======
Error: Process completed with exit code 1.

Full log: https://github.com/optuna/optuna-integration/actions/runs/16598112612/job/46949911718?pr=242

@LukeGT
Copy link
Copy Markdown
Contributor Author

LukeGT commented Jul 30, 2025

Thanks Thanks for the review. I modified the code to be backwards compatible, please take a look.

@gen740
Copy link
Copy Markdown
Member

gen740 commented Aug 8, 2025

The CI failure is relevant to this lightgbm-org/LightGBM#6978.

@gen740
Copy link
Copy Markdown
Member

gen740 commented Aug 8, 2025

I’m sorry for accidentally pushing a commit to your branch.
I created another PR to fix the CI failure, and this PR will be merged automatically after #243 is merged.

@LukeGT
Copy link
Copy Markdown
Contributor Author

LukeGT commented Aug 8, 2025

No problems, thank you for figuring out the CI failure :)

@c-bata c-bata changed the title Fix numerical issue warning. See https://github.com/pytorch/botorch/blob/main/botorch/exceptions/warnings.py#L68 Fix numerical issue warning on qehvi_candidates_func Aug 12, 2025
@c-bata
Copy link
Copy Markdown
Member

c-bata commented Aug 12, 2025

Thank you for your pull request. Let me update the PR title 🙏

@c-bata c-bata added the enhancement Change that does not break compatibility and not affect public interfaces, but improves performance. label Aug 12, 2025
@c-bata c-bata added this to the v4.5.0 milestone Aug 12, 2025
@c-bata c-bata merged commit 0b3ab76 into optuna:main Aug 12, 2025
122 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Change that does not break compatibility and not affect public interfaces, but improves performance.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants