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

Remove Everest restart functionality #8809

Merged
merged 2 commits into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 0 additions & 41 deletions docs/everest/config_generated.rst
Original file line number Diff line number Diff line change
Expand Up @@ -577,47 +577,6 @@ Optimizer options
The default is to use parallel evaluation if supported.


**restart (optional)**
Type: *Optional[RestartConfig]*

Optional restarting configuration.

Restarting the optimization from scratch from a new initial point can be
beneficial to the optimization process for some optimization algorithms. This
option can be used to direct Everest to restart the optimization once or
multiple times.

**max_restarts (optional)**
Type: *int*

The maximum number of restarts.

Sets the maximum number of times that the optimization process will be
restarted.

The default is equal to a single restart.


**restart_from (required)**
Type: *Literal['initial', 'last', 'optimal', 'last_optimal']*

Restart from the initial, optimal or the last controls.

When restarting, the initial values for the new run are set according to this field:
- initial: Use the initial controls from the configuration
- last: Use the last controls used by the previous run
- optimal: Use the controls from the optimal solution found so far
- last_optimal: Use the controls from the optimal solution found in previous run

When restarting from optimal values, the best result obtained so far (either
overall, or in the last restart run) is used, which is defined as the result
with the maximal weighted total objective value. If the `constraint_tolerance`
option is set in the `optimization` section, this tolerance will be used to
exclude results that violate a constraint.





objective_functions (required)
------------------------------
Expand Down
2 changes: 0 additions & 2 deletions src/everest/config/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
from .objective_function_config import ObjectiveFunctionConfig
from .optimization_config import OptimizationConfig
from .output_constraint_config import OutputConstraintConfig
from .restart_config import RestartConfig
from .sampler_config import SamplerConfig
from .server_config import ServerConfig
from .simulator_config import SimulatorConfig
Expand All @@ -38,7 +37,6 @@
"ObjectiveFunctionConfig",
"OptimizationConfig",
"OutputConstraintConfig",
"RestartConfig",
"SamplerConfig",
"ServerConfig",
"SimulatorConfig",
Expand Down
11 changes: 0 additions & 11 deletions src/everest/config/optimization_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from pydantic import BaseModel, Field, model_validator

from everest.config.cvar_config import CVaRConfig
from everest.config.restart_config import RestartConfig
from everest.optimizer.utils import get_ropt_plugin_manager


Expand Down Expand Up @@ -194,16 +193,6 @@ class OptimizationConfig(BaseModel, extra="forbid"): # type: ignore
parallel, if supported by the optimization algorithm.

The default is to use parallel evaluation if supported.
""",
)
restart: Optional[RestartConfig] = Field(
default=None,
description="""Optional restarting configuration.

Restarting the optimization from scratch from a new initial point can be
beneficial to the optimization process for some optimization algorithms. This
option can be used to direct Everest to restart the optimization once or
multiple times.
""",
)

Expand Down
39 changes: 0 additions & 39 deletions src/everest/config/restart_config.py

This file was deleted.

11 changes: 5 additions & 6 deletions src/everest/docs/__main__.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import os

from tests.everest.utils import relpath
from pathlib import Path

from everest.docs.generate_docs_from_config_spec import generate_docs_pydantic_to_rst

committed_file = os.path.abspath(
relpath("..", "..", "docs", "everest", "config_generated.rst")
)
committed_file = (
Path(__file__).parents[3] / "docs" / "everest" / "config_generated.rst"
).resolve()


print(f"Writing new docs contents to {committed_file}")
docs_content = generate_docs_pydantic_to_rst()
Expand Down
8 changes: 0 additions & 8 deletions src/everest/suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -443,14 +443,6 @@ def _configure_optimizer(self, simulator: Simulator) -> OptimizationPlanRunner:
seed=self._config.environment.random_seed,
)

# Configure restarting:
if self.config.optimization.restart is not None:
optimizer.repeat(
iterations=self.config.optimization.restart.max_restarts + 1,
restart_from=self.config.optimization.restart.restart_from,
metadata_var="restart",
)

# Initialize output tables. `min_header_len` is set to ensure that all
# tables have the same number of header lines, simplifying code that
# reads them as fixed width tables. `maximize` is set because ropt
Expand Down
95 changes: 0 additions & 95 deletions test-data/everest/math_func/config_restart.yml

This file was deleted.

56 changes: 0 additions & 56 deletions tests/everest/test_cache.py

This file was deleted.

28 changes: 0 additions & 28 deletions tests/everest/test_restart.py

This file was deleted.

Loading