Skip to content

[Warp] Part 1a/8: Resolve id and mask selections through shared helpers - #8821

Merged
hujc7 merged 37 commits into
isaac-sim:mainfrom
hujc7:jichuanh/id-mask
Nov 13, 2026
Merged

hujc7 merged 37 commits into
isaac-sim:mainfrom
hujc7:jichuanh/id-mask

Conversation

@hujc7

@hujc7 hujc7 commented Oct 26, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Id and mask selections in the Newton, OVPhysX and PhysX assets, the camera and the wrench composer resolve through main's resolve_1d_mask and a new resolve_ids, both in isaaclab.utils.warp.memory, instead of hand-written copies (−907 / +410 source lines). Newton mask writers that converted masks to ids now write through the mask: the fixed-tendon setters are 2.7-5.4x faster.

Description

Update (2026-11-12): a Newton model-property write recorded into a graph capture now refreshes the solver on every replay, not only the first (NewtonManager.add_model_change records the refresh inside a capture); merged main 616f517707d.

Update (2026-11-10): a mask longer than its destination raises instead of being written past the end (the Newton fixed-tendon writer launches over the mask), and the PhysX and rigid-object selection docstrings say ids come first, as resolve_ids does. The all_ids=slice(None) form of resolve_ids leaves this PR for the part that first uses it.

