Skip to content

[Camera] Split image observations into per-modality terms - #8051

Merged
StafaH merged 6 commits into
isaac-sim:developfrom
StafaH:camera-perf/02b-image-obs-refactor
Sep 26, 2026
Merged

StafaH merged 6 commits into
isaac-sim:developfrom
StafaH:camera-perf/02b-image-obs-refactor

Conversation

@StafaH

@StafaH StafaH commented Sep 26, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Merged the latest develop after #8037 landed. The diff against develop contains the per-modality image observation refactor.

mdp.image handled every camera data type in one function, and many camera tasks bypassed it with their own copies of the read, normalize, permute and frame-stack logic (Cartpole manager and direct, Cartpole showcase, Kuka Allegro vision_camera, drone VAE, stack blueprint). Normalization was spread across utils/images.py, utils/warp/ops.py, utils/warp/kernels.py and those task files.

This PR:

  • Adds per-modality observation terms image_rgb, image_depth, image_normals and image_segmentation, each with channel_first and frame_stack, and data-type validation. Depth and normals work with RayCasterCamera too.
  • Moves all camera-image math into isaaclab.utils.images: normalize_rgb (optional constant mean), normalize_depth (invalid_value, max_depth, tanh_scale), normalize_normals, normalize_segmentation, the normalize_camera_image dispatcher, the fused uint8 Warp kernels, and CameraFrameStack (layout + frame stacking + deferred uint8 normalization) shared by manager terms and direct envs.
  • Migrates in-repo mdp.image configs and the task-local copies onto the shared path. Each task keeps its existing normalization via parameters (Kuka: mean=0.5, tanh_scale=2; drone: max_depth=10).
  • Removes mdp.image. Deprecates mdp.stacked_image, isaaclab.utils.warp.ops.normalize_image_uint8 and Cartpole's CameraImageStack; these still work and forward to the new code.

Behavior changes

  • Breaking: Removed mdp.image without a deprecation wrapper. Use image_rgb, image_depth, image_normals or image_segmentation in observation term configs; replace permute=True with channel_first=True and remove clone. Direct tensor callers can use the normalizers and CameraFrameStack in isaaclab.utils.images.

  • Depth normalization also replaces NaN and -inf (not only +inf), and returns a new tensor instead of modifying the camera buffer in place.

  • Breaking: manager-based Cartpole camera config no longer has an env-level frame_stack; set env.observations.policy.image.params.frame_stack=K. Hydra overrides do not re-run __post_init__, so an env-level field could not be synced to the term. The direct env keeps its field.

  • The two raw-RGB configs that passed clone=False (GR1T2 pick-place, G1 locomanipulation) now copy once per step.

  • image_rgb keeps three channels (albedo alpha dropped).

Type of change

  • New feature (non-breaking change which adds functionality)
  • Breaking change (mdp.image removal and Cartpole manager frame_stack config field; see migration above)

Validation

  • After removing mdp.image: 20 camera-term tests and the real-camera depth reset test passed; six golden-rendering observation configurations checked. Formatting, changelog validation and warning-free documentation build passed.

  • test_images.py, test_images_fused_normalize.py (moved from test/utils/warp/test_image_ops.py), test_camera_image_mdp.py (replaces test_stacked_image_mdp.py and the Cartpole segmentation observation test): 106 passed.

  • test_camera_image_obs_manager.py (Kit, observation manager with a frame-stacked image_rgb): passed.

  • test_lift_env_cfg.py (Kuka vision_camera stationary normalization): passed.

  • Zero-agent runs, 16 envs × 20 steps: Isaac-Cartpole-Camera with rgb (6, 96, 96), depth (2, 96, 96), semantic_segmentation (8, 96, 96); Isaac-Cartpole-Camera-Direct default and depth.

  • All edited task configs import.

Checklist

  • I have run the pre-commit checks with ./isaaclab.sh --format
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • I have added changelog fragments for the changed packages

Release backport

  • Backport this pull request to the active release branch after it merges into develop

StafaH and others added 3 commits September 25, 2026 14:18
…utput

Camera rgb outputs are strided views into the RGBA buffer, so the fused
uint8 normalize rejected them and every RGB observation fell back to a
multi-pass PyTorch path. Let normalize_image_uint8 read strided input,
launch over the output layout so float writes coalesce, and write the
channel-first layout directly via output_channel_dim. mdp.image and the
Cartpole camera observations use it instead of a separate permute copy.
Replace the catch-all mdp.image with image_rgb, image_depth, image_normals
and image_segmentation, and move all camera-image normalization, frame
stacking and the fused uint8 kernels into isaaclab.utils.images. Task-local
copies (Cartpole, Kuka Allegro, drone, stack blueprint) now use the shared
normalizers with parameters that preserve their existing math. mdp.image,
stacked_image, warp.ops.normalize_image_uint8 and CameraImageStack are
deprecated.
@StafaH
StafaH requested a review from a team September 26, 2026 01:37
@github-actions github-actions Bot added documentation Improvements or additions to documentation isaac-mimic Related to Isaac Mimic team labels Sep 26, 2026
@greptile-apps

greptile-apps Bot commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 3/5

[Medium risk] Refactors camera observation terms and image normalization.

The PR should not merge until custom feature inference is isolated from the camera buffer and the Kuka raw-image layout contract is preserved or deliberately migrated.

Findings

  1. P1 Inference can overwrite camera pixels ▶
  2. P1 Raw camera layout changes ▶

Summary

The PR adds modality-specific camera observation terms, consolidates image normalization and frame stacking, and migrates task configurations to the shared pipeline.

  • Custom image-feature inference loses its defensive camera-buffer copy.
  • Disabling Kuka vision-camera normalization now also changes the observation layout.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  Camera[Camera output buffer] --> Read[Read camera output]
  Read --> Terms[Modality-specific observation terms]
  Terms --> Stack[CameraFrameStack]
  Stack --> Policy[Policy observation]
  Read --> Features[image_features]
  Features --> Custom[Custom inference]
  Read --> Kuka[Kuka vision_camera]
  Kuka --> Stack
Loading

Reviews (1) · Last reviewed commit: "Split camera image observations into per..."

normalize=False, # we pre-process based on model
)
# raw images: the model's inference function does its own pre-processing
image_data = _read_camera_output(env, sensor_cfg, data_type, convert_perspective_to_orthogonal)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Inference can overwrite camera pixels. If a custom model-zoo inference function changes its input in place, it now changes the live camera buffer: this read no longer makes the copy that image() previously provided. Other observation terms reading the same sensor can then receive incorrect pixels.

Suggested change
image_data = _read_camera_output(env, sensor_cfg, data_type, convert_perspective_to_orthogonal)
image_data = _read_camera_output(env, sensor_cfg, data_type, convert_perspective_to_orthogonal).clone()

images = images.permute(0, 3, 1, 2).contiguous()
return images
images = self.sensor.data.output[self.sensor_type].torch
return self._frames(images, self._normalize if normalize else None)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Raw camera layout changes. When vision_camera is called with normalize=False, it previously returned the raw image in channel-last layout. It now passes the image through CameraFrameStack, which moves channels first even without normalization. Consumers expecting the raw image shape will receive a different shape without changing their configuration.

Suggested change
return self._frames(images, self._normalize if normalize else None)
return self._frames(images, self._normalize) if normalize else images

@isaaclab-review-bot isaaclab-review-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isaac Lab Review Bot

The per-modality camera observation design and shared normalization/frame-stacking path are coherent, with compatibility shims and migration guidance retained. Three issues need correction: pass-through uint8 normalization can expose ring-buffer storage, image_normals validates but cannot consume configured normals data types, and the Cartpole manager helper incorrectly routes normals to image_rgb.

  • Design and architecture: Centralizing camera normalization, layout conversion, fused Warp kernels, and frame stacking removes duplicated task implementations. However, the Cartpole observation factory does not select the newly added image_normals term for normals-like outputs, causing a previously supported modality to fail during term construction.
  • API: The deprecated mdp.image, mdp.stacked_image, Warp normalization function, and Cartpole stack term retain forwarding paths, while the manager-based Cartpole frame_stack break is documented with migration guidance. The new image_normals API is internally inconsistent: construction accepts configured normals* data types, but its call signature rejects the data_type parameter and always reads "normals".
  • Implementation: The fused uint8 and normal per-modality paths preserve output lifetime, but CameraFrameStack defers every uint8 normalizer. When normalize_camera_image passes an unsupported type through unchanged, the returned observation is the ring-buffer view itself and is overwritten on the next step, contrary to the class contract and prior cloning behavior. The normals term should also read its validated configured data type rather than hard-coding "normals".

Minor fixes needed. Posted 3 actionable findings inline.

Automated review; human maintainers own approval decisions.

stacked = self._buffer.stacked
if defer_normalize:
# no ``out=``: each call allocates, so the trainer's previous observation stays intact
return normalize(stacked, channel_dim=self._channel_dim, output_channel_dim=None)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Warning · Implementation — Deferred normalization can return aliased ring buffer

For a data type that normalize_camera_image passes through (e.g. uint8 instance_segmentation), _move_channels returns its input unchanged, so this deferred branch returns stacked itself: the observation aliases ring-buffer storage that the next env.step overwrites. The replaced direct-env and stacked_image code cloned here, and this class's docstring promises the result never aliases the ring buffer. Clone when the normalizer result shares storage with its input.

channel_first: bool = False,
frame_stack: int = 1,
) -> torch.Tensor:
images = _read_camera_output(env, sensor_cfg, "normals")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Suggestion · Api — image_normals ignores configured data type

_camera_image.__init__ reads data_type from cfg.params and _accepts admits any normals* type, but __call__ hard-codes "normals" and declares no data_type argument, unlike the three sibling terms. A config that sets data_type passes construction-time validation and then fails the observation manager's parameter/signature check, and normals_object_frame can never be read. Add a data_type parameter and use it.

elif "segmentation" in data_type:
image_term = mdp.image_segmentation
else:
image_term = mdp.image_rgb

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Suggestion · Design Architecture — Normals data types fall through to image_rgb

The new dispatch routes every non-depth, non-segmentation type to image_rgb, whose _accepts rejects normals; the replaced CameraImageStack normalized it via normalize_camera_image. A normals configuration therefore now fails at term construction, and the image_normals term added by this PR is unreachable from this helper. Add an is_normals_like branch selecting mdp.image_normals (consistent with the data_type parameter passed below).

@StafaH

StafaH commented Sep 26, 2026

Copy link
Copy Markdown
Collaborator Author

Run-ci

@isaaclab-bot isaaclab-bot Bot added ci:run-docker Trigger the on-demand Docker and GPU CI workflow and removed ci:run-docker Trigger the on-demand Docker and GPU CI workflow labels Sep 26, 2026
@ooctipus

Copy link
Copy Markdown
Collaborator

run-ci

@isaaclab-bot isaaclab-bot Bot added ci:run-docker Trigger the on-demand Docker and GPU CI workflow and removed ci:run-docker Trigger the on-demand Docker and GPU CI workflow labels Sep 26, 2026
@StafaH

StafaH commented Sep 26, 2026

Copy link
Copy Markdown
Collaborator Author

run-ci

@isaaclab-bot isaaclab-bot Bot added ci:run-docker Trigger the on-demand Docker and GPU CI workflow and removed ci:run-docker Trigger the on-demand Docker and GPU CI workflow labels Sep 26, 2026
@StafaH
StafaH merged commit d9c0862 into isaac-sim:develop Sep 26, 2026
82 of 84 checks passed
@StafaH
StafaH deleted the camera-perf/02b-image-obs-refactor branch September 26, 2026 17:50
@isaaclab-bot

isaaclab-bot Bot commented Sep 26, 2026

Copy link
Copy Markdown
Contributor

Backported to release/3.0.0 as c8445b3.

isaaclab-bot Bot pushed a commit that referenced this pull request Sep 26, 2026
# Description

Merged the latest `develop` after #8037 landed. The diff against
`develop` contains the per-modality image observation refactor.

`mdp.image` handled every camera data type in one function, and many
camera tasks bypassed it with their own copies of the read, normalize,
permute and frame-stack logic (Cartpole manager and direct, Cartpole
showcase, Kuka Allegro `vision_camera`, drone VAE, stack blueprint).
Normalization was spread across `utils/images.py`, `utils/warp/ops.py`,
`utils/warp/kernels.py` and those task files.

This PR:

- Adds per-modality observation terms `image_rgb`, `image_depth`,
`image_normals` and `image_segmentation`, each with `channel_first` and
`frame_stack`, and data-type validation. Depth and normals work with
`RayCasterCamera` too.
- Moves all camera-image math into `isaaclab.utils.images`:
`normalize_rgb` (optional constant `mean`), `normalize_depth`
(`invalid_value`, `max_depth`, `tanh_scale`), `normalize_normals`,
`normalize_segmentation`, the `normalize_camera_image` dispatcher, the
fused uint8 Warp kernels, and `CameraFrameStack` (layout + frame
stacking + deferred uint8 normalization) shared by manager terms and
direct envs.
- Migrates in-repo `mdp.image` configs and the task-local copies onto
the shared path. Each task keeps its existing normalization via
parameters (Kuka: `mean=0.5`, `tanh_scale=2`; drone: `max_depth=10`).
- Removes `mdp.image`. Deprecates `mdp.stacked_image`,
`isaaclab.utils.warp.ops.normalize_image_uint8` and Cartpole's
`CameraImageStack`; these still work and forward to the new code.

## Behavior changes

- **Breaking:** Removed `mdp.image` without a deprecation wrapper. Use
`image_rgb`, `image_depth`, `image_normals` or `image_segmentation` in
observation term configs; replace `permute=True` with
`channel_first=True` and remove `clone`. Direct tensor callers can use
the normalizers and `CameraFrameStack` in `isaaclab.utils.images`.

- Depth normalization also replaces NaN and -inf (not only +inf), and
returns a new tensor instead of modifying the camera buffer in place.
- **Breaking:** manager-based Cartpole camera config no longer has an
env-level `frame_stack`; set
`env.observations.policy.image.params.frame_stack=K`. Hydra overrides do
not re-run `__post_init__`, so an env-level field could not be synced to
the term. The direct env keeps its field.
- The two raw-RGB configs that passed `clone=False` (GR1T2 pick-place,
G1 locomanipulation) now copy once per step.
- `image_rgb` keeps three channels (albedo alpha dropped).

## Type of change

- New feature (non-breaking change which adds functionality)
- Breaking change (`mdp.image` removal and Cartpole manager
`frame_stack` config field; see migration above)

## Validation

- After removing `mdp.image`: 20 camera-term tests and the real-camera
depth reset test passed; six golden-rendering observation configurations
checked. Formatting, changelog validation and warning-free documentation
build passed.

- `test_images.py`, `test_images_fused_normalize.py` (moved from
`test/utils/warp/test_image_ops.py`), `test_camera_image_mdp.py`
(replaces `test_stacked_image_mdp.py` and the Cartpole segmentation
observation test): 106 passed.
- `test_camera_image_obs_manager.py` (Kit, observation manager with a
frame-stacked `image_rgb`): passed.
- `test_lift_env_cfg.py` (Kuka `vision_camera` stationary
normalization): passed.
- Zero-agent runs, 16 envs × 20 steps: `Isaac-Cartpole-Camera` with
`rgb` (6, 96, 96), `depth` (2, 96, 96), `semantic_segmentation` (8, 96,
96); `Isaac-Cartpole-Camera-Direct` default and depth.
- All edited task configs import.

## Checklist

- [x] I have run the `pre-commit` checks with `./isaaclab.sh --format`
- [x] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [x] I have added tests that prove my fix is effective or that my
feature works
- [x] I have added changelog fragments for the changed packages

## Release backport

- [x] <!-- backport-active-release --> Backport this pull request to the
active release branch after it merges into `develop`

---------

Co-authored-by: Octi Zhang <[email protected]>

(cherry picked from commit d9c0862)
ooctipus pushed a commit that referenced this pull request Sep 28, 2026
# Description

