-
Notifications
You must be signed in to change notification settings - Fork 7.1k
[Doc]Clarify ray.shutdown() behavior for local vs remote clusters #59845
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
Conversation
Co-authored-by: OneSizeFitsQuorum <[email protected]>
Co-authored-by: OneSizeFitsQuorum <[email protected]>
Co-authored-by: OneSizeFitsQuorum <[email protected]>
…down-docs Clarify ray.shutdown() behavior for local vs remote clusters
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request clarifies the behavior of ray.shutdown() in both the API docstring and the core documentation. The changes are clear and accurate. I have a couple of suggestions to make the explanation even more explicit for users who call ray.init() without arguments, which is a very common use case.
I am having trouble creating individual review comments. Click here to see my feedback.
doc/source/ray-core/starting-ray.rst (86)
To improve clarity, it would be helpful to explicitly mention that ray.init() with no arguments can also connect to an existing cluster. This is a very common use case and adding it to the examples would make the documentation more complete.
* If you connected to an existing cluster (e.g., via ``ray.init()`` when a cluster is already running, ``ray.init(address="auto")``, or ``ray.init(address="ray://<ip>:<port>")``), ``ray.shutdown()`` only disconnects the client -- it does **not** shut down the remote cluster.
python/ray/_private/worker.py (2031-2033)
For better clarity, let's explicitly mention the case where ray.init() without arguments connects to an existing cluster. This makes the documentation more comprehensive for this common scenario.
* If you connected to an existing cluster (e.g., by calling
``ray.init()`` when a cluster is already running, using
``ray.init(address="auto")``, or ``ray.init(address="ray://<ip>:<port>")``),
``ray.shutdown()`` will only disconnect the client from the cluster.
edoakes
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
ray.shutdown()inpython/ray/_private/worker.pyto clarify:ray.init(address="xxx"),ray.shutdown()only disconnects the client and does NOT terminate the remote clusterray.init()will have their processes terminated byray.shutdown()ray.init()without address argument will auto-detect existing clustersdoc/source/ray-core/starting-ray.rstexplaining the same behavior difference