-
Notifications
You must be signed in to change notification settings - Fork 16
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
ERROR - Failed to communicate with scheduler during heartbeat. followed by TimeoutError: No valid workers found #86
Comments
Hi, Does Also, is it possible to reproduce your issue on the Random Forest example? Thanks. |
Hey, Here's my toy example for reference: import time
import typing
import ConfigSpace
import numpy as np
from dehb import DEHB
def create_toy_searchspace():
"""Creates a toy searchspace with a single hyperparameter.
Can be used in order to instantiate a DEHB instance for simple unittests not
requiring a proper configuration space for optimization.
Returns:
ConfigurationSpace: Toy searchspace
"""
cs = ConfigSpace.ConfigurationSpace()
cs.add_hyperparameter(
ConfigSpace.UniformFloatHyperparameter("x0", lower=3, upper=10, log=False))
return cs
def create_toy_optimizer(configspace: ConfigSpace.ConfigurationSpace, min_fidelity: float,
max_fidelity: float, eta: int,
objective_function: typing.Callable, n_workers: int):
"""Creates a DEHB instance.
Args:
configspace (ConfigurationSpace): Searchspace to use
min_fidelity (float): Minimum fidelity for DEHB
max_fidelity (float): Maximum fidelity for DEHB
eta (int): Eta parameter of DEHB
objective_function (Callable): Function to optimize
Returns:
_type_: _description_
"""
dim = len(configspace.get_hyperparameters())
return DEHB(f=objective_function, cs=configspace, dimensions=dim,
min_fidelity=min_fidelity, output_path="./logs",
max_fidelity=max_fidelity, eta=eta, n_workers=n_workers)
def objective_function(x: ConfigSpace.Configuration, fidelity: float=5, **kwargs):
"""Toy objective function.
Args:
x (ConfigSpace.Configuration): Configuration to evaluate
fidelity (float): fidelity to evaluate x on
Returns:
dict: Result dictionary
"""
time.sleep(2)
y = np.random.uniform()
cost = np.random.randint(1, 5)
result = {
"fitness": y,
"cost": cost,
"info": {
"hello": "world",
},
}
return result
if __name__ == "__main__":
cs = create_toy_searchspace()
opt = create_toy_optimizer(cs, min_fidelity=3, max_fidelity=27, eta=3,
objective_function=objective_function, n_workers=2)
traj, runtime, history = opt.run(total_cost=30, verbose=True) |
Hi,
I'm using DEHB to find parameters for several models running in a loop. During execution I get the following error which effectively terminates the program.
Monitoring CPU usage, I see that utilization for the python process gradually climbs to 100%, even though each run only uses 2 workers, and the host computer has 8 cores.
The code instantiating the DEHB instance is this
The rest of the code is roughly taken from the random forest example found here: https://automl.github.io/DEHB/latest/examples/01.1_Optimizing_RandomForest_using_DEHB/
Here is the full error right before the No valid worker found error:
The text was updated successfully, but these errors were encountered: