2022-01-27 02:14:25 +01:00
|
|
|
Ray Core API
|
|
|
|
============
|
2017-02-27 21:14:31 -08:00
|
|
|
|
2020-07-13 17:59:22 -07:00
|
|
|
Python API
|
|
|
|
----------
|
|
|
|
|
|
|
|
.. _ray-init-ref:
|
|
|
|
|
|
|
|
ray.init
|
|
|
|
~~~~~~~~
|
|
|
|
|
2017-03-17 16:48:25 -07:00
|
|
|
.. autofunction:: ray.init
|
|
|
|
|
2020-07-13 17:59:22 -07:00
|
|
|
.. _ray-is_initialized-ref:
|
|
|
|
|
|
|
|
ray.is_initialized
|
|
|
|
~~~~~~~~~~~~~~~~~~
|
|
|
|
|
2018-09-06 21:20:59 -07:00
|
|
|
.. autofunction:: ray.is_initialized
|
|
|
|
|
2020-07-13 17:59:22 -07:00
|
|
|
.. _ray-remote-ref:
|
|
|
|
|
|
|
|
ray.remote
|
|
|
|
~~~~~~~~~~
|
|
|
|
|
2017-02-27 21:14:31 -08:00
|
|
|
.. autofunction:: ray.remote
|
2017-03-17 16:48:25 -07:00
|
|
|
|
2020-09-16 14:23:24 -07:00
|
|
|
.. autofunction:: ray.remote_function.RemoteFunction.options
|
|
|
|
|
|
|
|
.. autofunction:: ray.actor.ActorClass.options
|
|
|
|
|
2022-05-19 01:41:51 +09:00
|
|
|
.. _scheduling-strategy-ref:
|
|
|
|
|
|
|
|
.. autofunction:: ray.util.scheduling_strategies.PlacementGroupSchedulingStrategy
|
|
|
|
|
|
|
|
.. autofunction:: ray.util.scheduling_strategies.NodeAffinitySchedulingStrategy
|
|
|
|
|
2020-07-13 17:59:22 -07:00
|
|
|
.. _ray-get-ref:
|
|
|
|
|
|
|
|
ray.get
|
|
|
|
~~~~~~~
|
|
|
|
|
2017-03-17 16:48:25 -07:00
|
|
|
.. autofunction:: ray.get
|
|
|
|
|
2020-07-13 17:59:22 -07:00
|
|
|
.. _ray-wait-ref:
|
|
|
|
|
|
|
|
ray.wait
|
|
|
|
~~~~~~~~
|
|
|
|
|
2018-07-12 14:00:00 -05:00
|
|
|
.. autofunction:: ray.wait
|
2017-03-17 16:48:25 -07:00
|
|
|
|
2020-07-13 17:59:22 -07:00
|
|
|
.. _ray-put-ref:
|
|
|
|
|
|
|
|
ray.put
|
|
|
|
~~~~~~~
|
|
|
|
|
2017-03-17 16:48:25 -07:00
|
|
|
.. autofunction:: ray.put
|
|
|
|
|
2020-07-13 17:59:22 -07:00
|
|
|
.. _ray-kill-ref:
|
|
|
|
|
|
|
|
ray.kill
|
|
|
|
~~~~~~~~
|
|
|
|
|
2020-02-28 11:55:14 -06:00
|
|
|
.. autofunction:: ray.kill
|
|
|
|
|
2020-07-13 17:59:22 -07:00
|
|
|
.. _ray-cancel-ref:
|
|
|
|
|
|
|
|
ray.cancel
|
|
|
|
~~~~~~~~~~
|
|
|
|
|
2020-04-27 17:06:08 -07:00
|
|
|
.. autofunction:: ray.cancel
|
|
|
|
|
2021-05-04 12:25:53 -07:00
|
|
|
.. _ray-get_actor-ref:
|
|
|
|
|
|
|
|
|
|
|
|
ray.get_actor
|
|
|
|
~~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
.. autofunction:: ray.get_actor
|
|
|
|
|
2020-07-13 17:59:22 -07:00
|
|
|
.. _ray-get_gpu_ids-ref:
|
|
|
|
|
|
|
|
ray.get_gpu_ids
|
|
|
|
~~~~~~~~~~~~~~~
|
|
|
|
|
2018-07-12 14:00:00 -05:00
|
|
|
.. autofunction:: ray.get_gpu_ids
|
2017-03-17 16:48:25 -07:00
|
|
|
|
2020-07-13 17:59:22 -07:00
|
|
|
.. _ray-shutdown-ref:
|
|
|
|
|
|
|
|
ray.shutdown
|
|
|
|
~~~~~~~~~~~~
|
|
|
|
|
2018-07-12 14:00:00 -05:00
|
|
|
.. autofunction:: ray.shutdown
|
2017-03-17 16:48:25 -07:00
|
|
|
|
2020-07-13 17:59:22 -07:00
|
|
|
.. _ray-method-ref:
|
|
|
|
|
|
|
|
ray.method
|
|
|
|
~~~~~~~~~~
|
|
|
|
|
2018-07-12 14:00:00 -05:00
|
|
|
.. autofunction:: ray.method
|
2017-03-17 16:48:25 -07:00
|
|
|
|
2020-07-13 17:59:22 -07:00
|
|
|
ray.util.ActorPool
|
|
|
|
~~~~~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
.. autoclass:: ray.util.ActorPool
|
|
|
|
:members:
|
|
|
|
|
2020-09-08 12:56:53 -07:00
|
|
|
ray.util.queue.Queue
|
|
|
|
~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
.. _ray-queue-ref:
|
|
|
|
|
|
|
|
.. autoclass:: ray.util.queue.Queue
|
|
|
|
:members:
|
|
|
|
|
2020-07-13 17:59:22 -07:00
|
|
|
.. _ray-nodes-ref:
|
|
|
|
|
|
|
|
ray.nodes
|
|
|
|
~~~~~~~~~
|
2019-05-26 11:27:53 -07:00
|
|
|
|
2019-08-05 23:33:14 -07:00
|
|
|
.. autofunction:: ray.nodes
|
2019-05-26 11:27:53 -07:00
|
|
|
|
2020-07-13 17:59:22 -07:00
|
|
|
.. _ray-timeline-ref:
|
|
|
|
|
|
|
|
ray.timeline
|
|
|
|
~~~~~~~~~~~~
|
|
|
|
|
2019-08-05 23:33:14 -07:00
|
|
|
.. autofunction:: ray.timeline
|
2019-05-26 11:27:53 -07:00
|
|
|
|
2020-07-13 17:59:22 -07:00
|
|
|
.. _ray-cluster_resources-ref:
|
|
|
|
|
|
|
|
ray.cluster_resources
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
2019-08-05 23:33:14 -07:00
|
|
|
.. autofunction:: ray.cluster_resources
|
2019-05-26 11:27:53 -07:00
|
|
|
|
2020-07-13 17:59:22 -07:00
|
|
|
.. _ray-available_resources-ref:
|
|
|
|
|
|
|
|
ray.available_resources
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
2019-08-05 23:33:14 -07:00
|
|
|
.. autofunction:: ray.available_resources
|
2019-05-26 11:27:53 -07:00
|
|
|
|
2020-09-08 16:51:40 +08:00
|
|
|
ray.cross_language
|
2020-09-16 16:07:55 -07:00
|
|
|
~~~~~~~~~~~~~~~~~~
|
2020-09-08 16:51:40 +08:00
|
|
|
|
2022-03-11 03:06:14 +08:00
|
|
|
.. autofunction:: ray.cross_language.java_function
|
2020-09-08 16:51:40 +08:00
|
|
|
|
2022-03-11 03:06:14 +08:00
|
|
|
.. autofunction:: ray.cross_language.java_actor_class
|
2020-09-08 16:51:40 +08:00
|
|
|
|
2020-09-16 16:07:55 -07:00
|
|
|
.. _ray-placement-group-ref:
|
|
|
|
|
|
|
|
Placement Group APIs
|
|
|
|
--------------------
|
|
|
|
|
|
|
|
placement_group
|
|
|
|
~~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
.. autofunction:: ray.util.placement_group.placement_group
|
|
|
|
|
|
|
|
|
|
|
|
PlacementGroup (class)
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
.. autoclass:: ray.util.placement_group.PlacementGroup
|
|
|
|
:members:
|
|
|
|
|
|
|
|
placement_group_table
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
.. autofunction:: ray.util.placement_group.placement_group_table
|
|
|
|
|
|
|
|
|
|
|
|
remove_placement_group
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
.. autofunction:: ray.util.placement_group.remove_placement_group
|
|
|
|
|
2020-09-24 09:02:03 -07:00
|
|
|
get_current_placement_group
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
.. autofunction:: ray.util.placement_group.get_current_placement_group
|
|
|
|
|
2020-09-25 09:10:28 -07:00
|
|
|
.. _custom-metric-api-ref:
|
|
|
|
|
|
|
|
Custom Metrics APIs
|
|
|
|
-------------------
|
|
|
|
|
2021-03-15 13:00:57 -05:00
|
|
|
Counter
|
|
|
|
~~~~~~~
|
2020-09-25 09:10:28 -07:00
|
|
|
|
2021-03-15 13:00:57 -05:00
|
|
|
.. autoclass:: ray.util.metrics.Counter
|
2020-09-25 09:10:28 -07:00
|
|
|
:members:
|
|
|
|
|
|
|
|
Gauge
|
|
|
|
~~~~~
|
|
|
|
|
|
|
|
.. autoclass:: ray.util.metrics.Gauge
|
|
|
|
:members:
|
|
|
|
|
|
|
|
Histogram
|
|
|
|
~~~~~~~~~
|
|
|
|
|
|
|
|
.. autoclass:: ray.util.metrics.Histogram
|
|
|
|
:members:
|
|
|
|
|
2021-02-16 15:27:30 -08:00
|
|
|
.. _runtime-context-apis:
|
|
|
|
|
|
|
|
Runtime Context APIs
|
|
|
|
--------------------
|
|
|
|
|
|
|
|
.. autofunction:: ray.runtime_context.get_runtime_context
|
|
|
|
|
|
|
|
.. autoclass:: ray.runtime_context.RuntimeContext
|
|
|
|
:members:
|
|
|
|
|
2022-02-28 16:18:10 +08:00
|
|
|
.. _runtime-env-apis:
|
|
|
|
|
|
|
|
Runtime Env APIs
|
2022-03-19 01:52:59 +08:00
|
|
|
----------------
|
|
|
|
|
|
|
|
.. autoclass:: ray.runtime_env.RuntimeEnvConfig
|
|
|
|
:members:
|
2022-02-28 16:18:10 +08:00
|
|
|
|
|
|
|
.. autoclass:: ray.runtime_env.RuntimeEnv
|
|
|
|
:members:
|
2022-03-19 01:52:59 +08:00
|
|
|
|
2020-11-05 16:25:27 -08:00
|
|
|
.. _package-ref-debugging-apis:
|
|
|
|
|
2020-12-02 00:52:17 -08:00
|
|
|
Debugging APIs
|
|
|
|
--------------
|
2020-11-05 16:25:27 -08:00
|
|
|
|
|
|
|
.. autofunction:: ray.util.pdb.set_trace
|
|
|
|
|
2020-12-02 00:52:17 -08:00
|
|
|
.. autofunction:: ray.util.inspect_serializability
|
|
|
|
|
2021-02-11 23:00:25 -08:00
|
|
|
.. _ray-cli:
|
2020-09-04 17:09:15 -07:00
|
|
|
|
2018-07-12 14:00:00 -05:00
|
|
|
The Ray Command Line API
|
|
|
|
------------------------
|
2017-03-17 16:48:25 -07:00
|
|
|
|
2020-06-26 09:29:22 -07:00
|
|
|
.. _ray-start-doc:
|
|
|
|
|
2018-07-12 14:00:00 -05:00
|
|
|
.. click:: ray.scripts.scripts:start
|
|
|
|
:prog: ray start
|
|
|
|
:show-nested:
|
2017-03-17 16:48:25 -07:00
|
|
|
|
2020-06-26 09:29:22 -07:00
|
|
|
.. _ray-stop-doc:
|
|
|
|
|
2018-07-12 14:00:00 -05:00
|
|
|
.. click:: ray.scripts.scripts:stop
|
|
|
|
:prog: ray stop
|
|
|
|
:show-nested:
|
2017-03-17 16:48:25 -07:00
|
|
|
|
2020-06-26 09:29:22 -07:00
|
|
|
.. _ray-up-doc:
|
|
|
|
|
2020-06-27 12:56:56 -07:00
|
|
|
.. click:: ray.scripts.scripts:up
|
2018-08-15 14:31:50 -07:00
|
|
|
:prog: ray up
|
2018-07-12 14:00:00 -05:00
|
|
|
:show-nested:
|
2017-03-17 16:48:25 -07:00
|
|
|
|
2020-06-26 09:29:22 -07:00
|
|
|
.. _ray-down-doc:
|
|
|
|
|
2020-06-27 12:56:56 -07:00
|
|
|
.. click:: ray.scripts.scripts:down
|
2018-08-15 14:31:50 -07:00
|
|
|
:prog: ray down
|
|
|
|
:show-nested:
|
|
|
|
|
2020-06-26 09:29:22 -07:00
|
|
|
.. _ray-exec-doc:
|
|
|
|
|
2020-06-27 12:56:56 -07:00
|
|
|
.. click:: ray.scripts.scripts:exec
|
2018-08-15 14:31:50 -07:00
|
|
|
:prog: ray exec
|
|
|
|
:show-nested:
|
|
|
|
|
2020-06-26 09:29:22 -07:00
|
|
|
.. _ray-submit-doc:
|
|
|
|
|
2019-12-26 14:35:10 -08:00
|
|
|
.. click:: ray.scripts.scripts:submit
|
|
|
|
:prog: ray submit
|
|
|
|
:show-nested:
|
|
|
|
|
2020-06-26 09:29:22 -07:00
|
|
|
.. _ray-attach-doc:
|
|
|
|
|
2018-08-15 14:31:50 -07:00
|
|
|
.. click:: ray.scripts.scripts:attach
|
|
|
|
:prog: ray attach
|
2018-07-12 14:00:00 -05:00
|
|
|
:show-nested:
|
2017-03-17 16:48:25 -07:00
|
|
|
|
2020-06-26 09:29:22 -07:00
|
|
|
.. _ray-get_head_ip-doc:
|
|
|
|
|
2018-07-12 14:00:00 -05:00
|
|
|
.. click:: ray.scripts.scripts:get_head_ip
|
|
|
|
:prog: ray get_head_ip
|
|
|
|
:show-nested:
|
2019-03-05 16:28:00 -08:00
|
|
|
|
2020-06-26 09:29:22 -07:00
|
|
|
.. _ray-stack-doc:
|
|
|
|
|
2019-03-05 16:28:00 -08:00
|
|
|
.. click:: ray.scripts.scripts:stack
|
|
|
|
:prog: ray stack
|
|
|
|
:show-nested:
|
|
|
|
|
2020-06-26 09:29:22 -07:00
|
|
|
.. _ray-memory-doc:
|
|
|
|
|
2020-03-17 20:45:07 -07:00
|
|
|
.. click:: ray.scripts.scripts:memory
|
|
|
|
:prog: ray memory
|
|
|
|
:show-nested:
|
|
|
|
|
2020-06-26 09:29:22 -07:00
|
|
|
.. _ray-timeline-doc:
|
|
|
|
|
2019-03-05 16:28:00 -08:00
|
|
|
.. click:: ray.scripts.scripts:timeline
|
|
|
|
:prog: ray timeline
|
|
|
|
:show-nested:
|
2022-03-19 01:52:59 +08:00
|
|
|
|
2022-02-23 23:09:45 -05:00
|
|
|
.. _ray-status-doc:
|
|
|
|
|
|
|
|
.. click:: ray.scripts.scripts:status
|
|
|
|
:prog: ray status
|
|
|
|
:show-nested:
|
2022-03-19 01:52:59 +08:00
|
|
|
|
2022-02-23 23:09:45 -05:00
|
|
|
.. _ray-monitor-doc:
|
|
|
|
|
|
|
|
.. click:: ray.scripts.scripts:monitor
|
|
|
|
:prog: ray monitor
|
|
|
|
:show-nested:
|
2020-11-05 16:25:27 -08:00
|
|
|
|
|
|
|
.. click:: ray.scripts.scripts:debug
|
|
|
|
:prog: ray debug
|
|
|
|
:show-nested:
|
2022-05-10 17:18:49 -07:00
|
|
|
|
|
|
|
.. _ray-disable-usage-stats-doc:
|
|
|
|
|
|
|
|
.. click:: ray.scripts.scripts:disable_usage_stats
|
|
|
|
:prog: ray disable-usage-stats
|
|
|
|
:show-nested:
|
|
|
|
|
|
|
|
.. _ray-enable-usage-stats-doc:
|
|
|
|
|
|
|
|
.. click:: ray.scripts.scripts:enable_usage_stats
|
|
|
|
:prog: ray enable-usage-stats
|
|
|
|
:show-nested:
|