Part 7 of the camera performance series. Based on the latest `develop`,
which now includes the rest of the series (#8036–#8041), #8051, and
#8087.

The Kuka Allegro Lift camera tasks move from the task-specific
`vision_camera` term to the shared `mdp.image_rgb`, `mdp.image_depth`,
and `mdp.image_segmentation` terms. Images stay raw in the environment,
and the policy normalizes them:

- Each camera's image term is a preset named like the camera presets
(`rgb128`, `depth64`, `raycaster_depth256`, ...), so one preset such as
`presets=duo_camera,rgb128` selects both the camera and its matching
term. The terms use `normalize=False, channel_first=True` and emit raw
images. RGB terms drop albedo's unused alpha channel.
- The observation manager's copy skipping from #8038 applies
automatically: `image_rgb` writes into a manager-owned output, so each
image is copied once per step and not cloned again.
- `SpatialSoftmaxCNNModel` applies the fixed-range normalization the
task used before: `x / 255 - 0.5` for color, and `tanh(depth / 2) - 0.5`
with NaN treated as far for depth.
- A single `addcmul` pass does the conversion; separate cast, scale, and
shift passes made the PPO update slower than the float32 baseline.
- Image groups that are neither uint8 nor floating point, such as
non-colorized segmentation labels, raise an error when the model is
built instead of being normalized as depth.
- The JIT and ONNX exports take raw images: uint8 for color. The
normalizer has no state-dict entries, so existing RGB and depth
checkpoints load unchanged. Keep the compatibility `vision_camera` term
for existing four-channel albedo policies, or retrain with three-channel
albedo observations.
- Color images stay uint8 in rollout storage, which cuts rollout image
memory 4x and makes minibatch gathers cheaper.
- The spatial soft-argmax uses one matmul instead of two broadcast
products and sums. It keeps the `pos_x`/`pos_y` buffers for checkpoint
compatibility.
- The camera runners set `check_for_nan=False`. RSL-RL's per-group NaN
scan reads every image and synchronizes with the host each step, and
uint8 images cannot be NaN.

Updated for the merged series: the earlier `clone_output` term setting
was removed, because #8038 landed with automatic copy skipping instead
of a configuration flag.

## Series

1. #8036: Read camera outputs through `ProxyArray.torch` (bug fix) —
merged
2. #8037: Fused normalization for strided camera images — merged
3. #8038: Skip redundant observation copies — merged
4. #8039: Remove per-step host synchronizations — merged
5. #8040: Newton `render_batch` in one sensor-graph launch — merged
6. #8041: RSL-RL cuDNN benchmark, mixed precision and compile settings —
merged
7. #8042: Kuka Allegro camera tasks on the shared image observation
(this PR, base: develop)

The series is split from #7440, which remains the combined reference
branch.

## Type of change

- Breaking change (existing functionality will not work without user
modification). Exported Kuka camera policies now take raw images, and
albedo observations have three channels. See the changelog for
migration.

## Performance

RTX PRO 6000 Blackwell Workstation Edition (driver 595.91.07); PyTorch
2.12.0+cu130; Warp 1.17.0; Newton 1.6.0; GPU otherwise idle. `develop`
at `60bc09f17` compared with this PR (`bb10c5e0b`), with the same
`uv.lock`. `isaaclab benchmark training --rl_library rsl_rl`,
`Isaac-Lift-KukaAllegro-Camera`, 256 environments,
`presets=duo_camera,rgb128`, `physics=newton_mjwarp`,
`renderer=newton_renderer`, 24 PPO iterations, seed 42, no visualizer.
Three fresh processes per revision, run in alternating order; figures
are means across processes.

| Metric | `develop` | This PR | Change |
| --- | ---: | ---: | ---: |
| Training throughput (higher is better) | 11,020 steps/s | 11,191
steps/s | +1.6% |
| PPO iteration (lower is better) | 0.795 s | 0.775 s | −2.5% |
| Environment step (lower is better) | 14.03 ms | 13.84 ms | −1.4% |
| Peak GPU memory, whole device (lower is better) | 7.12 GB | 4.73 GB |
**−34%** |

Per-process iteration times (`develop` → PR): `0.804, 0.790, 0.792` →
`0.772, 0.776, 0.777` s.

The iteration means include PPO warmup, and GPU memory is the
device-level figure, including Warp and Newton allocations. This is a
short steady-state check, not a convergence test.

## Validation

- `test_lift_env_cfg.py`: 13 passed. These include the configured RGB,
depth, albedo, and semantic-segmentation terms for both cameras, with
the model's fixed normalization.
- RSL-RL training smoke tests, Newton/MJWarp with the Newton renderer,
64 environments: `duo_camera,rgb128` (3 iterations) and
`duo_camera,depth128` (2 iterations) train without errors.
- Export check on the RGB checkpoint: `isaaclab play` writes `policy.pt`
and `policy.onnx`. The ONNX graph declares both images as `uint8 [1, 3,
128, 128]`. The JIT export accepts raw uint8 images and returns finite
actions, and ONNX Runtime matches the JIT export within `1.2e-6`.
- `uv run --frozen isaaclab -f` passes, including changelog checks.

## Release backport

- [x] <!-- backport-active-release --> Backport this pull request to the
active release branch after it merges into `develop`
isaaclab-bot Bot pushed a commit that referenced this pull request Sep 28, 2026
# Description

Part 7 of the camera performance series. Based on the latest `develop`,
which now includes the rest of the series (#8036–#8041), #8051, and
#8087.

The Kuka Allegro Lift camera tasks move from the task-specific
`vision_camera` term to the shared `mdp.image_rgb`, `mdp.image_depth`,
and `mdp.image_segmentation` terms. Images stay raw in the environment,
and the policy normalizes them:

- Each camera's image term is a preset named like the camera presets
(`rgb128`, `depth64`, `raycaster_depth256`, ...), so one preset such as
`presets=duo_camera,rgb128` selects both the camera and its matching
term. The terms use `normalize=False, channel_first=True` and emit raw
images. RGB terms drop albedo's unused alpha channel.
- The observation manager's copy skipping from #8038 applies
automatically: `image_rgb` writes into a manager-owned output, so each
image is copied once per step and not cloned again.
- `SpatialSoftmaxCNNModel` applies the fixed-range normalization the
task used before: `x / 255 - 0.5` for color, and `tanh(depth / 2) - 0.5`
with NaN treated as far for depth.
- A single `addcmul` pass does the conversion; separate cast, scale, and
shift passes made the PPO update slower than the float32 baseline.
- Image groups that are neither uint8 nor floating point, such as
non-colorized segmentation labels, raise an error when the model is
built instead of being normalized as depth.
- The JIT and ONNX exports take raw images: uint8 for color. The
normalizer has no state-dict entries, so existing RGB and depth
checkpoints load unchanged. Keep the compatibility `vision_camera` term
for existing four-channel albedo policies, or retrain with three-channel
albedo observations.
- Color images stay uint8 in rollout storage, which cuts rollout image
memory 4x and makes minibatch gathers cheaper.
- The spatial soft-argmax uses one matmul instead of two broadcast
products and sums. It keeps the `pos_x`/`pos_y` buffers for checkpoint
compatibility.
- The camera runners set `check_for_nan=False`. RSL-RL's per-group NaN
scan reads every image and synchronizes with the host each step, and
uint8 images cannot be NaN.

Updated for the merged series: the earlier `clone_output` term setting
was removed, because #8038 landed with automatic copy skipping instead
of a configuration flag.

## Series

1. #8036: Read camera outputs through `ProxyArray.torch` (bug fix) —
merged
2. #8037: Fused normalization for strided camera images — merged
3. #8038: Skip redundant observation copies — merged
4. #8039: Remove per-step host synchronizations — merged
5. #8040: Newton `render_batch` in one sensor-graph launch — merged
6. #8041: RSL-RL cuDNN benchmark, mixed precision and compile settings —
merged
7. #8042: Kuka Allegro camera tasks on the shared image observation
(this PR, base: develop)

The series is split from #7440, which remains the combined reference
branch.

## Type of change

- Breaking change (existing functionality will not work without user
modification). Exported Kuka camera policies now take raw images, and
albedo observations have three channels. See the changelog for
migration.

## Performance

RTX PRO 6000 Blackwell Workstation Edition (driver 595.91.07); PyTorch
2.12.0+cu130; Warp 1.17.0; Newton 1.6.0; GPU otherwise idle. `develop`
at `60bc09f17` compared with this PR (`bb10c5e0b`), with the same
`uv.lock`. `isaaclab benchmark training --rl_library rsl_rl`,
`Isaac-Lift-KukaAllegro-Camera`, 256 environments,
`presets=duo_camera,rgb128`, `physics=newton_mjwarp`,
`renderer=newton_renderer`, 24 PPO iterations, seed 42, no visualizer.
Three fresh processes per revision, run in alternating order; figures
are means across processes.

| Metric | `develop` | This PR | Change |
| --- | ---: | ---: | ---: |
| Training throughput (higher is better) | 11,020 steps/s | 11,191
steps/s | +1.6% |
| PPO iteration (lower is better) | 0.795 s | 0.775 s | −2.5% |
| Environment step (lower is better) | 14.03 ms | 13.84 ms | −1.4% |
| Peak GPU memory, whole device (lower is better) | 7.12 GB | 4.73 GB |
**−34%** |

Per-process iteration times (`develop` → PR): `0.804, 0.790, 0.792` →
`0.772, 0.776, 0.777` s.

The iteration means include PPO warmup, and GPU memory is the
device-level figure, including Warp and Newton allocations. This is a
short steady-state check, not a convergence test.

## Validation

- `test_lift_env_cfg.py`: 13 passed. These include the configured RGB,
depth, albedo, and semantic-segmentation terms for both cameras, with
the model's fixed normalization.
- RSL-RL training smoke tests, Newton/MJWarp with the Newton renderer,
64 environments: `duo_camera,rgb128` (3 iterations) and
`duo_camera,depth128` (2 iterations) train without errors.
- Export check on the RGB checkpoint: `isaaclab play` writes `policy.pt`
and `policy.onnx`. The ONNX graph declares both images as `uint8 [1, 3,
128, 128]`. The JIT export accepts raw uint8 images and returns finite
actions, and ONNX Runtime matches the JIT export within `1.2e-6`.
- `uv run --frozen isaaclab -f` passes, including changelog checks.

## Release backport

- [x] <!-- backport-active-release --> Backport this pull request to the
active release branch after it merges into `develop`

(cherry picked from commit f25d3f0)
qianl-nv added a commit to isaac-sim/IsaacLab-Arena that referenced this pull request Oct 23, 2026
Update Arena to the Isaac Lab 3.0.0 GA pin and Isaac Sim 6.2. Keep the
Isaac Sim base image while installing the pinned Lab and Arena source
trees from their frozen uv locks.

## Why this change?

Arena was on Lab 3.0 EA and Isaac Sim 6.1. Update to the [Isaac Lab
v3.0.0
release](https://github.com/isaac-sim/IsaacLab/releases/tag/v3.0.0),
pinned at
[`e3f7d9ff1f5d7f8280de3ece9000b7117f66bcf4`](isaac-sim/IsaacLab@e3f7d9f),
and adapt Arena to its released APIs and dependencies.

## What changes?

### Docker and uv workflow

- Follow the uv-based Docker installation introduced by Isaac Lab [PR
#7405](isaac-sim/IsaacLab#7405) and [commit
`eed50f77c53`](isaac-sim/IsaacLab@eed50f77c53),
while retaining Arena's Isaac Sim base-image stages and editable Lab
source.
- Interactive container shells alias `python` and `python3` to
`isaaclab.sh -p`, and `pytest` to `isaaclab.sh -p -m pytest`, so
commands initialize Isaac Sim and execute from `/opt/isaaclab-venv`.
- Non-interactive runtime and CI commands invoke `isaaclab.sh -p`
explicitly; build-time package operations use `uv pip` or
`/opt/isaaclab-venv/bin/python`. `/isaac-sim/python.sh` is no longer a
supported Arena entry point because it bypasses the Lab launcher and the
locked Lab virtual environment.
- Continue building from the Isaac Sim 6.2 image. Copy in uv 0.12.9 and
create `/opt/isaaclab-venv` with Isaac Sim's Kit Python.
- Sync third-party dependencies from the pinned Isaac Lab submodule's
frozen `uv.lock`. The metadata-only stage skips all local path packages;
after the complete submodule is copied, a second sync installs its
editable packages.
- Overlay Arena's non-Lab dependencies from Arena's frozen lock with `uv
sync --inexact`, then install Arena editable into the same environment.
- Pin uv 0.12.9 in Docker and native CI. Regenerating the lockfile with
the newer serializer puts Arena's Linux x86_64 constraint in top-level
`resolution-markers` and `supported-markers` and remove it from uv lock
edges.

### Torch 2.11 and CUDA 13 handling

- Isaac Lab [PR #8372](isaac-sim/IsaacLab#8372)
deliberately selects Torch 2.11.0 on CUDA 13.0. Torch 2.12's CUDA 13
NCCL 2.29 can fail beside Kit RTX or OVRTX on Blackwell because of a
driver shared-memory accounting issue. Torch 2.11 uses NCCL 2.28.9 and
avoids that failure while retaining Isaac Lab's
deferred-CUDA-initialization workaround.
- Native uv routes `torch==2.11.0` and `torchvision==0.26.0` to the
`cu130` PyTorch index. Docker takes those versions from Lab's frozen
lock instead of duplicating them in a hand-written constraint list.
Arena drops its direct `torchaudio` dependency, matching Lab.
- Build cuRobo with the CUDA 13.0 toolkit and
`CUDA_HOME=/usr/local/cuda-13.0`, matching PyTorch's CUDA major version.

### Other API and released-stack changes

- **Environment reset selectors — Lab [PR
#8030](isaac-sim/IsaacLab#8030) and [PR
#8015](isaac-sim/IsaacLab#8015 accept Lab's
tensor, slice, and `None` environment selections in Arena's environment
and recorder reset paths. This is API compatibility, no behavior change.
- **Camera observations — Lab [PR
#8051](isaac-sim/IsaacLab#8051 replace the
removed generic `mdp.image` term with the RGB, depth, normals, or
segmentation observation function selected for each modality.
Unsupported data types now fail explicitly.
- **Newton camera pose propagation — Lab [issue
#7676](isaac-sim/IsaacLab#7676), [PR
#7691](isaac-sim/IsaacLab#7691), and release
backport [PR #7935](isaac-sim/IsaacLab#7935
Lab 3.0 now mirrors Newton `FrameView` pose writes into Fabric so RTX
sees camera movement. Remove Arena [PR
#1196](#1196) and its
`CameraPoseWriter` USD workaround. Camera-extrinsics variations now use
Lab `set_local_poses()` directly; retained tests cover rendered images
and reported poses under PhysX and Newton with Fabric enabled and
disabled.
- **Runtime camera intrinsics — Lab [PR
#7916](isaac-sim/IsaacLab#7916 replace
private USD sensor access and `_update_intrinsic_matrices()` with
`Camera.set_intrinsic_matrices()`. Lab's ordinary pinhole runtime API
enforces square pixels, so Arena now samples one focal-length delta and
applies it to both `fx` and `fy`. **Note:** intrinsics variation has an
pre-existing bug before this Lab upgrade which results in env_0 camera
params being used for all parallel envs. Fix will go in a separate PR.
- **Clone-plan topology — Lab [PR
#8045](isaac-sim/IsaacLab#8045), backported in
[PR #8073](isaac-sim/IsaacLab#8073 resolve
representative scene geometry through asset-prototype IDs, prototype
paths, and clone-plan topology instead of the removed
`cloner.query.iter_sources()` helper. arena_world_scene_access.py was
updated to essentially re-implement the removed helper.
- **Franka presets — Lab [PR
#8169](isaac-sim/IsaacLab#8169) and [PR
#8170](isaac-sim/IsaacLab#8170 select
`FRANKA_PANDA_LEGACY_CFG` and `FRANKA_PANDA_LEGACY_HIGH_PD_CFG`
explicitly after Lab made the flat Franka asset the default and
introduced shared minimal presets. This keeps Arena's nested `/panda`
hierarchy, legacy joint names, and existing actuator grouping.
- **Replicator kitchen USD — Isaac Sim 6.2 asset update:** update tests
for `kitchen_peninsula.usda`, which now exposes 50 physics roots instead
of 56. Its `_OnlineVisual` physics roots decrease from 24 to 18, and the
previously discovered `_OnlineVisual` articulation is no longer present.
- Unit test pick and place success speed thresholds were relax due to
large observed residual speed. Root cause unknown yet.

## Validation

Passing local checks:

- `uv lock --check --no-python-downloads` with uv 0.12.9
- Docker build and Isaac Sim startup/import smoke checks with Torch
2.11.0+cu130 and NCCL 2.28.9
- All RL and IL sample workflow replay and inference commands are
validated and producing expected success rate.

---------

Signed-off-by: Qian Lin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation isaac-mimic Related to Isaac Mimic team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants