From 2f1ee745a618b01c52d96abfcabdd2a2e1d0cd9d Mon Sep 17 00:00:00 2001 From: Yuchen Deng Date: Thu, 27 Aug 2026 15:07:39 -0700 Subject: [PATCH] Refine NuRec Isaac Lab workflow --- compass/utils/nurec_utils.py | 2 +- docker/Dockerfile.rl | 5 +- docker/Dockerfile.rl.isaaclab-3.0-ga | 65 -------- docker/run.sh | 8 +- docs/handbook/osmo.md | 33 ---- docs/handbook/workflows/nurec_real2sim.md | 194 +++------------------- osmo/run_osmo.py | 2 - osmo/workflows/rl_es_eval_workflow.yaml | 2 +- osmo/workflows/rl_es_train_workflow.yaml | 14 +- run.py | 11 +- 10 files changed, 41 insertions(+), 295 deletions(-) delete mode 100644 docker/Dockerfile.rl.isaaclab-3.0-ga diff --git a/compass/utils/nurec_utils.py b/compass/utils/nurec_utils.py index aff2d98..6e4bc65 100644 --- a/compass/utils/nurec_utils.py +++ b/compass/utils/nurec_utils.py @@ -64,7 +64,7 @@ def uses_nurec_spg_runtime(args): if getattr(args, "spg_runtime", False): return True - if getattr(args, "environment", None) not in NUREC_SCENE_NAMES: + if getattr(args, "nurec_scene", None) not in NUREC_SCENE_NAMES: return False usd_file = getattr(args, "nurec_usd_file", "") or "" diff --git a/docker/Dockerfile.rl b/docker/Dockerfile.rl index 77f71c8..326033f 100644 --- a/docker/Dockerfile.rl +++ b/docker/Dockerfile.rl @@ -1,8 +1,11 @@ -FROM nvcr.io/nvidia/isaac-lab:3.0.0-beta1 +# Temporary internal Isaac Lab image from the private NGC registry. +# Replace with public nvcr.io/nvidia/isaac-lab: after the fix is released. +FROM nvcr.io/0947644777160149/internal/isaac-lab:latest-release-3.0.0-119c17247c436f3d97c07dd26c7a52404d3dfc7c # Omniverse runtime env (required for any kit / pip step run as root in the container). ENV ACCEPT_EULA=Y ENV OMNI_KIT_ALLOW_ROOT=1 +USER root # COMPASS lives in /workspace/COMPASS so /workspace/isaaclab (from the base image) # is preserved when docker/run.sh bind-mounts the host repo at runtime. diff --git a/docker/Dockerfile.rl.isaaclab-3.0-ga b/docker/Dockerfile.rl.isaaclab-3.0-ga deleted file mode 100644 index 137d1cc..0000000 --- a/docker/Dockerfile.rl.isaaclab-3.0-ga +++ /dev/null @@ -1,65 +0,0 @@ -FROM nvcr.io/nvidia/isaac-sim:6.0.1 - -# Omniverse runtime env (required for Kit / Isaac Sim commands in containers). -ENV ACCEPT_EULA=Y -ENV OMNI_KIT_ALLOW_ROOT=1 -ENV DEBIAN_FRONTEND=noninteractive -ENV ISAACSIM_ROOT_PATH=/isaac-sim -ENV ISAACLAB_PATH=/workspace/isaaclab - -ARG ISAACLAB_REPO=https://github.com/isaac-sim/IsaacLab.git -ARG ISAACLAB_REF=20976357cce6498d4f3db91b18540f3969c84247 - -USER root - -SHELL ["/bin/bash", "-o", "pipefail", "-c"] - -RUN apt-get update \ - && apt-get install -y --no-install-recommends \ - build-essential \ - ca-certificates \ - cmake \ - git \ - git-lfs \ - libglib2.0-0 \ - ncurses-term \ - wget \ - && rm -rf /var/lib/apt/lists/* - -WORKDIR /workspace - -# Build a self-contained Isaac Lab layer because an NGC isaac-lab image for this -# newer stack may not exist yet. ISAACLAB_REF is pinned for reproducibility; it -# can still be overridden with a branch, tag, or commit at docker build time. -RUN git clone "${ISAACLAB_REPO}" "${ISAACLAB_PATH}" \ - && cd "${ISAACLAB_PATH}" \ - && git -c advice.detachedHead=false checkout "${ISAACLAB_REF}" \ - && chmod +x isaaclab.sh \ - && ln -sf "${ISAACSIM_ROOT_PATH}" "${ISAACLAB_PATH}/_isaac_sim" \ - && if [ -f docker/scripts/install_carb_env_shim.sh ]; then \ - /bin/bash docker/scripts/install_carb_env_shim.sh "${ISAACSIM_ROOT_PATH}"; \ - fi \ - && ./isaaclab.sh -p -m pip install toml pytest \ - && ./isaaclab.sh -p "${ISAACLAB_PATH}/tools/install_deps.py" apt "${ISAACLAB_PATH}/source" \ - && apt-get -y autoremove \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* \ - && ./isaaclab.sh --install - -# COMPASS lives in /workspace/COMPASS so /workspace/isaaclab remains available -# for both OSMO jobs and local docker/run.sh usage. -WORKDIR /workspace/COMPASS - -COPY . /workspace/COMPASS - -# Install COMPASS dependencies, the X-Mobility wheel, and the mobility_es Isaac -# Lab extension into Isaac Lab's bundled Python environment. -RUN ${ISAACLAB_PATH}/isaaclab.sh -p -m pip install -r /workspace/COMPASS/requirements.txt \ - && ${ISAACLAB_PATH}/isaaclab.sh -p -m pip install /workspace/COMPASS/x_mobility/x_mobility-0.1.0-py3-none-any.whl \ - && ${ISAACLAB_PATH}/isaaclab.sh -p -m pip install -e /workspace/COMPASS/compass/rl_env/exts/mobility_es - -# Provide python/python3 on PATH for docker/run.sh exec and direct container use. -RUN printf '#!/usr/bin/env bash\nexec "${ISAACLAB_PATH}/_isaac_sim/python.sh" "$@"\n' \ - > /usr/local/bin/python \ - && chmod +x /usr/local/bin/python \ - && ln -sf /usr/local/bin/python /usr/local/bin/python3 diff --git a/docker/run.sh b/docker/run.sh index 839e006..29fb993 100755 --- a/docker/run.sh +++ b/docker/run.sh @@ -6,7 +6,6 @@ # # Usage: # ./docker/run.sh build [tag] # build the image (default tag: latest) -# COMPASS_DOCKERFILE=docker/Dockerfile.rl.isaaclab-3.0-ga ./docker/run.sh build isaaclab-3.0-ga # ./docker/run.sh assets [--hf-token TOK] # download USDs + X-Mobility ckpt to ./assets # [--nurec-scene SCENE] # also download a NuRec scene folder # ./docker/run.sh up # idempotent: start daemon container if not running @@ -25,7 +24,6 @@ REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" # Image tag. Override via `./docker/run.sh build mytag` then `COMPASS_IMAGE_TAG=mytag ./docker/run.sh up`. IMAGE_TAG="${COMPASS_IMAGE_TAG:-latest}" IMAGE_NAME="compass-rl:${IMAGE_TAG}" -DOCKERFILE="${COMPASS_DOCKERFILE:-docker/Dockerfile.rl}" # Container name = "compass--<8-hex of repo path>". Hashing the absolute repo # path means multiple checkouts of COMPASS coexist without colliding, and the same @@ -103,9 +101,9 @@ _compass_run_args() { # ────────────────────────────────────────────────────────────────────────────── cmd_build() { local tag="${1:-${IMAGE_TAG}}" - step "Building ${IMAGE_NAME/:*/:${tag}} from ${DOCKERFILE}" + step "Building ${IMAGE_NAME/:*/:${tag}} from docker/Dockerfile.rl" cd "${REPO_ROOT}" - docker build --network=host -f "${DOCKERFILE}" -t "compass-rl:${tag}" . + docker build --network=host -f docker/Dockerfile.rl -t "compass-rl:${tag}" . info "Build complete: compass-rl:${tag}" } @@ -190,7 +188,7 @@ cmd_shell() { cmd_status() { echo "Image: ${IMAGE_NAME}" - echo "Dockerfile:${DOCKERFILE}" + echo "Dockerfile:docker/Dockerfile.rl" if docker image inspect "${IMAGE_NAME}" >/dev/null 2>&1; then echo "Image OK: $(docker image inspect "${IMAGE_NAME}" --format '{{.Id}} ({{.Created}})')" else diff --git a/docs/handbook/osmo.md b/docs/handbook/osmo.md index 658d3b4..74cb399 100644 --- a/docs/handbook/osmo.md +++ b/docs/handbook/osmo.md @@ -63,7 +63,6 @@ python osmo/run_osmo.py train \ --wandb-project \ [--resume-ckpt ] \ [--no-residual] \ - [--dockerfile docker/Dockerfile.rl.isaaclab-3.0-ga] \ [--image ] ``` @@ -78,41 +77,15 @@ python osmo/run_osmo.py eval \ [--no-residual] \ [--embodiment h1|spot|carter|g1|digit] \ [--environment ] \ - [--dockerfile docker/Dockerfile.rl.isaaclab-3.0-ga] \ [--image ] ``` -### NuRec Real2Sim - -For NuRec training or eval, pass the scene download arguments explicitly. The -workflow downloads the scene from -[`nvidia/PhysicalAI-Robotics-NuRec`](https://huggingface.co/datasets/nvidia/PhysicalAI-Robotics-NuRec), -switches to the Real2Sim gin config, and passes `--nurec-usd-file` through to -`run.py` alongside `--nurec-scene`. - -```bash -python osmo/run_osmo.py train \ - --experiment-name nurec-galileo \ - --wandb-project compass-rl \ - --dockerfile docker/Dockerfile.rl.isaaclab-3.0-ga \ - --embodiment carter \ - --nurec-scene nova_carter-galileo \ - --nurec-revision refs/pr/34 \ - --nurec-usd-file particle_spg-runtime.usdz \ - --num-envs 12 -``` - -For NuRec jobs submitted through `run_osmo.py`, use `--nurec-scene` instead of -`--environment`. The workflow uses that scene for both the Hugging Face download -and the `run.py --nurec-scene` value. - ### `record` ```bash python osmo/run_osmo.py record \ --experiment-name \ --dataset-name \ - [--dockerfile docker/Dockerfile.rl.isaaclab-3.0-ga] \ [--image ] ``` @@ -153,12 +126,6 @@ If you do not pass `--image`, `run_osmo.py` will: 2. `docker push` that tag. 3. Pass the resulting image into the `osmo workflow submit` command. -Pass `--dockerfile docker/Dockerfile.rl.isaaclab-3.0-ga` to build an Isaac Sim 6.0.1 -image with Isaac Lab pinned to commit -`20976357cce6498d4f3db91b18540f3969c84247`, instead of the legacy -`nvcr.io/nvidia/isaac-lab:3.0.0-beta1` base image. The Dockerfile still exposes -`ISAACLAB_REF` as a build arg for deliberate pin updates. - For repeated runs against the same code, build the image once and pass it via `--image` to skip the build/push. diff --git a/docs/handbook/workflows/nurec_real2sim.md b/docs/handbook/workflows/nurec_real2sim.md index f0256f3..16f594b 100644 --- a/docs/handbook/workflows/nurec_real2sim.md +++ b/docs/handbook/workflows/nurec_real2sim.md @@ -1,13 +1,13 @@ # Training & deploying with NuRec Real2Sim scenes This guide shows how to train and deploy COMPASS navigation policies on -**NuRec Real2Sim** assets in Isaac Lab. Use Docker when possible; use -bare-metal only when Docker is unavailable or when you need to debug the Isaac -Lab checkout directly. +**NuRec Real2Sim** assets in Isaac Lab. Use Docker for local runs and OSMO for +cloud runs. ```{note} -Validated on **Ubuntu 22.04** / **OVX with RTX**, with **Isaac Lab commit -`20976357cce6498d4f3db91b18540f3969c84247`** and **Isaac Sim 6.0.1**. +Validated on **Ubuntu 22.04** / **OVX with RTX**, using the temporary internal +Isaac Lab 3.0 release image until the matching public Isaac Lab image is +available. ``` ## Docker workflow (recommended) @@ -58,13 +58,12 @@ You must accept the dataset terms on Hugging Face before downloading. ### 4. Build and activate the container -The NuRec image uses Isaac Sim 6.0.1 and builds Isaac Lab from the pinned commit -because there is no matching published Isaac Lab 3.0 GA base image for this -workflow yet. +The NuRec image currently uses an internal Isaac Lab 3.0 release base image +because the old public `3.0.0-beta1` image is not compatible with this branch. +Replace it with the matching public Isaac Lab image after release. ```bash -export COMPASS_IMAGE_TAG=nurec-lab-3.0-ga -export COMPASS_DOCKERFILE=docker/Dockerfile.rl.isaaclab-3.0-ga +export COMPASS_IMAGE_TAG=isaaclab-3.0-ea ./docker/run.sh build source ./docker/activate @@ -213,9 +212,9 @@ To run headless, omit `--visualizer kit` or pass `--visualizer None`. ```{note} Approximate per-GPU VRAM for `nova_carter-galileo`, Carter, 320x512 camera: -particle assets use `8.5 GB + 1.0 GB × num_envs`; volume assets use -`7 GB + 1.75 GB × num_envs`. Safe particle defaults are about 18 envs on 32 GB -and 32 envs on 48 GB. Reduce `--num_envs` on OOM. +particle assets use `8.5 GB + 1.0 GB × num_envs`. +Safe particle defaults are about 18 envs on 32 GB and 32 envs on 48 GB. +Reduce `--num_envs` on OOM. ``` ### 8. Train on multiple GPUs @@ -245,7 +244,7 @@ python run.py \ -o \ -b ./assets/x_mobility.ckpt \ -p \ - --embodiment \ + --embodiment carter \ --nurec-scene nova_carter-galileo \ --num_envs \ --video \ @@ -262,7 +261,7 @@ cd / python /onnx_conversion.py \ -b \ -r \ - -e \ + -e carter \ -o \ -j @@ -290,14 +289,15 @@ NuRec OSMO jobs download COMPASS USDs, the X-Mobility checkpoint, and the requested NuRec scene inside the workflow. When `--nurec-scene` is set, the workflow switches to the Real2Sim gin config and passes `--nurec-scene` and `--nurec-usd-file` to `run.py`. +Use `--nurec-scene` instead of `--environment` so the same scene drives both +the Hugging Face asset download and the NuRec runtime branch. Training example: ```bash python osmo/run_osmo.py train \ - --experiment-name nurec-galileo \ - --wandb-project \ - --dockerfile docker/Dockerfile.rl.isaaclab-3.0-ga \ + --experiment-name nurec \ + --wandb-project compass-nurec-carter-galileo \ --embodiment carter \ --nurec-scene nova_carter-galileo \ --nurec-revision refs/pr/34 \ @@ -310,10 +310,9 @@ Evaluation example: ```bash python osmo/run_osmo.py eval \ - --experiment-name nurec-galileo-eval \ - --wandb-project \ + --experiment-name nurec-eval \ + --wandb-project compass-nurec-carter-galileo-eval \ --checkpoint \ - --dockerfile docker/Dockerfile.rl.isaaclab-3.0-ga \ --embodiment carter \ --nurec-scene nova_carter-galileo \ --nurec-revision refs/pr/34 \ @@ -327,161 +326,8 @@ Use W&B videos and robot-camera debug images for run inspection. Add `--image ` to skip build and push. Full reference: [OSMO cloud submission](../osmo.md). -## Bare-metal Isaac Lab workflow - -### 1. Prepare prerequisites - -- An NVIDIA GPU + driver that satisfies the Isaac Sim 6.0.1 requirements. -- Conda. -- A Hugging Face token with access to the COMPASS and NuRec assets. -- The Hugging Face CLI on `PATH`. - -```bash -python3 -m pip install --user -U 'huggingface_hub[cli]' -``` - -### 2. Install Isaac Lab and Isaac Sim - -```bash -git clone https://github.com/isaac-sim/IsaacLab.git -cd IsaacLab -git checkout 20976357cce6498d4f3db91b18540f3969c84247 - -./isaaclab.sh --conda env_isaaclab_3.0_compass -conda activate env_isaaclab_3.0_compass - -pip install isaacsim[all,extscache]==6.0.1 --extra-index-url https://pypi.nvidia.com -./isaaclab.sh --install -./isaaclab.sh -p scripts/tutorials/00_sim/create_empty.py --visualizer kit -``` - -```{note} -`./isaaclab.sh --conda` must run under Python ≥ 3.11. Isaac Sim 6.x requires -Python 3.12, which the conda step provisions. -``` - -### 3. Install COMPASS - -```bash -conda deactivate -conda activate env_isaaclab_3.0_compass - -git clone https://github.com/NVlabs/COMPASS.git -cd COMPASS -git fetch -git checkout real2sim/isaaclab_3.0 - -export ISAACLAB_PATH= - -${ISAACLAB_PATH}/isaaclab.sh -p -m pip install -r requirements.txt -${ISAACLAB_PATH}/isaaclab.sh -p -m pip install x_mobility/x_mobility-0.1.0-py3-none-any.whl -cd compass/rl_env -${ISAACLAB_PATH}/isaaclab.sh -p -m pip install -e exts/mobility_es -cd - -``` - -### 4. Download assets and checkpoints - -Use the same host-side asset helper as Docker: - -```bash -export HF_TOKEN=hf_xxx - -./docker/run.sh assets \ - --nurec-scene nova_carter-galileo \ - --nurec-revision refs/pr/34 -``` - -It installs scene folders under -`compass/rl_env/exts/mobility_es/mobility_es/usd/` and writes the base policy to -`./assets/x_mobility.ckpt`. - -### 5. Test the setup - -```bash -cd compass/rl_env -${ISAACLAB_PATH}/isaaclab.sh -p scripts/play.py --visualizer kit -cd - -``` - -### 6. Train - -```bash -${ISAACLAB_PATH:?}/isaaclab.sh -p run.py \ - -c configs/train_config_real2sim.gin \ - -o \ - -b ./assets/x_mobility.ckpt \ - --embodiment \ - --nurec-scene nova_carter-galileo \ - --num_envs 12 \ - --video \ - --video_interval 1 \ - --visualizer kit \ - --precompute_valid_poses -``` - -Use the same NuRec scene names, checkpoint layout, headless mode, and VRAM -sizing guidance from the Docker workflow. - -### 7. Train on multiple GPUs - -```bash -${ISAACLAB_PATH:?}/isaaclab.sh -p -m torch.distributed.run --nproc_per_node= \ - run.py --distributed \ - -c configs/train_config_real2sim.gin \ - -o \ - -b ./assets/x_mobility.ckpt \ - --embodiment carter \ - --nurec-scene nova_carter-galileo \ - --num_envs \ - --precompute_valid_poses \ - --video \ - --video_interval 1 -``` - -`--num_envs` is per GPU. Run headless for multi-GPU by omitting -`--visualizer kit`. - -### 8. Evaluate - -```bash -${ISAACLAB_PATH:?}/isaaclab.sh -p run.py \ - -c configs/eval_config_real2sim.gin \ - -o \ - -b ./assets/x_mobility.ckpt \ - -p \ - --embodiment \ - --nurec-scene nova_carter-galileo \ - --num_envs \ - --video \ - --video_interval 1 \ - --visualizer kit -``` - -### 9. Export and deploy - -```bash -cd / -python3 /onnx_conversion.py \ - -b \ - -r \ - -e \ - -o \ - -j - -python3 /trt_conversion.py \ - -o \ - -t -``` - -Deploy through the -[COMPASS ROS2 Deployment Guide](https://github.com/NVlabs/COMPASS/tree/main/ros2_deployment). - ## Troubleshooting -- **Isaac Sim extension errors:** reinstall with - `isaacsim[all,extscache]==6.0.1`; this usually applies to bare-metal - installs. - **Pose sampling fails:** lower collision distances, enable `--precompute_valid_poses`, and confirm the occupancy map exists. - **Robot spawns outside the scene:** check the scene's origin convention. diff --git a/osmo/run_osmo.py b/osmo/run_osmo.py index e2a582e..c90606b 100755 --- a/osmo/run_osmo.py +++ b/osmo/run_osmo.py @@ -208,8 +208,6 @@ def build_and_push_image(experiment: str, registry_prefix: str, dockerfile: str, dockerfile_path = REPO_ROOT / dockerfile_path if not dockerfile_path.is_file(): message = f"ERROR: Dockerfile not found: {dockerfile_path}\n" - if "isaac-lab-3.0-ga" in dockerfile: - message += "Did you mean docker/Dockerfile.rl.isaaclab-3.0-ga?\n" sys.stderr.write(message) sys.exit(2) image = f"{registry_prefix.rstrip('/')}/compass_{experiment}:{uuid.uuid4().hex[:8]}" diff --git a/osmo/workflows/rl_es_eval_workflow.yaml b/osmo/workflows/rl_es_eval_workflow.yaml index 9d26d1f..9c7fbbd 100644 --- a/osmo/workflows/rl_es_eval_workflow.yaml +++ b/osmo/workflows/rl_es_eval_workflow.yaml @@ -99,7 +99,7 @@ workflow: fi # Launch evaluation. - CMD="${ISAACLAB_PATH}/isaaclab.sh -p run.py -c $EVAL_CONFIG -o $OUTPUT_DIR -p $EVAL_CKPT -n {{wandb_project_name}} -r {{wandb_run_name}} --logger wandb --headless --video --video_interval 1 --num_envs {{num_envs}}" + CMD="${ISAACLAB_PATH}/isaaclab.sh -p run.py -c $EVAL_CONFIG -o $OUTPUT_DIR -p $EVAL_CKPT -n {{wandb_project_name}} -r {{wandb_run_name}} --logger wandb --video --video_interval 1 --num_envs {{num_envs}}" if [[ -n $EMBODIMENT ]]; then CMD+=" --embodiment $EMBODIMENT" diff --git a/osmo/workflows/rl_es_train_workflow.yaml b/osmo/workflows/rl_es_train_workflow.yaml index 289ed13..5b8b666 100644 --- a/osmo/workflows/rl_es_train_workflow.yaml +++ b/osmo/workflows/rl_es_train_workflow.yaml @@ -53,7 +53,7 @@ workflow: mv /usr/share/vulkan /usr/share/vulkan_hidden fi - ${ISAACLAB_PATH}/isaaclab.sh -p -m huggingface_hub.commands.huggingface_cli login --token {{hf_token}} + python -m huggingface_hub.commands.huggingface_cli login --token {{hf_token}} # Generate your W&B API key: https://wandb.ai/authorize export WANDB_API_KEY={{wandb_api_key}} @@ -69,7 +69,7 @@ workflow: # Download and unpack the COMPASS USDs from HuggingFace. echo "Downloading compass_usds.zip from huggingface.co/nvidia/COMPASS" - ${ISAACLAB_PATH}/isaaclab.sh -p -m huggingface_hub.commands.huggingface_cli \ + python -m huggingface_hub.commands.huggingface_cli \ download nvidia/COMPASS compass_usds.zip --local-dir ./ unzip -q -o compass_usds.zip mv groot_mobility_rl_es_usds/usd ./compass/rl_env/exts/mobility_es/mobility_es/ @@ -80,7 +80,7 @@ workflow: ENVIRONMENT="$NUREC_SCENE" fi echo "Downloading $NUREC_SCENE NuRec assets from $NUREC_REVISION" - ${ISAACLAB_PATH}/isaaclab.sh -p -m huggingface_hub.commands.huggingface_cli \ + python -m huggingface_hub.commands.huggingface_cli \ download nvidia/PhysicalAI-Robotics-NuRec --repo-type dataset \ --revision "$NUREC_REVISION" \ --local-dir ./compass/rl_env/exts/mobility_es/mobility_es/usd \ @@ -96,7 +96,7 @@ workflow: # Download X-Mobility base-policy checkpoint from HuggingFace. echo "Downloading X-Mobility checkpoint from huggingface.co/nvidia/X-Mobility" - ${ISAACLAB_PATH}/isaaclab.sh -p -m huggingface_hub.commands.huggingface_cli \ + python -m huggingface_hub.commands.huggingface_cli \ download nvidia/X-Mobility x_mobility-nav2-semantic_action_path.ckpt --local-dir ./ mv x_mobility-nav2-semantic_action_path.ckpt model.ckpt @@ -104,7 +104,7 @@ workflow: RESUME_CKPT_ARTIFACT={{resume_ckpt_artifact}} if [[ -n $RESUME_CKPT_ARTIFACT ]]; then echo "Downloading resume checkpoint: $RESUME_CKPT_ARTIFACT" - ${ISAACLAB_PATH}/isaaclab.sh -p -m wandb artifact get $RESUME_CKPT_ARTIFACT --root ./resume_ckpt/ + python -m wandb artifact get $RESUME_CKPT_ARTIFACT --root ./resume_ckpt/ RESUME_CKPT=$(ls ./resume_ckpt/model_*.pt | sort -V | tail -n 1) fi @@ -112,7 +112,7 @@ workflow: # spawns its own Isaac Sim instance + env; gradients sync via manual # all-reduce in PPO.update. Total parallel envs = {{num_gpus}} * # num_envs. NuRec assets are memory-heavy, so tune --num-envs per GPU. - TRAIN_CMD="${ISAACLAB_PATH}/isaaclab.sh -p -m torch.distributed.run --nproc_per_node={{num_gpus}} run.py --distributed -c $TRAIN_CONFIG -o $OUTPUT_DIR -n {{wandb_project_name}} -r {{wandb_run_name}} --logger wandb --headless --video --num_envs {{num_envs}}" + TRAIN_CMD="python -m torch.distributed.run --nproc_per_node={{num_gpus}} run.py --distributed -c $TRAIN_CONFIG -o $OUTPUT_DIR -n {{wandb_project_name}} -r {{wandb_run_name}} --logger wandb --video --num_envs {{num_envs}}" if [[ -n $EMBODIMENT ]]; then TRAIN_CMD+=" --embodiment $EMBODIMENT" @@ -144,7 +144,7 @@ workflow: # fine for a one-shot eval at the end of training. eval_ckpt=$(ls $OUTPUT_DIR/model_*.pt | sort -V | tail -n 1) ckpt_name=$(basename "$eval_ckpt") - EVAL_CMD="${ISAACLAB_PATH}/isaaclab.sh -p run.py -c $EVAL_CONFIG -o $OUTPUT_DIR -p $eval_ckpt -n {{wandb_project_name}} -r eval_{{wandb_run_name}}_$ckpt_name --logger wandb --headless --video --video_interval 1 --num_envs {{num_envs}}" + EVAL_CMD="python run.py -c $EVAL_CONFIG -o $OUTPUT_DIR -p $eval_ckpt -n {{wandb_project_name}} -r eval_{{wandb_run_name}}_$ckpt_name --logger wandb --video --video_interval 1 --num_envs {{num_envs}}" if [[ -z $NO_RESIDUAL ]]; then EVAL_CMD+=" -b ./model.ckpt" fi diff --git a/run.py b/run.py index bed18d8..894008e 100644 --- a/run.py +++ b/run.py @@ -242,9 +242,8 @@ def _configure_kit_scene_partition(quiet=False): # Parse the arguments args_cli = parser.parse_args() if args_cli.nurec_scene is not None: - if (args_cli.environment is not None and args_cli.environment != args_cli.nurec_scene): - parser.error("--nurec-scene and --environment select different scenes. " - "For NuRec runs, pass --nurec-scene only.") + if args_cli.environment is not None: + parser.error("Pass either --nurec-scene or --environment, not both.") args_cli.environment = args_cli.nurec_scene apply_nurec_spg_kit_args(args_cli) @@ -428,7 +427,6 @@ def run( if environment not in EnvSceneAssetCfgMap: raise ValueError(f"Unsupported environment type: {environment}") env_cfg.scene.environment = EnvSceneAssetCfgMap[environment] - is_nurec_scene = environment in NurecSceneAssetCfgMap if render_interval is not None: env_cfg.sim.render_interval = render_interval if num_rerenders_on_reset is not None: @@ -507,9 +505,10 @@ def run( precompute_valid_poses=precompute_flag, precompute_valid_orientations=precompute_orientations_flag, ) - if not is_nurec_scene and "kit" in _requested_viz: + is_nurec_run = args_cli.nurec_scene is not None + if not is_nurec_run and "kit" in _requested_viz: _configure_kit_scene_partition() - if is_nurec_scene and "kit" in _requested_viz: + if is_nurec_run and "kit" in _requested_viz: configure_nurec_kit_viewport( nurec_usd_path=env_cfg.scene.environment.spawn.usd_path, spg_runtime=args_cli.spg_runtime,