1. Changes

  1. Helpers (isaaclab/utils/warp/memory.py, next to main's resolve_1d_mask): new resolve_ids (ids or a boolean mask → ids on the device of the caller's all-ids array; callers that need contiguous int32 ids pass the result through main's resolve_1d_indices, as main's indexed writers do). resolve_1d_mask takes scratch_mask as optional again: a mask passed without one is used as given when it is not longer than the destination, so a shorter mask writes only the rows it covers, as main's Newton mask writers do; a longer mask raises with or without a scratch mask. New write_2d_with_mask writes a scalar or a 2-D array into a buffer where an env mask and an item mask are both true, launching main's masked copy and fill kernels over the mask lengths on the output's device (torch vector data with strided components goes through scalar views, without a copy); the Newton articulation and collection mask writers use it.
  2. All assets, Camera and WrenchComposer use them, so every selection accepts the same inputs: integer sequences, negative-step slices, ids on another device. A ProxyArray raises TypeError.
  3. Newton writes without a host sync: the fixed-tendon mask setters write through the masks; joint-coordinate writes reuse a scratch mask. The RigidObjectCollection mask writers (main's, since [Newton] Redesign Newton Manager [2c-ii/N] #8870) launch over the mask lengths like the other Newton mask writers, so a mask shorter than the asset dimension writes only the rows it covers.
  4. Fixes: the deformable write_nodal_*_to_sim_mask writers raised whenever env_mask was given (OVPhysX, PhysX); the Newton fixed-tendon mask setters accepted data of the wrong shape; a Newton model-property write recorded into a graph capture (such as the fixed-tendon mask writer, now capturable) left the solver on the first replay's values, because NewtonManager.add_model_change only queued the refresh on the host.

2. Performance (MEASURED)

8gpu L40, Newton contract mocks, 4096 envs, host µs per call including the GPU wait, main 299af193136 against this PR
at b75b5a81585 (same source as the head but for main's #8971), 3 alternated runs per arm.

Write main this PR
Fixed-tendon stiffness mask, half envs, 2 tendons 455 84 5.4x
Fixed-tendon position limit mask, all 216 80 2.7x
Fixed-tendon position limit mask, half envs, 2 tendons 393 84 4.7x
write_fixed_tendon_properties_to_sim_mask, all 373 124 3.0x
write_fixed_tendon_properties_to_sim_mask, half envs, 2 tendons 573 127 4.5x
Joint position index write, half envs 290 249 1.17x
Joint state index write, half envs 321 281 1.14x
Joint position mask write; collection pose and velocity mask writes within ±1%

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Screenshots

Not applicable.

Checklist

Docker and GPU tests run on demand. Push the commits you want tested, then
comment run-ci on the pull request.

  • I have read and understood the contribution guidelines
  • I have run the pre-commit checks with uv run isaaclab --format
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have validated the changed behavior with focused coverage and applied the test-audit criteria to any test changes
  • I have added a changelog fragment under source/<pkg>/changelog.d/ for every touched package (do not edit CHANGELOG.rst or bump package versions — CI handles that)
  • I have added my name to the CONTRIBUTORS.md or my name already exists there

@hujc7

hujc7 commented Oct 26, 2026

Copy link
Copy Markdown
Collaborator Author

run-ci

@github-actions github-actions Bot added the isaac-lab Related to Isaac Lab team label Oct 26, 2026
@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 Oct 26, 2026
@hujc7

hujc7 commented Oct 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 Oct 26, 2026
hujc7 added 6 commits October 26, 2026 02:48
…pers

resolve_ids resolves ids or a boolean mask to ids on a device, as resolve_1d_mask does to a mask. resolve_1d_mask takes an optional scratch mask, copies a Warp mask on another device, and accepts a boolean torch mask on its device inside a graph capture. The experimental package now re-exports it instead of keeping a copy.
…red helpers

SensorBase, Camera and WrenchComposer resolve env_ids, env_mask and body_ids through resolve_ids and resolve_1d_mask instead of their own copies. The test doubles that build these objects without their initializer get the env masks a real sensor creates.
The nodal mask writers of BaseDeformableObject, which the OVPhysX deformable object inherits, and of the PhysX deformable object called wp.nonzero on a Warp array, which raised a RuntimeError. They now resolve the mask to ids with resolve_ids and call the index writers.
…sk writers through masks

The Newton assets resolve ids and masks through resolve_ids and resolve_1d_mask. The RigidObjectCollection mask writers and the fixed-tendon mask setters write through the masks instead of converting them to ids, which waited for the GPU on every call; the joint-coordinate writes reuse a scratch mask; one generic masked 2-D write kernel replaces two copies.
The OVPhysX assets resolve env, body, joint and tendon selections through resolve_ids and resolve_1d_mask instead of their own copies.
The PhysX assets resolve env, body, joint and tendon selections through resolve_ids and resolve_1d_mask instead of their own copies. The sensor test doubles get the env masks a real sensor creates.
@hujc7

hujc7 commented Oct 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 Oct 26, 2026
hujc7 added a commit to hujc7/IsaacLab that referenced this pull request Oct 26, 2026
…-native

isaac-sim#8821 owns the Newton mask writers: the collection write_body_*_to_sim_mask methods,
the fixed-tendon mask setters and their shared masked-copy kernel. This branch takes
its version of those and keeps only the reset-mask plumbing and the tendon-target
capture fix in the shared files.
@hujc7 hujc7 changed the title Resolve id and mask selections through shared helpers [Warp] Part 1/8: Resolve id and mask selections through shared helpers Oct 26, 2026
@hujc7
hujc7 marked this pull request as ready for review October 26, 2026 16:57
@hujc7
hujc7 requested a review from a team October 26, 2026 16:57
@hujc7

hujc7 commented Nov 10, 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 Nov 10, 2026
@hujc7

hujc7 commented Nov 10, 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 Nov 10, 2026
@hujc7 hujc7 changed the title [Warp] Part 1/11: Resolve id and mask selections through shared helpers [Warp] Part 1a/8: Resolve id and mask selections through shared helpers Nov 10, 2026
…l_ids to its first user

resolve_1d_mask now rejects a boolean mask longer than all_mask with or without a scratch_mask, so the Newton fixed-tendon writer, which launches over the mask length, can no longer write past its rows; shorter masks stay allowed without a scratch mask. resolve_ids drops the all_ids=slice(None) form, which nothing in this part calls. The PhysX selection helpers and resolve_1d_mask describe the behaviour they have.
@hujc7

hujc7 commented Nov 10, 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 Nov 10, 2026

@maxkra15 maxkra15 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.

Tendon writes leave the real solver stale after the second graph replay. Please fix the refresh path. This is inherited by #8824 and #6646.

Comment on lines +2990 to +2991
# the solver keeps its own copy of the tendon properties and only re-reads them when notified
self._backend_manager.add_model_change(ModelFlags.TENDON_PROPERTIES)

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.

Record the solver refresh on every replay. add_model_change() only updates a Python set during capture. The first eager step flushes and clears it.

Reproduced with pinned Newton and physics steps between replays: replay1 updates bound/solver stiffness to12; replay2 updates the bound value to25 but the MuJoCo solver stays at12. Capturing the owning refresh fixes it.

Make this notification replay-aware. Add two write-graph replays separated by physics steps; check solver.mjw_model, not only the bound array.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Fixed in e6e178c: inside a graph capture, add_model_change now records the solver refresh for that change, so every replay applies it. test_fixed_tendon_mask_writer_reaches_solver_on_every_replay replays the write twice with physics steps in between and checks solver.mjw_model (fails on the previous head: 12 vs 34).

add_model_change only queued the change on the host, so a write recorded
into a graph capture refreshed the solver once: the first step after the
capture flushed the queue and later replays left the solver on the old
values. Inside a capture it now records the refresh of that change, and
changes queued before the capture stay queued for the next step.
@hujc7

hujc7 commented Nov 12, 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 Nov 12, 2026
@hujc7
hujc7 requested a review from maxkra15 November 13, 2026 08:48
@hujc7
hujc7 merged commit 3e5ceeb into isaac-sim:main Nov 13, 2026
63 of 91 checks passed
hujc7 added a commit that referenced this pull request Nov 15, 2026
…ks (#8824)

## Review Map

- A number is one feature and its letters are that feature's PRs, in
merge order; an arrow points from a PR to the PRs that build on it.
- A stacked PR's page shows the cumulative diff of its dependency chain;
the "Exact changes" link opens that PR's Files changed page on its own
changes (parent head to PR head).
- #8783 and #6607 are no longer part of the series.

| PR | Status | Depends on | Exact changes |
|---|---|---|---|
| #8821 Part 1a/8: shared id and mask helpers, mask writers without host
sync |
![](https://img.shields.io/github/pulls/detail/state/isaac-sim/IsaacLab/8821?label=)
| — | — |
| 📌 #8824 Part 1b/8: PhysX tendon mask setters through the masks |
![](https://img.shields.io/github/pulls/detail/state/isaac-sim/IsaacLab/8824?label=)
| 1a | — |
| #8997 Part 2b/8: actuator networks reset by mask |
![](https://img.shields.io/github/pulls/detail/state/isaac-sim/IsaacLab/8997?label=)
| 1a | — |
| #8856 Part 3a/8: env origins as a ProxyArray, `SceneEntityCfg` Warp
selections |
![](https://img.shields.io/github/pulls/detail/state/isaac-sim/IsaacLab/8856?label=)
| 2b |
[link](https://github.com/isaac-sim/IsaacLab/pull/8856/changes/1a3ef00daac107596034140a6a36633fec2a5f65..401b0191f04f6480c1ed03deffdd966f9f469009)
|
| #8228 Part 3b/8: ray caster camera frames as a ProxyArray, Rough
velocity tasks (re-cut not pushed yet) |
![](https://img.shields.io/github/pulls/detail/state/isaac-sim/IsaacLab/8228?label=)
| 3a | — |
| #8998 Part 4a/8: recording utilities, lazy buffers correct under
recording |
![](https://img.shields.io/github/pulls/detail/state/isaac-sim/IsaacLab/8998?label=)
| 3a |
[link](https://github.com/isaac-sim/IsaacLab/pull/8998/changes/9d74ad2de08a152312833dbe3ad9260b02f683b0..0e2a77d842051fb3946feb988f2e14d010aac3fb)
|
| Parts 4b-4h/8: the Warp frontend on the stable managers (not opened) |
— | 4a | — |
| Part 5/8: OVPhysX on the Warp frontend (not opened) | — | 4h | — |
| Part 6/8: Warp noise model with an additive bias (not opened) | — | 4h
| — |
| #7012 Part 7/8: `--video` on the Warp frontend (re-cut not pushed yet)
|
![](https://img.shields.io/github/pulls/detail/state/isaac-sim/IsaacLab/7012?label=)
| 4h | — |
| Part 8a/8: Direct Warp environment step (not opened) | — | 5, 7 | — |
| #6582 Part 8b/8: Shadow Hand Warp twin, Allegro twin fix (re-cut not
pushed yet) |
![](https://img.shields.io/github/pulls/detail/state/isaac-sim/IsaacLab/6582?label=)
| 8a | — |
| #8861 [DO-NOT-MERGE] all parts combined for review |
![](https://img.shields.io/github/pulls/detail/state/isaac-sim/IsaacLab/8861?label=)
| ALL | — |

```mermaid
---
config:
  look: neo
  flowchart:
    curve: basis
---
flowchart TD
  A1("<b>#8821</b> · 1a<br/>id/mask helpers")
  B1("📌 <b>#8824</b> · 1b<br/>PhysX tendon masks")
  B2("<b>#8997</b> · 2b<br/>actuator net reset")
  A3("<b>#8856</b> · 3a<br/>env origins, Warp selections")
  B3("<b>#8228</b> · 3b<br/>Rough velocity")
  A4("<b>#8998</b> · 4a<br/>recording utilities")
  P4("4b-4h<br/>Warp frontend on the stable managers")
  P5("5<br/>OVPhysX")
  P6("6<br/>noise model")
  P7("<b>#7012</b> · 7<br/>--video")
  A8("8a<br/>Direct env step")
  B8("<b>#6582</b> · 8b<br/>Shadow twin")
  A1 --> B1
  A1 --> B2
  B2 --> A3
  A3 --> B3
  A3 --> A4
  A4 --> P4
  P4 --> P5
  P4 --> P6
  P4 --> P7
  P5 --> A8
  P7 --> A8
  A8 --> B8
  style B1 stroke-width:3px
```

## Summary

The 11 PhysX tendon `set_*_mask` setters no longer turn their masks into
ids with a GPU→host wait: they fill the tendon buffers through the
masks, 83-91 → 18.5 µs per call (5x) with half the environments
selected.

# Description

The setters only fill Isaac Lab's tendon buffers; the push to PhysX
stays index based in `write_*_tendon_properties_to_sim_*`. Each setter
now resolves its masks, checks the shape and launches a masked kernel,
as the Newton setters do.

- MEASURED (desk RTX PRO 6000, PhysX, 4096 envs, half selected): 5x for
stiffness, damping, limit stiffness, rest length and offset; 4.5x for
position limit and target; unchanged with all environments selected.
- No task calls these setters per step, so task FPS does not change.

## Type of change

- New feature (non-breaking change which adds functionality)

## Screenshots

Not applicable.

## Checklist

Docker and GPU tests run on demand. Push the commits you want tested,
then
comment `run-ci` on the pull request.

- [x] I have read and understood the [contribution
guidelines](https://isaac-sim.github.io/IsaacLab/main/source/refs/contributing.html)
- [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with
`uv run isaaclab --format`
- [ ] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [x] I have validated the changed behavior with focused coverage and
applied the [test-audit
criteria](https://github.com/isaac-sim/IsaacLab/blob/HEAD/skills/developer/test-audit/SKILL.md)
to any test changes
- [x] I have added a changelog fragment under
`source/<pkg>/changelog.d/` for every touched package (do **not** edit
`CHANGELOG.rst` or bump package versions — CI handles that)
- [x] I have added my name to the `CONTRIBUTORS.md` or my name already
exists there
hujc7 added a commit that referenced this pull request Dec 3, 2026
…#8997)

## Summary

- A Warp graph alone (no Torch stream alignment) records the whole
`compute` of both network actuators (`ActuatorNetMLP` and
`ActuatorNetLSTM`, now both on Warp-NN) and every masked reset of the
actuator networks and the ray-caster drift. Both actuators are
`capturable`.
- Per `compute` call against `main` eager: in a Warp graph, Go1 MLP
377.5 → 82.0 µs and ANYdrive LSTM 686.1 → 76.6 µs at 4096 envs; run
eagerly, on par or faster (E3, E4).
- Env step against `main`: unchanged (E5). With the default
`use_newton_actuators=True`, Newton's own actuator runs these networks,
so this PR's actuators run when Newton actuators are disabled.

## Dependencies

| # | Item | State |
|---|---|---|
| D1 | The env step does not record these actuators yet: velocity tasks
keep the Isaac Lab actuator path eager (their contact sensor samples
between physics steps, so the physics does not take over the actions;
`ActuatorCollection.is_graphable` excludes explicit groups) | follow-up
|
| D2 | warp-nn 0.5.0 (released 2026-11-29) runs both networks (0.4.1
rejects the LSTM export's `Slice`); this PR requires `warp-nn>=0.5.0` |
done |
| D3 | `ActuatorNetLSTM` on Warp-NN | done in this PR |
| D4 | With the default `use_newton_actuators=True`, Newton runs the
network from a Torch `.pt2` export, which Newton cannot capture; handing
it ONNX instead, with the shipped checkpoints moved to ONNX so both
paths load only `.onnx` (no export at load) | follow-up |

# Description

| # | Change | Where |
|---|---|---|
| C1 | MLP `compute` = history kernel (shift + scaled network input) →
Warp-NN → scale + DC motor clip kernel; efforts in preallocated Warp
buffers, `computed_effort`/`applied_effort` stay Torch views |
`actuator_net.py`, `actuator_kernels.py` |
| C2 | LSTM `compute` = input kernel → Warp-NN → new hidden and cell
states copied into their state buffers → the same clip kernel; `sea_*`
stay Torch views of the Warp buffers | `actuator_net.py` |
| C3 | Shared base `ActuatorNetBase`: network file check,
computed-effort buffer, network loading, scale + clip launch |
`actuator_net.py` |
| C4 | Network file: `.onnx` loaded by its local path, so weights the
exporter stores next to it (`.onnx.data`) resolve (with
`use_newton_actuators=False` only; the native path names the flag when
it gets a non-TorchScript file); a TorchScript file is exported to ONNX
at load for the actuator's batch (the LSTM reads its layer count and
hidden size from the weights, so traced checkpoints load). When Warp-NN
cannot run a TorchScript network (an unsupported operator, or any ONNX
export error), Torch runs the module as before, with a `FutureWarning`
naming the file and operator: deprecated, that actuator instance is not
`capturable`, and `network` stays the TorchScript module. Such an ONNX
file fails with a `ValueError` naming the file. Otherwise `network` is
the Warp-NN runtime (**breaking**; no caller in the repo) |
`actuator_net.py`, `actuator_net_cfg.py`, `utils/io/onnx.py`,
`schemas_actuators.py` |
| C5 | Masked resets in Warp kernels (LSTM states, MLP histories);
`env_ids` keep `main`'s Torch path | `actuator_net.py` |
| C6 | Both actuators `capturable`: drops the opt-outs `main` added in
#9120 | `actuator_net.py` |
| C7 | The network actuators' kernels sit in the actuators package's
kernel module, in their own section | `actuator_kernels.py` |
| C8 | `DCMotor` clips its effort with the network actuators'
`dc_motor_clip` kernel into a preallocated buffer (`applied_effort` is
its Torch view), so the torque-speed envelope lives in one place (E6) |
`actuator_pd.py`, `actuator_kernels.py` |
| C9 | Ray-caster drift resampled from per-env Warp RNG states, seeded
once when the rays initialize from the env seed and the sensor's prim
path and offset; a later `env.reset(seed=...)` does not restart the
drift | `base_ray_caster.py`, `ray_caster/kernels.py`,
`utils/warp/kernels.py::initialize_rng_state` |
| C10 | Test LSTM fixtures take the last time step with `squeeze`
(Warp-NN 0.5.0 has no `Gather`); a `CumSum` head pins the Torch fallback
of both actuators (LSTM state carry, MLP history window, partial resets,
as the Warp-NN path) and the ONNX load error; actuator concepts page
describes the network file | `actuator_equivalence.py`,
`test_dc_motor.py`, `test_actuator_net.py`, `concepts/actuators.rst` |
| C11 | New dependency `warp-nn>=0.5.0` | `pyproject.toml`, `uv.lock` |
| C12 | MDP2 reads `capturable` from the actuator instance, so it
refuses an actuator whose network Torch runs; `ActuatorBase.capturable`
says an instance may turn it off | `mdp2_scene_data.py`,
`actuator_base.py` |

## Known limitations

| # | Case | Behaviour |
|---|---|---|
| L1 | A network whose Warp-NN warm-up fails at the actuator's batch:
the shipped ANYdrive LSTM at 1 env × 1 joint (Warp-NN's `Squeeze` has no
0-D output) | raises `NotImplementedError` instead of falling back;
`main` ran it with Torch. No task reaches a batch of 1 (ANYdrive groups
have 12 joints); reported to Warp-NN |
| L2 | `compute` called inside a non-default Torch stream that Warp does
not follow | Warp kernels and Torch work are not ordered (Warp-NN path
and Torch fallback alike); the repo's callers run on the default stream
or put Torch on Warp's stream (Newton's `torch_follows`, MDP2 capture) |
| L3 | A remote (Nucleus or URL) ONNX file with external weights | only
the `.onnx` is downloaded; keep the weights inline for remote files |

## Evidence

Per `compute` call (µs):

| # | Compared | Host | 512 envs · `main` eager | 512 envs · this PR |
4096 envs · `main` eager | 4096 envs · this PR |
|---|---|---|---|---|---|---|
| E1 | Go1 MLP, Warp graph (warp-nn MR !41 head, before 0.5.0) | L40 |
386.3 | 30.2 (−92 %) | 377.5 | 82.0 (−78 %) |
| E2 | ANYdrive LSTM, Warp graph | RTX PRO 6000 | 471.0 | 36.9 (−92 %) |
686.1 | 76.6 (−89 %) |
| E3 | Go1 MLP, eager | RTX PRO 6000 | 211.8 | 196.1 (−7 %) | 205.2 |
196.7 (−4 %) |
| E4 | ANYdrive LSTM, eager | RTX PRO 6000 | 497.0 | 493.6 (−1 %) |
738.0 | 510.2 (−31 %) |

E5: env step (ms, RTX PRO 6000, 4096 envs, Newton MJWarp; `main`
`d56d381a20f` vs this PR `ec5dc495c89`, alternating runs, median of 6 ×
100 steps):

| # | Actuator path | Task | `main` | this PR |
|---|---|---|---|---|
| 1 | Newton actuators (default) | Isaac-Velocity-Rough-AnymalD | 11.75
/ 11.96 | 11.83 / 11.88 |
| 2 | Newton actuators (default) | IsaacContrib-Velocity-Flat-UnitreeGo1
| 5.72 / 5.77 | 5.64 / 5.67 |
| 3 | Isaac Lab actuators (`use_newton_actuators=False`) |
Isaac-Velocity-Flat-AnymalD | 15.00 | 14.86 |
| 4 | Isaac Lab actuators (`use_newton_actuators=False`) |
IsaacContrib-Velocity-Flat-UnitreeGo1 | 5.74 | 5.78 |

E6: `DCMotor.compute` eager (µs, RTX PRO 6000, 12 joints; `ec5dc495c89`
vs `ac3553dfd46`, alternating, 2 runs each): 512 envs 64.9 / 65.9 → 48.7
/ 44.5; 4096 envs 63.9 / 66.9 → 48.1 / 44.3.

At `46c853c902d` (RTX PRO 6000): `test_actuator_net.py` 16,
`test_dc_motor.py` 22, `test_actuator_collection.py` 29,
`test_newton_adapter.py` 26, `test_newton_actuators_newton.py` 38 and
`test_newton_raycast_sensor.py` 10 passed. At `ec5dc495c89` (RTX PRO
6000): `test_actuator_net.py` 13, `test_dc_motor.py` 22,
`test_actuator_collection.py` 30 (2 skipped) and
`test_newton_actuators_newton.py` 38 passed. Both actuators' `compute`
and masked reset replay from a Warp graph on Warp's own stream, from a
Warp graph on Torch's stream and from `torch.cuda.graph` with zero error
(12/12). ANYdrive LSTM at `3a8360a89d9`: against `main` eager with TF32
off, 9.7e-4 (512 envs) and 1.1e-3 (4096 envs) over 24 steps; against an
FP64 reference, Warp-NN 1.7e-5 and `main`'s FP32 cuDNN 9.5e-4. At
`ecf06ff652f` (merged `main`: warp-lang 1.20.0, warp-nn 0.5.0; RTX PRO
6000): `test_actuator_net.py` 20 (Torch fallback of both actuators on
CPU and CUDA; a mutation of the MLP fallback input fails it)
`test_newton_adapter.py` 26 and
`test_mdp2_env.py::test_env_rejects_assets_it_cannot_reset_or_write_in_place`
2 passed. Ray-caster tests at `e7c807e3226`:
`test_newton_raycast_sensor.py` 10, `test_ray_caster_sensor.py` 4,
`test_ray_caster_integration.py` 10 passed.

## History

- 2026-12-02: Torch fallback keeps the module in `network` and calls it
as `main` did (`65613e278bb`, `eac128b5242`); MDP2 reads `capturable`
from the instance (`11fbdd45b1b`); ONNX export errors fall back, MLP
fallback test, `.onnx` needs `use_newton_actuators=False`
(`e7c79b77c1a`); ONNX loaded by path, `network` change marked breaking
(`cc76ff167c2`); merged `main` (`ecf06ff652f`).
- 2026-12-02: Torch fallback, deprecated, for TorchScript networks
Warp-NN cannot run (`7aa3d43435d`); merged `main` with the CI cache fix
#9359 (`77fa7ad3a00`).
- 2026-12-01: review round: traced checkpoints load,
unsupported-operator error, ONNX loading split from the TorchScript
export, `ActuatorNetBase`, `DCMotor` shares the clip kernel, the
collection's device copy dropped, drift seeded once at init
(`ac3553dfd46` … `b4175b1a588`); merged `main` (`46c853c902d`).
- 2026-11-30: `ActuatorNetLSTM` on Warp-NN with a shared base
(`3a8360a89d9`); both actuators capturable (`d98b83c5b12`); TorchScript
exported for the actuator's batch (`6f4030a8889`); review cleanups
(`5d49b8dd94e`, `ec5dc495c89`).
- 2026-11-30: merged `main`; require warp-nn 0.5.0 (`19d9aab3247`).
- 2026-11-23: MLP actuator fully in Warp (review rounds 9–16):
`6c27eb313a7`, `0ef4971028a`, `4634d7863fa`; merged `main`.
- 2026-11-16: drift seeded per sensor config (`e7c807e3226`), reseeded
by `configure_seed` (`4b9dd927aa2`); test trims.
- 2026-11-13: rebuilt on `main` after #8821 merged and #6646 closed.

## Type of change

- Bug fix (non-breaking change which fixes an issue)
- New feature (non-breaking change which adds functionality)
- Breaking change (existing functionality will not work without user
modification)

## Release backport

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

## Screenshots

Not applicable.

## Checklist

Docker and GPU tests run on demand. Push the commits you want tested,
then
comment `run-ci` on the pull request.

- [x] I have read and understood the [contribution
guidelines](https://isaac-sim.github.io/IsaacLab/main/source/refs/contributing.html)
- [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with
`uv run isaaclab --format`
- [x] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [x] I have validated the changed behavior with focused coverage and
applied the [test-audit
criteria](https://github.com/isaac-sim/IsaacLab/blob/main/skills/developer/test-audit/SKILL.md)
to any test changes
- [x] I have added a changelog fragment under
`source/<pkg>/changelog.d/` for every touched package (do **not** edit
`CHANGELOG.rst` or bump package versions — CI handles that)
- [x] I have added my name to the `CONTRIBUTORS.md` or my name already
exists there
isaaclab-bot Bot pushed a commit that referenced this pull request Dec 3, 2026
…#8997)

## Summary

- A Warp graph alone (no Torch stream alignment) records the whole
`compute` of both network actuators (`ActuatorNetMLP` and
`ActuatorNetLSTM`, now both on Warp-NN) and every masked reset of the
actuator networks and the ray-caster drift. Both actuators are
`capturable`.
- Per `compute` call against `main` eager: in a Warp graph, Go1 MLP
377.5 → 82.0 µs and ANYdrive LSTM 686.1 → 76.6 µs at 4096 envs; run
eagerly, on par or faster (E3, E4).
- Env step against `main`: unchanged (E5). With the default
`use_newton_actuators=True`, Newton's own actuator runs these networks,
so this PR's actuators run when Newton actuators are disabled.

## Dependencies

| # | Item | State |
|---|---|---|
| D1 | The env step does not record these actuators yet: velocity tasks
keep the Isaac Lab actuator path eager (their contact sensor samples
between physics steps, so the physics does not take over the actions;
`ActuatorCollection.is_graphable` excludes explicit groups) | follow-up
|
| D2 | warp-nn 0.5.0 (released 2026-11-29) runs both networks (0.4.1
rejects the LSTM export's `Slice`); this PR requires `warp-nn>=0.5.0` |
done |
| D3 | `ActuatorNetLSTM` on Warp-NN | done in this PR |
| D4 | With the default `use_newton_actuators=True`, Newton runs the
network from a Torch `.pt2` export, which Newton cannot capture; handing
it ONNX instead, with the shipped checkpoints moved to ONNX so both
paths load only `.onnx` (no export at load) | follow-up |

# Description

| # | Change | Where |
|---|---|---|
| C1 | MLP `compute` = history kernel (shift + scaled network input) →
Warp-NN → scale + DC motor clip kernel; efforts in preallocated Warp
buffers, `computed_effort`/`applied_effort` stay Torch views |
`actuator_net.py`, `actuator_kernels.py` |
| C2 | LSTM `compute` = input kernel → Warp-NN → new hidden and cell
states copied into their state buffers → the same clip kernel; `sea_*`
stay Torch views of the Warp buffers | `actuator_net.py` |
| C3 | Shared base `ActuatorNetBase`: network file check,
computed-effort buffer, network loading, scale + clip launch |
`actuator_net.py` |
| C4 | Network file: `.onnx` loaded by its local path, so weights the
exporter stores next to it (`.onnx.data`) resolve (with
`use_newton_actuators=False` only; the native path names the flag when
it gets a non-TorchScript file); a TorchScript file is exported to ONNX
at load for the actuator's batch (the LSTM reads its layer count and
hidden size from the weights, so traced checkpoints load). When Warp-NN
cannot run a TorchScript network (an unsupported operator, or any ONNX
export error), Torch runs the module as before, with a `FutureWarning`
naming the file and operator: deprecated, that actuator instance is not
`capturable`, and `network` stays the TorchScript module. Such an ONNX
file fails with a `ValueError` naming the file. Otherwise `network` is
the Warp-NN runtime (**breaking**; no caller in the repo) |
`actuator_net.py`, `actuator_net_cfg.py`, `utils/io/onnx.py`,
`schemas_actuators.py` |
| C5 | Masked resets in Warp kernels (LSTM states, MLP histories);
`env_ids` keep `main`'s Torch path | `actuator_net.py` |
| C6 | Both actuators `capturable`: drops the opt-outs `main` added in
#9120 | `actuator_net.py` |
| C7 | The network actuators' kernels sit in the actuators package's
kernel module, in their own section | `actuator_kernels.py` |
| C8 | `DCMotor` clips its effort with the network actuators'
`dc_motor_clip` kernel into a preallocated buffer (`applied_effort` is
its Torch view), so the torque-speed envelope lives in one place (E6) |
`actuator_pd.py`, `actuator_kernels.py` |
| C9 | Ray-caster drift resampled from per-env Warp RNG states, seeded
once when the rays initialize from the env seed and the sensor's prim
path and offset; a later `env.reset(seed=...)` does not restart the
drift | `base_ray_caster.py`, `ray_caster/kernels.py`,
`utils/warp/kernels.py::initialize_rng_state` |
| C10 | Test LSTM fixtures take the last time step with `squeeze`
(Warp-NN 0.5.0 has no `Gather`); a `CumSum` head pins the Torch fallback
of both actuators (LSTM state carry, MLP history window, partial resets,
as the Warp-NN path) and the ONNX load error; actuator concepts page
describes the network file | `actuator_equivalence.py`,
`test_dc_motor.py`, `test_actuator_net.py`, `concepts/actuators.rst` |
| C11 | New dependency `warp-nn>=0.5.0` | `pyproject.toml`, `uv.lock` |
| C12 | MDP2 reads `capturable` from the actuator instance, so it
refuses an actuator whose network Torch runs; `ActuatorBase.capturable`
says an instance may turn it off | `mdp2_scene_data.py`,
`actuator_base.py` |

## Known limitations

| # | Case | Behaviour |
|---|---|---|
| L1 | A network whose Warp-NN warm-up fails at the actuator's batch:
the shipped ANYdrive LSTM at 1 env × 1 joint (Warp-NN's `Squeeze` has no
0-D output) | raises `NotImplementedError` instead of falling back;
`main` ran it with Torch. No task reaches a batch of 1 (ANYdrive groups
have 12 joints); reported to Warp-NN |
| L2 | `compute` called inside a non-default Torch stream that Warp does
not follow | Warp kernels and Torch work are not ordered (Warp-NN path
and Torch fallback alike); the repo's callers run on the default stream
or put Torch on Warp's stream (Newton's `torch_follows`, MDP2 capture) |
| L3 | A remote (Nucleus or URL) ONNX file with external weights | only
the `.onnx` is downloaded; keep the weights inline for remote files |

## Evidence

Per `compute` call (µs):

| # | Compared | Host | 512 envs · `main` eager | 512 envs · this PR |
4096 envs · `main` eager | 4096 envs · this PR |
|---|---|---|---|---|---|---|
| E1 | Go1 MLP, Warp graph (warp-nn MR !41 head, before 0.5.0) | L40 |
386.3 | 30.2 (−92 %) | 377.5 | 82.0 (−78 %) |
| E2 | ANYdrive LSTM, Warp graph | RTX PRO 6000 | 471.0 | 36.9 (−92 %) |
686.1 | 76.6 (−89 %) |
| E3 | Go1 MLP, eager | RTX PRO 6000 | 211.8 | 196.1 (−7 %) | 205.2 |
196.7 (−4 %) |
| E4 | ANYdrive LSTM, eager | RTX PRO 6000 | 497.0 | 493.6 (−1 %) |
738.0 | 510.2 (−31 %) |

E5: env step (ms, RTX PRO 6000, 4096 envs, Newton MJWarp; `main`
`d56d381a20f` vs this PR `ec5dc495c89`, alternating runs, median of 6 ×
100 steps):

| # | Actuator path | Task | `main` | this PR |
|---|---|---|---|---|
| 1 | Newton actuators (default) | Isaac-Velocity-Rough-AnymalD | 11.75
/ 11.96 | 11.83 / 11.88 |
| 2 | Newton actuators (default) | IsaacContrib-Velocity-Flat-UnitreeGo1
| 5.72 / 5.77 | 5.64 / 5.67 |
| 3 | Isaac Lab actuators (`use_newton_actuators=False`) |
Isaac-Velocity-Flat-AnymalD | 15.00 | 14.86 |
| 4 | Isaac Lab actuators (`use_newton_actuators=False`) |
IsaacContrib-Velocity-Flat-UnitreeGo1 | 5.74 | 5.78 |

E6: `DCMotor.compute` eager (µs, RTX PRO 6000, 12 joints; `ec5dc495c89`
vs `ac3553dfd46`, alternating, 2 runs each): 512 envs 64.9 / 65.9 → 48.7
/ 44.5; 4096 envs 63.9 / 66.9 → 48.1 / 44.3.

At `46c853c902d` (RTX PRO 6000): `test_actuator_net.py` 16,
`test_dc_motor.py` 22, `test_actuator_collection.py` 29,
`test_newton_adapter.py` 26, `test_newton_actuators_newton.py` 38 and
`test_newton_raycast_sensor.py` 10 passed. At `ec5dc495c89` (RTX PRO
6000): `test_actuator_net.py` 13, `test_dc_motor.py` 22,
`test_actuator_collection.py` 30 (2 skipped) and
`test_newton_actuators_newton.py` 38 passed. Both actuators' `compute`
and masked reset replay from a Warp graph on Warp's own stream, from a
Warp graph on Torch's stream and from `torch.cuda.graph` with zero error
(12/12). ANYdrive LSTM at `3a8360a89d9`: against `main` eager with TF32
off, 9.7e-4 (512 envs) and 1.1e-3 (4096 envs) over 24 steps; against an
FP64 reference, Warp-NN 1.7e-5 and `main`'s FP32 cuDNN 9.5e-4. At
`ecf06ff652f` (merged `main`: warp-lang 1.20.0, warp-nn 0.5.0; RTX PRO
6000): `test_actuator_net.py` 20 (Torch fallback of both actuators on
CPU and CUDA; a mutation of the MLP fallback input fails it)
`test_newton_adapter.py` 26 and
`test_mdp2_env.py::test_env_rejects_assets_it_cannot_reset_or_write_in_place`
2 passed. Ray-caster tests at `e7c807e3226`:
`test_newton_raycast_sensor.py` 10, `test_ray_caster_sensor.py` 4,
`test_ray_caster_integration.py` 10 passed.

## History

- 2026-12-02: Torch fallback keeps the module in `network` and calls it
as `main` did (`65613e278bb`, `eac128b5242`); MDP2 reads `capturable`
from the instance (`11fbdd45b1b`); ONNX export errors fall back, MLP
fallback test, `.onnx` needs `use_newton_actuators=False`
(`e7c79b77c1a`); ONNX loaded by path, `network` change marked breaking
(`cc76ff167c2`); merged `main` (`ecf06ff652f`).
- 2026-12-02: Torch fallback, deprecated, for TorchScript networks
Warp-NN cannot run (`7aa3d43435d`); merged `main` with the CI cache fix
#9359 (`77fa7ad3a00`).
- 2026-12-01: review round: traced checkpoints load,
unsupported-operator error, ONNX loading split from the TorchScript
export, `ActuatorNetBase`, `DCMotor` shares the clip kernel, the
collection's device copy dropped, drift seeded once at init
(`ac3553dfd46` … `b4175b1a588`); merged `main` (`46c853c902d`).
- 2026-11-30: `ActuatorNetLSTM` on Warp-NN with a shared base
(`3a8360a89d9`); both actuators capturable (`d98b83c5b12`); TorchScript
exported for the actuator's batch (`6f4030a8889`); review cleanups
(`5d49b8dd94e`, `ec5dc495c89`).
- 2026-11-30: merged `main`; require warp-nn 0.5.0 (`19d9aab3247`).
- 2026-11-23: MLP actuator fully in Warp (review rounds 9–16):
`6c27eb313a7`, `0ef4971028a`, `4634d7863fa`; merged `main`.
- 2026-11-16: drift seeded per sensor config (`e7c807e3226`), reseeded
by `configure_seed` (`4b9dd927aa2`); test trims.
- 2026-11-13: rebuilt on `main` after #8821 merged and #6646 closed.

## Type of change

- Bug fix (non-breaking change which fixes an issue)
- New feature (non-breaking change which adds functionality)
- Breaking change (existing functionality will not work without user
modification)

## Release backport

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

## Screenshots

Not applicable.

## Checklist

Docker and GPU tests run on demand. Push the commits you want tested,
then
comment `run-ci` on the pull request.

- [x] I have read and understood the [contribution
guidelines](https://isaac-sim.github.io/IsaacLab/main/source/refs/contributing.html)
- [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with
`uv run isaaclab --format`
- [x] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [x] I have validated the changed behavior with focused coverage and
applied the [test-audit
criteria](https://github.com/isaac-sim/IsaacLab/blob/main/skills/developer/test-audit/SKILL.md)
to any test changes
- [x] I have added a changelog fragment under
`source/<pkg>/changelog.d/` for every touched package (do **not** edit
`CHANGELOG.rst` or bump package versions — CI handles that)
- [x] I have added my name to the `CONTRIBUTORS.md` or my name already
exists there

(cherry picked from commit ccd75ad)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

isaac-lab Related to Isaac Lab team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants