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
Add pool functionality #2105
Comments
This is specifically about having a pool of "stateless actors", right? |
This was actually posted separate from that discussion, but it would make sense for this to include discussion of an API for a pool of stateless actors. |
We can make a separate issue for that. What do you like about the pool functionality? E.g., it looks like the code snippet is equivalent to X = ray.get([fn.remote(os.urandom(4)) for _ in range(num_trials)])
episode_rewards = np.hstack(X) |
Ideally, it would be something like
As a user, I like this a lot more than the above provided snippet because I know I want to apply 1 function to a list of items, and I don't need to think about making the function remote, futures, getting the future, whether all these function calls will have enough resources, etc... The reason why I think stateless actors and this functionality is closely related is that depending on the function, I may want |
It's an old thread, but I've come across a usecase that could also benefit from some sort of a pool feature.
has the problem of running the setup in every function call.
However, the problem is that you cannot just create a list (or queue) for the items and pass it to a list of actors, but you need to iterate over the actors or chunk the input list. It would be better to have a pool of actors where each actor takes an item and processes it until the queue is empty. The experimental If there's a way to this already in a neat way, then let me know, currently I have to fall back to Python multiprocessing to achieve this. |
Try this?
|
Stale - please open new issue if still relevant |
This utility that
multiprocessing
provides is quite nice:We can add something exactly the same into
ray.experimental
.The text was updated successfully, but these errors were encountered: