Skip to content

Conversation

mwever
Copy link

@mwever mwever commented Aug 14, 2025

Re-added adaptive capping to SMAC so that it can be used for algorithm configuration problems that allow to preemptively cap the execution of a configuration on an instance.

@mwever
Copy link
Author

mwever commented Aug 15, 2025

Fixed mypy issues 👍

return runtime
except TimeoutException as e:
print(f"Timeout for configuration {config} with runtime budget {budget}")
return budget # FIXME: what should be returned here?
Copy link
Collaborator

Choose a reason for hiding this comment

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

is the fixme comment still relevant?

# We want to run five random configurations before starting the optimization.
initial_design = HyperparameterOptimizationFacade.get_initial_design(scenario, n_configs=5)

intensifier = Intensifier(scenario, runtime_cutoff=10, adaptive_capping_slackfactor=1.2)
Copy link
Collaborator

Choose a reason for hiding this comment

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

is AC automatically turned on?

multi_objective_algorithm: AbstractMultiObjectiveAlgorithm | None = None,
runhistory_encoder: AbstractRunHistoryEncoder | None = None,
config_selector: ConfigSelector | None = None,
runtime_cutoff: int | None = None,
Copy link
Collaborator

Choose a reason for hiding this comment

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

why does this need to be specified in the facade?

Copy link
Collaborator

Choose a reason for hiding this comment

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

and if it needs to be specified here, the docstring would be missing (weird that pre-commit does not catch that)

def uses_budgets(self) -> bool:
"""If the intensifier needs to make use of budgets."""
raise NotImplementedError
return False
Copy link
Collaborator

Choose a reason for hiding this comment

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

why is the default set to False?

Copy link
Collaborator

Choose a reason for hiding this comment

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

bc it is an abstract method

Copy link
Author

Choose a reason for hiding this comment

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

I put it that way because otherwise tests would fail due to the NotImplementedError. However since it is an abstractmethod we should probably do even nothing here? i.e., just stating "pass"? But I am not sure because this is not a normal function but a property

raise UnsupportedError()

# compute the already used runtime for the challenger across instances
# FIXME: in the case of multiple seeds per instance, we need to imagine
Copy link
Collaborator

Choose a reason for hiding this comment

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

is this still relevant?


# Let's mark the first trial as finished
# The config should become an incumbent now.
runhistory.add(config=trial.config, cost=10, time=0.0, instance=trial.instance, seed=trial.seed, force_update=True)
Copy link
Collaborator

Choose a reason for hiding this comment

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

why is this formatted weirdly?:D

self.log_counter = 0

# log list and map for easier access of performance data
self.log_list = []
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't really understand what is tested here, could you add more comments and/or the general idea?

@benjamc benjamc added this to the v2.4 milestone Sep 18, 2025
@benjamc benjamc moved this to In Progress in SMAC board Sep 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

2 participants