Repository navigation
Move Ray tooling to isaaclab_contrib - #7238
kellyguo11 wants to merge 2 commits into
Conversation
Greptile SummaryThe PR relocates the community Ray dispatch and tuning workflow into isaaclab_contrib while retaining deprecated forwarding scripts.
Confidence Score: 4/5The implementation appears largely sound, but the stale Sphinx toctree must be corrected before merging to avoid a broken documentation build and missing Ray page. Moving the Ray document without updating docs/index.rst leaves the documentation graph referencing a nonexistent source file. Files Needing Attention: docs/source/experimental-features/ray.rst and docs/index.rst Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart LR
User[Ray CLI user] --> Extra[uv --extra ray]
Extra --> Contrib[isaaclab_contrib.rl.ray modules]
Legacy[Deprecated scripts/reinforcement_learning/ray wrappers] --> Contrib
Contrib --> Local[Local tuning workflow]
Contrib --> Submit[Ray JobSubmissionClient]
Submit --> Cluster[Remote Ray or KubeRay cluster]
Reviews (1): Last reviewed commit: "Move Ray tooling to isaaclab_contrib" | Re-trigger Greptile |
| @@ -1,8 +1,10 @@ | |||
| .. _ray-workflow: | |||
There was a problem hiding this comment.
Isaac Lab Review Bot
The Ray workflow relocation, package-data integration, documentation paths, and deprecated entry points are generally coherent. Two concrete legacy-path compatibility gaps remain: multiprocessing functions executed through the forwarding shim are not exposed through sys.modules["__main__"], and forwarded submit_job.py invocations now upload the contrib directory rather than files beside the legacy scripts.
- Design and architecture: Moving the workflow under
isaaclab_contrib.rl.rayand replacing localsys.pathmanipulation with package imports is a sound design. The packaged Kubernetes templates and one-release forwarding wrappers provide an appropriate migration structure; the lockfile changes do not by themselves demonstrate an incompatibility for unrelated extras. - API: The relocated CLI surfaces and new
rayextra are documented and represented in metadata tests. However, the deprecatedsubmit_job.pypath no longer preserves the old Rayworking_dirbehavior: relative task configuration or Python-module files placed beside the legacy scripts are not uploaded. The migration warning or changelog must state that these files need relocation, or the wrapper must preserve the old working-directory contract. - Implementation: The forwarding helper works for ordinary module execution and imports, but
runpy.run_module(..., run_name="__main__")leaves the legacy wrapper registered assys.modules["__main__"]. The MLflow converter submits a function defined by the forwarded module toProcessPoolExecutor, so that function cannot be resolved from the registered wrapper during pickling. The forwarding path should temporarily register the executed module as__main__, such as by usingalter_sys=True.
Minor fixes needed. Posted 2 actionable findings inline.
Automated review; human maintainers own approval decisions.
| stacklevel=2, | ||
| ) | ||
| if namespace.get("__name__") == "__main__": | ||
| runpy.run_module(module_name, run_name="__main__") |
There was a problem hiding this comment.
🟡 Warning · Implementation — Forwarding shim breaks multiprocessing pickling
runpy.run_module(..., run_name="__main__") defaults to alter_sys=False, so sys.modules["__main__"] stays the legacy wrapper. mlflow_to_local_tensorboard submits process_run (whose __module__ is "__main__") to a ProcessPoolExecutor; pickling resolves it against the wrapper, which lacks that attribute, so the legacy script fails at runtime while --help still succeeds. Pass alter_sys=True.
| print(f"[INFO]: Isaac Ray Wrapper received jobs {formatted_jobs=}") | ||
| clusters = read_cluster_spec(args.config_file) | ||
| submit_jobs_to_clusters(formatted_jobs, clusters) | ||
| forward("isaaclab_contrib.rl.ray.submit_job", globals()) |
There was a problem hiding this comment.
🔵 Suggestion · Api — Wrapper changes uploaded Ray working_dir
The forwarded module derives CONFIG["working_dir"] from its own __file__, so the uploaded runtime-env directory becomes the contrib package path. Users invoking this deprecated script with relative --task_cfg tasks.yaml or --py_modules files placed next to the old scripts no longer have those files uploaded, and the cluster job fails. State the required relocation in the deprecation warning or changelog fragment.
|
This is a lot of diff, did we test all this? |
Summary
Moved the community Ray dispatch and tuning workflow into
isaaclab_contrib.rl.ray, with an opt-in checkoutrayextra and packaged Kubernetes templates. The legacy scripts, module imports, tuning configuration paths, Dockerfile, and cluster template paths remain usable for one deprecation release.Merged current
main(5c40dd797b) into the original PR head, preserving its history and the current uv-based launch commands. The separate documentation cleanup was merged in #7237.Compatibility and workflow fixes
__main__during execution so the legacy MLflow converter can pickle its process-pool workers.--working_dirto the module command for explicit job directories.Validation
Validated on Linux with Python 3.12, Ray 2.52.1, Optuna 4.9.0, MLflow 3.18.0, and Torch 2.11.0. The worktree used its own uv environment and package registrations, with existing simulator dependencies reused read-only; this was not a clean full simulator installation.
uv run --no-sync python -m pytest source/isaaclab_contrib/test/rl/test_ray_compat.py -q: 4 passed. Regression cases were observed failing before their fixes: process-pool conversion, legacy upload/failure propagation, failed worker commands, and explicit resource allocation.uv run --no-sync python -m pytest source/isaaclab/test/cli/test_uv_run_pyproject.py -q: 13 passed.--help; legacy namespace/configuration imports also passed.IsaacLabTuneTrainableagainst a synthetic CPU trainer emitting TensorBoard metrics. The trial reached TERMINATED, reported reward 13.5, and exercised the custom stopper/process-cleanup path.uv lock --check, changelog validation againstorigin/main,git diff --check, and the fulluv run --no-sync isaaclab --formatgate passed.Validation limits
The NVIDIA driver was unavailable. CPU checks advertised one logical GPU resource solely to exercise Ray's resource scheduling; no CUDA or simulator training was performed. Tune used a synthetic trainer, not an Isaac Lab environment. Docker image execution, live Kubernetes/GKE provisioning, remote multi-node execution, and remote MLflow-backed tuning remain unvalidated.
CI status after this update
main.newton.environments/previews/locomotion/g1_cr7.mp4in the unchanged motion-tracking guide. It reported no broken Ray guide links.These CI failures have not been represented as successful validation or fixed as part of this Ray migration. Remaining build/platform jobs were still pending when this report was updated.