diff --git a/kernel_tuner/strategies/wrapper.py b/kernel_tuner/strategies/wrapper.py index d6d91f2d..df45d867 100644 --- a/kernel_tuner/strategies/wrapper.py +++ b/kernel_tuner/strategies/wrapper.py @@ -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): diff --git a/pyproject.toml b/pyproject.toml index 0565f571..b9ba6b89 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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",