Skip to content

fix: route GPU backend environments by DP rank - #1510

Merged
TATP-233 merged 2 commits into
mainfrom
dev/issue-1508-multi-gpu-env-routing
Sep 5, 2026
Merged

fix: route GPU backend environments by DP rank#1510
TATP-233 merged 2 commits into
mainfrom
dev/issue-1508-multi-gpu-env-routing

Conversation

@TATP-233

@TATP-233 TATP-233 commented Sep 5, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fixes #1508 by routing IsaacGym, IsaacSim, and Genesis environment device IDs from the configured data-parallel topology.

  • Off-policy collectors use host-visible training.devices indices.
  • PPO/torchrun workers use LOCAL_RANK in the remapped CUDA_VISIBLE_DEVICES namespace.
  • Genesis binds its process-wide CUDA session before gs.init, including spawn collectors.
  • Adds collision warnings, owner config fields, tests, and PPO/SAC documentation.
  • Includes a compatibility fallback for older unisim-core versions that reject genesis_device_id.

Genesis pinning update (a404d2d)

Genesis (Quadrants 1.3.0) ignores torch.cuda.set_device and only honors the first CUDA_VISIBLE_DEVICES entry, so routing alone crashed on any non-zero physical GPU with CUDA_ERROR_ILLEGAL_ADDRESS. Entry points now pin CUDA_VISIBLE_DEVICES to the routed physical GPU before any CUDA query (torch.cuda.is_available() itself latches the visible set, so pinning must happen first), remap the process-local device to cuda:0 (rewriting LOCAL_RANK for rsl_rl DP and genesis_device_id overrides), and keep binding idempotent via a module-level latch.

Validation

  • Focused UniLab tests: 246 passed; new Genesis pin tests included.
  • ruff, mypy, and pyright: passed (one pre-existing optional drake_uni.runtime warning).
  • make test-all on final head a404d2d: passed1595 passed, 20 skipped, benchmark smoke passed (env synced with --extra mujoco --extra motrix per CI).
  • Two-GPU hardware validation (2x Blackwell): PPO torchrun DP=2 and SAC DpRankSupervisor DP=2 on g1_walk_flat/genesis both exit 0; nvidia-smi confirms each rank's learner and collector sim processes land on their own physical GPU with no cross-GPU leakage. Single-GPU Genesis PPO/SAC regressions pass. IsaacSim PPO/SAC DP=2 verified earlier on the same host; IsaacGym blocked by Preview 4 lacking Blackwell kernels (single-GPU also fails; routing delivery to workers confirmed).

No package release is performed in this PR.

Dependency PR

The Genesis public contract is implemented in the companion UniSim PR: unilabsim/unisim#29.

…DA init

Genesis (Quadrants) ignores torch.cuda.set_device and only honors the
first CUDA_VISIBLE_DEVICES entry, crashing on non-zero physical GPUs.
Pin the visible-device set at the earliest entry-point boundary
(pure config-topology resolution, no torch queries), remap the
process-local device to cuda:0 (rewriting LOCAL_RANK for rsl_rl DP and
genesis_device_id overrides so unisim does not re-translate), and keep
binding idempotent via a module-level latch. Capture the bound device
returned by bind_backend_process_device in all train/play entry points.
@TATP-233
TATP-233 merged commit a0df2aa into main Sep 5, 2026
8 checks passed
@TATP-233
TATP-233 deleted the dev/issue-1508-multi-gpu-env-routing branch September 5, 2026 17:34
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.

isaacgym / isaacsim / genesis 后端在多 GPU data-parallel 下所有 rank 挤在 GPU 0

1 participant