Repository navigation
docs: explain why Gym runs separate servers and when it uses Ray - #6065
Conversation
ba5eb42 to
2abb6f9
Compare
cwing-nvidia
left a comment
There was a problem hiding this comment.
Thanks, this is accurate: I checked the ray_enabled declarations, the ray extra, the startup check and the RAY_ENABLE_AUTO_CONNECT=0 launch against main. The async fix to the FAQ example is a good catch, and "Why Separate Servers" answers the question new users ask most.
Please address:
- Agent guidance. The
add-benchmarkskill (.agents/skills/add-benchmark/references/patterns.md, "Subprocess Execution with Ray", and the Ray bullet in itsSKILL.md) and the Ray bullet inAGENTS.mdstill teach the Ray pattern withoutray_enabled. A coding agent that follows them writes a server that fails at startup with "Ray has not been started yet". Many new environments are written this way, so this matters as much as the user docs. - Move the Ray guide out of the FAQ onto its own Infrastructure page with a task-based title (inline on
faq.mdx:332). This PR makes it the main Ray page, so it should live where people look for it. - Add an upgrade note for existing users (inline on
faq.mdx:334). Custom servers that call Ray without declaring it now fail, and plainpip install nemo-gymdrops Ray.
Also suggested inline: drop Ray from the README, rewrite the closing paragraph of Why Separate Servers (and drop the 65,000 figure), and remove Ray from the verification patterns page. I also left one question on the Python-version bullet.
|
Thanks. All three are in 2226fbc. |
Add a section to the architecture page on why agents, resources servers and model servers run as separate servers, and an overview of how a server can move heavy work off its own processes: sandboxes, inference endpoints, and opt-in Ray, which is not how servers communicate. Move the Ray guide out of the FAQ onto its own Infrastructure page, Scale CPU-Heavy Work with Ray, with a note for users upgrading from 0.7.0 or earlier. Fix pages that still said Gym always installs or starts Ray, make the Ray example await its futures instead of calling ray.get() in async code, and drop Ray from the README prerequisites and from the verification patterns page. Teach the ray_enabled declaration and the ray extra in AGENTS.md and the add-benchmark skill, so agents that follow them write Ray servers that start. Signed-off-by: Ananth Subramaniam <[email protected]>
a2bb2fd to
a0c1f50
Compare
cwing-nvidia
left a comment
There was a problem hiding this comment.
Thanks, this covers everything. One fix before merge: the Fern docs check fails because the new page repeats its title as an H1 (suggestion inline).
Signed-off-by: Ananth Subramaniam <[email protected]>
What and why
New users ask two questions about Gym: why it runs agents, resources servers, and model servers as separate servers when they're used to running an agent in one process, and what Ray is for. Ray is now opt-in: a server uses it only if it declares
ray_enabled = True, andnemo-gym[ray]is an optional extra. Several pages still described the old behavior, where Gym always installed and started Ray.This PR:
ray_enabled = True, and install therayextra, whichpip install nemo-gymno longer includes.README.md: drops Ray from the prerequisites. Most users never need it, and the installation page covers therayextra.PermissionErrorentry now says Gym starts Ray only for servers that declare it, and links to the new page.code_genexample (it moved to sandboxes). One sentence now points to Architecture for where heavy checkers run, andevalplusandcode_fimare listed as code-execution checkers.AGENTS.mdand theadd-benchmarkskill now say a server that uses Ray must declareray_enabled = Trueand requestnemo-gym[ray], and point isolated code execution at the Sandbox API. The skill's Ray server example declaresray_enabled = True.ray.get(), which blocks the event loop in server code. It now awaits the Ray futures.Each statement follows the code on
main:SimpleServer.ray_enabled,_ray_server_namesand the launch path in the server supervisor,_connect_server_to_ray, therayextra inpyproject.toml, and theray_enableddeclarations inevalplus,code_fim,code_gen, andlocal_vllm_model.No release-notes entry: the change that made Ray optional merged after v0.7.0, so it belongs in the next release's notes, written when that release is cut.
Closes #2857
Validation
pre-commit run --fileson the changed files: passed.fern check: no errors. The one warning is the missing-redirects check, which is skipped without Fern authentication.fern docs broken-links, after generating the library reference: no broken links in the changed pages. The remaining errors are in earlier version snapshots and in sandbox pages this PR doesn't touch.Rollouts
N/A: docs only.
Compatibility
None. Docs only.