[Performance] Eliminate parent LIBERO environment construction - #4028
Open
vmoens wants to merge 2 commits into
Open
[Performance] Eliminate parent LIBERO environment construction#4028vmoens wants to merge 2 commits into
vmoens wants to merge 2 commits into
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/rl/4028
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 35911c6 with merge base f2a2337 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
vmoens
marked this pull request as ready for review
July 17, 2026 08:26
…tracebacks - Drop ParallelEnv-only kwargs (mp_start_method, metadata_from_workers) when serial_for_single falls back to SerialEnv instead of raising a TypeError, and retain mp_start_method when the env stays parallel - Expose the worker shutdown grace period as a shutdown_timeout constructor argument (also settable via configure_parallel) instead of a hardcoded 10s - Send the full worker traceback in metadata_error messages so construction failures are debuggable from the parent - Close transient metadata envs with raise_if_closed=False so a close failure cannot mask the metadata result or the original error - Document the identical-schema requirement and sequential shutdown of metadata_from_workers in the docstring and the vectorized-envs docs Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ParallelEnv(metadata_from_workers=True)startup handshake so real workers report and validate metadata without parent-side shadow environmentscreate_env_kwargsfor worker-specific assignment, while keepingspawnas the configured worker start methodRoot cause
VLA-GRPO built each LIBERO worker from a distinct partial, so
ParallelEnvclassified the batch as heterogeneous and constructed every environment serially in the parent for metadata. At 320 environments, that produced 320 temporary MuJoCo/EGL environments before constructing the 320 long-lived workers.Benchmark
The committed synthetic benchmark (
benchmarks/benchmark_parallel_env_startup.py) with 20 workers and a 10 ms constructor delay measured:The production LIBERO configuration (4 subcollectors x 80 environments on H200s) measured:
The successful
spawnrun retained all 10 task instructions per subcollector, the expected task/group offsets, worker indices, and seeds. Peak child-process counts were 81-82 per subcollector, the first environment step completed, and shutdown reported zero orphan worker processes. Theforkserverrun accumulated EGL allocations on GPU 0 rather than the requested per-subcollector render GPUs, so it is not enabled. Complete benchmark commands, logs, per-collector JSON, and process snapshots were retained with the run artifacts.spawnremains the VLA default.forkserveris reported as benchmark evidence only rather than being selected from a single startup stress run.Validation
pytest -q test/envs/test_parallel.pypytest -q sota-implementations/vla_grpo/test_openvla.py -k 'factory or instruction or group'pytest -q test/envs/test_special.py -k callable_metadata_env