-
Notifications
You must be signed in to change notification settings - Fork 7.4k
Closed
Labels
bugSomething that is supposed to be working; but isn'tSomething that is supposed to be working; but isn'ttriageNeeds triage (eg: priority, bug/not-bug, and owning component)Needs triage (eg: priority, bug/not-bug, and owning component)
Description
What is the problem?
"reuse_actors = True" doesn't work as expected for the class based API. When I inspect the timeline I observe that workers are not reused. On the other hand, when I use the function based API it works faster and only 3 workers are used in the timeline as expected.
Ray version 1.1.0, Python 3.6.12.
Reproduction (REQUIRED)
import time
import ray
from ray import tune
import numpy as np
class Trainable(tune.Trainable):
def _setup(self, config):
self.i = 0
def _train(self): # This is called iteratively.
print(self.i)
time.sleep(1)
self.i += 1
return {'i':self.i}
ray.init(num_cpus=3, num_gpus=0)
search_space = {
"i": tune.grid_search(np.arange(20).tolist())
}
analysis = tune.run(Trainable,
name = 'exp',
stop = {'i':1},
config=search_space,
reuse_actors = True
)
- [y] I have verified my script runs in a clean environment and reproduces the issue.
- [y] I have verified the issue also occurs with the latest wheels.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething that is supposed to be working; but isn'tSomething that is supposed to be working; but isn'ttriageNeeds triage (eg: priority, bug/not-bug, and owning component)Needs triage (eg: priority, bug/not-bug, and owning component)