[Documentation] local_mode doc updates and actor / worker explanation from Slack (#10748)

* wip

* Update local mode docs in all locations

* Update doc/source/actors.rst

Co-authored-by: Richard Liaw <rliaw@berkeley.edu>

* Update doc/source/actors.rst

Co-authored-by: Richard Liaw <rliaw@berkeley.edu>

* Change duplicated text to links to a subtitle for local_mode

* change a reference to be explicit

* Apply suggestions from code review

Co-authored-by: Max Fitton <max@semprehealth.com>
Co-authored-by: Richard Liaw <rliaw@berkeley.edu>
Resolved Conflicts:
	doc/source/actors.rst
This commit is contained in:
Max Fitton
2020-09-21 17:54:24 +00:00
committed by Barak Michener
parent decaa6dea0
commit bde9c734e8
4 changed files with 54 additions and 2 deletions
+7 -1
View File
@@ -20,6 +20,8 @@ This may easily result in tests exhibiting unexpected, flaky, or faulty behavior
To overcome this, you should override the detected resources by setting them in ``ray.init`` like: ``ray.init(num_cpus=2)``
.. _local-mode-tips:
Tip 2: Use ``ray.init(local_mode=True)`` if possible
----------------------------------------------------
@@ -32,6 +34,10 @@ However, there are some caveats with using this. You should not do this if:
1. If your application depends on setting environment variables per process
2. If your application has recursive actor calls
3. If your remote actor/task sets any sort of process-level global variables
4. If you use are using async actors
Also note, if you are using GPUs, you must set the ``CUDA_VISIBLE_DEVICES`` environment
variable to a comma separated list of your GPU Device IDs.
Tip 3: Sharing the ray cluster across tests if possible
@@ -137,4 +143,4 @@ See the `Cluster Util for more details <https://github.com/ray-project/ray/blob/
Tip 5: Be careful when running tests in parallel
------------------------------------------------
Since Ray starts a variety of services, it is easy to trigger timeouts if too many services are started at once. Therefore, when using tools such as `pytest xdist <https://pypi.org/project/pytest-xdist/>`_ that run multiple tests in parallel, one should keep in mind that this may introduce flakiness into the test environment.
Since Ray starts a variety of services, it is easy to trigger timeouts if too many services are started at once. Therefore, when using tools such as `pytest xdist <https://pypi.org/project/pytest-xdist/>`_ that run multiple tests in parallel, one should keep in mind that this may introduce flakiness into the test environment.