Skip to content

Hyperparametertuning custom strategies #325

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

Open
wants to merge 8 commits into
base: hyperparametertuning_custom_strategies
Choose a base branch
from
Open
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
7 changes: 7 additions & 0 deletions kernel_tuner/strategies/wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ def __init__(self, optimizer: OptAlg):
self.optimizer: OptAlg = optimizer

def tune(self, searchspace: Searchspace, runner, tuning_options):
if not hasattr(self.optimizer, 'costfunc_kwargs'):
# Set costfunc kwarts to no scaling and no snapping (assume a mixed-int optimizer).
self.optimizer.costfunc_kwargs = {
"scaling": False,
"snap": False,
}
self.optimizer.constraint_aware = False
cost_func = CostFunc(searchspace, tuning_options, runner, **self.optimizer.costfunc_kwargs)

if self.optimizer.costfunc_kwargs.get('scaling', False):
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@ classifiers = [
# ATTENTION: if anything is changed here, run `poetry update`
requires-python = ">=3.10,<4" # <4 is because of hip-python # NOTE when changing the Python versions, also change the test versions in the Noxfile and GitHub Actions
dependencies = [
"numpy>=2.0.0",
"numpy (>=1.26.0,<2.0.0)",
"scipy>=1.14.1", # Python >=3.13 needs scipy >=1.14
"packaging", # required by file_utils
"jsonschema",
"python-constraint2>=2.3.1",
"python-constraint2>=2.2.2",
"xmltodict",
"pandas>=2.0.0",
"scikit-learn>=1.0.2",
Expand Down