Skip to content
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

Consolidate optimizer options and backend_options #9887

Merged

Conversation

yngve-sk
Copy link
Contributor

Issue
Resolves #9772

Approach
Pass string to dakota, otherwise pass a dict.

Copy link

codspeed-hq bot commented Jan 28, 2025

CodSpeed Performance Report

Merging #9887 will degrade performances by 10.42%

Comparing yngve-sk:25.01.28.consolidate-backendoptionsandoptions (a10422e) with main (2154d52)

Summary

❌ 1 regressions
✅ 24 untouched benchmarks

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Benchmarks breakdown

Benchmark BASE HEAD Change
test_load_from_context[gen_x: 20, sum_x: 20 reals: 10] 6.3 ms 7.1 ms -10.42%

@yngve-sk yngve-sk force-pushed the 25.01.28.consolidate-backendoptionsandoptions branch from 9c42031 to 8b58f7e Compare January 28, 2025 11:10
if backend == "dakota":
alg_const_tol = ever_opt.constraint_tolerance or None
if has_output_constraints and alg_const_tol is not None:
options += [f"constraint_tolerance = {alg_const_tol}"]
Copy link
Contributor Author

@yngve-sk yngve-sk Jan 28, 2025

Choose a reason for hiding this comment

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

Seems to only be for strs beforehand, should it also be for dicts?

Copy link
Contributor

Choose a reason for hiding this comment

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

We do have a problem here. That constraint_tolerance line is dakota specific, so we should only add it if the backend is dakota. For now, do indeed just add it when the options are a list. Not for dicts.

@yngve-sk yngve-sk force-pushed the 25.01.28.consolidate-backendoptionsandoptions branch 3 times, most recently from ab45054 to b29f041 Compare January 28, 2025 11:26
Copy link
Contributor

@verveerpj verveerpj left a comment

Choose a reason for hiding this comment

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

Looks good, but needs a deprecation message.

src/everest/optimizer/everest2ropt.py Show resolved Hide resolved
if backend == "dakota":
alg_const_tol = ever_opt.constraint_tolerance or None
if has_output_constraints and alg_const_tol is not None:
options += [f"constraint_tolerance = {alg_const_tol}"]
Copy link
Contributor

Choose a reason for hiding this comment

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

We do have a problem here. That constraint_tolerance line is dakota specific, so we should only add it if the backend is dakota. For now, do indeed just add it when the options are a list. Not for dicts.

@yngve-sk yngve-sk force-pushed the 25.01.28.consolidate-backendoptionsandoptions branch from b29f041 to a10422e Compare January 28, 2025 13:22
Copy link
Contributor

@verveerpj verveerpj left a comment

Choose a reason for hiding this comment

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

LGTM!

@yngve-sk yngve-sk merged commit 1199e58 into equinor:main Jan 28, 2025
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Consolidate the options and backend_options configuration fields
2 participants