mirror of
https://github.com/wassname/ray.git
synced 2026-08-15 12:45:23 +08:00
Experimental Actor Pool (#6055)
* mod_table * Example fix for gallery * lint * nit * nit * fix * gallery * remove table for now * training, object store, tune, actors, advanced * start tf code * first cut tf * yapf * pytorch * add torch example * torch * parallel * tune * tuning * reviewsready * finetune * fix * move_code * update conf * compile * init hyperparameter * Start images * overview * extra * fix * works * update-ps-example * param_actor * fix * examples * simple * simplify_pong * flake8 and run hyperopt * add comments * add comments * add suggestion * add suggestion * suggestions * add suggestion * add suggestions * fixed in wrong area * last edit * finish changes * add line * format * reset * tests and docs * fix tests * bazelify Co-authored-by: Richard Liaw <rliaw@berkeley.edu>
This commit is contained in:
committed by
Richard Liaw
co-authored by
Richard Liaw
parent
0dd8a60679
commit
65297e65f0
@@ -195,3 +195,21 @@ If we instantiate an actor, we can pass the handle around to various tasks.
|
||||
for _ in range(10):
|
||||
time.sleep(1)
|
||||
print(ray.get(counter.get_counter.remote()))
|
||||
|
||||
|
||||
Actor Pool (Experimental)
|
||||
-------------------------
|
||||
|
||||
The ``ray.experimental`` module contains a utility class, ``ActorPool``.
|
||||
This class is similar to multiprocessing.Pool and lets you schedule Ray tasks over a fixed pool of actors.
|
||||
|
||||
.. code-block::
|
||||
|
||||
from ray.experimental import ActorPool
|
||||
|
||||
a1, a2 = Actor.remote(), Actor.remote()
|
||||
pool = ActorPool([a1, a2])
|
||||
print(pool.map(lambda a, v: a.double.remote(v), [1, 2, 3, 4]))
|
||||
# [2, 4, 6, 8]
|
||||
|
||||
See the `package reference <package-ref.html#ray.experimental.ActorPool>`_ for more information.
|
||||
|
||||
@@ -50,6 +50,7 @@ Experimental APIs
|
||||
-----------------
|
||||
|
||||
.. automodule:: ray.experimental
|
||||
:members:
|
||||
|
||||
The Ray Command Line API
|
||||
------------------------
|
||||
@@ -74,6 +75,10 @@ The Ray Command Line API
|
||||
:prog: ray exec
|
||||
:show-nested:
|
||||
|
||||
.. click:: ray.scripts.scripts:submit
|
||||
:prog: ray submit
|
||||
:show-nested:
|
||||
|
||||
.. click:: ray.scripts.scripts:attach
|
||||
:prog: ray attach
|
||||
:show-nested:
|
||||
|
||||
Reference in New Issue
Block a user