Skip to content

groot-ray-serve: parameterize live rollout into an N_ROLLOUTS fan-out#784

Open
IanDJordan wants to merge 1 commit into
mainfrom
update/groot-ray-serve/rollout-fanout
Open

groot-ray-serve: parameterize live rollout into an N_ROLLOUTS fan-out#784
IanDJordan wants to merge 1 commit into
mainfrom
update/groot-ray-serve/rollout-fanout

Conversation

@IanDJordan

@IanDJordan IanDJordan commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Summary

Lands two things for the groot-ray-serve template in one diff:

  1. a content/quality overhaul of the walkthrough notebook (and a security note in policy_server.py), and
  2. a new N_ROLLOUTS fan-out so the headline story — one shared policy fleet, many independent simulators — is actually runnable from a single knob.

New this round — N_ROLLOUTS fan-out

  • run_rollout takes a worker_id; GIF/results filenames are now per-worker (was hardcoded to 99, so fanned-out rollouts would clobber each other).
  • Step 5 launches N_ROLLOUTS SimActors (each holds one GPU; the Anyscale autoscaler provisions nodes to fit, capped by max-workers). Step 6 collects the list, displays the first success, and falls back to the pre-recorded clip only if none succeed. Cleanup kills every actor.
  • N_ROLLOUTS = 1 reproduces the prior single-rollout testing behavior exactly.

Notebook overhaul (correctness / robustness)

  • GPU leak fix: Cleanup now kills the SimActorserve.shutdown() doesn't reclaim it, so it previously pinned a whole GPU + CPU after the run.
  • Removed the shell-script layer in the python → bash → python call chain: run_rollout previously built a shell=True bash command string (a Ray actor shelling out to bash, which cd'd and ran the timeout binary before launching python sim_worker.py). It now runs subprocess.run([...], cwd=…, timeout=…) directly — python → python, dropping the bash layer and its shell quoting/injection footgun. The subprocess itself is retained on purpose — Isaac Sim/Omniverse Kit can't boot inside a Ray worker.
  • Stale-GIF guard: Step 5/6 requires exit_code == 0 and a fresh file before trusting the live GIF (prevents re-displaying a previous run's clip as if it succeeded); throttled the progress print.
  • fixed the "Going further" snippets to the real actor API, made wording consistently "actor" (not "task"), and changed "sub-second latency" → realistic ~200 ms-1.5 s.
  • Import/serve fixes: removed a dead sys.path.insert; documented that serve.start(host=0.0.0.0) is load-bearing (binds the proxy so off-node sim workers can reach the policy), not redundant with serve.run.
  • policy_server.py: documented the pickle-over-HTTP trust assumption on both predict_http endpoints (comment only, no behavior change).

Validation

  • pre-commit run --all-files passes (incl. check-readme byte-exact match and check-build-yaml); no template dependency changes (so check-depsets is unaffected).
  • All notebook code cells compile.
  • Per-template test (/test-template groot-ray-serve) + dev->staging->prod re-publish to follow after approval.

🤖 Generated with Claude Code

Make the "one shared policy fleet, many independent simulators" story
actually runnable from a single knob, plus carry over the notebook
quality fixes and a security note.

- run_rollout takes a worker_id; GIF/results filenames are per-worker so
  fanned-out rollouts no longer clobber each other (was hardcoded to 99).
- Step 5 launches N_ROLLOUTS SimActors (each holds one GPU; the Anyscale
  autoscaler provisions nodes to fit, capped by max-workers). Step 6
  collects the list, shows the first success, and falls back to the
  pre-recorded clip only if none succeed; cleanup kills every actor.
- N_ROLLOUTS = 1 reproduces the prior single-rollout behavior exactly.
- policy_server.py: document the pickle-over-HTTP trust assumption on both
  predict_http endpoints (comment only, no behavior change).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@IanDJordan IanDJordan requested review from Aydin-ab and shorbaji and removed request for Aydin-ab June 29, 2026 20:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant