Repository navigation
Add Newton Steel solver presets and benchmark support - #8940
Conversation
|
@ooctipus The Franka arm loads with zero position-drive stiffness under Repro, 2 envs, run with the repo's env ( import sys
import gymnasium as gym
import isaaclab_tasks # noqa: F401
from isaaclab.app import launch_simulation
from isaaclab_tasks.utils import resolve_task_config
task, preset = "Isaac-Reach-Franka", sys.argv[1]
env_cfg, _ = resolve_task_config(task, None, overrides=[f"presets={preset}"])
env_cfg.scene.num_envs = 2
with launch_simulation(env_cfg, None):
env = gym.make(task, cfg=env_cfg)
print(preset, env.unwrapped.scene["robot"].data.joint_stiffness.torch[0].tolist())
env.close()Joint armature is 0 under Steel too (0.1 under MJWarp), and the gripper has no drive. Cause: Reach and Cabinet use
The mujoco variant authors its drive gains as MuJoCo actuator attributes and its joint armature as Fix: select the Optionally, The current Steel presets load these tasks without arm position drives, so I'd rerun the Reach and Cabinet throughput measurements with the corrected gains. |
|
@ooctipus Following up with the full sweep, since Steel env steps/s ÷ MJWarp on the same GPU, geomean per preset family (16,384 envs; 4,096 for camera tasks, 2,048 for keyboard):
† Includes the Franka variant fix from my previous comment (
1 substep on top of point friction gives another 1.2–1.9× where it stays finite, but it isn't safe per family:
Other options I measured on 12 representative tasks:
I have the Franka fix and per-task tables ready. Happy to open a PR into |
|
I opened the preset and option changes from my earlier comments as a PR into |
[Medium impact] The PR adds an optional solver path across supported Newton task families. Fix the Steel keyboard task's failure with FindingsSummaryAdds Newton Steel through the shared solver layer and exposes
Acknowledged by Diagram%%{init: {'theme': 'neutral'}}%%
flowchart LR
A["presets=newton_steel"] --> B["Task-family configuration"]
B --> C["NewtonCfg and SteelSolverCfg"]
C --> D["Shared Newton manager"]
D --> E["SteelSolver.build"]
E --> F["Newton collision pipeline"]
F --> G["Steel simulation steps"]
C --> H["Benchmark label: newton_steel"]
Reviews (1) · Last reviewed commit: "Use shared contact observable path for S..." · Reviewed by Greptile |
| if isinstance(physics, NewtonCfg) and isinstance(physics.solver_cfg, SteelSolverCfg): | ||
| physics.collision_cfg.rigid_contact_max = 170 * self.scene.num_envs |
There was a problem hiding this comment.
Default collision settings crash startup
SO101KeyboardEnvCfg.validate_config() assumes collision_cfg is present, but NewtonCfg explicitly supports None. Running the keyboard task with presets=newton_steel env.sim.physics.collision_cfg=null raises AttributeError before simulation starts. Create a NewtonCollisionPipelineCfg when it is absent before setting the task's contact budget.
Knowledge Base Used: Task library
| """Scale the Steel contact budget to the resolved number of keyboard worlds.""" | ||
| physics = self.sim.physics | ||
| if isinstance(physics, NewtonCfg) and isinstance(physics.solver_cfg, SteelSolverCfg): | ||
| physics.collision_cfg.rigid_contact_max = 170 * self.scene.num_envs |
There was a problem hiding this comment.
Contact budget overrides are ignored
validate_config() always replaces rigid_contact_max, so an explicit override such as env.sim.physics.collision_cfg.rigid_contact_max=1000000 is silently discarded when the environment starts. Users cannot increase the budget to address contact overflow or test a different allocation. Apply the scaled budget only when no explicit budget was supplied, while keeping automatic budgets in sync with scene.num_envs.
Knowledge Base Used: Task library
There was a problem hiding this comment.
Isaac Lab Review Bot
Needs attention: Design and architecture (1), Scope and over-engineering (1), Style consistency (1), Test quality (3). Other reviewed categories look good.
- PR description: Remove branch-history rename and substep claims; the 1.31× claim mixes stale revisions, so remeasure current baseline/candidate with revisions, command, RTX 5090, backends, environment counts, warmup, and aggregate steps/s.
- Design and architecture: SO101 validation mutates collision capacity from scene state, mixing checking with configuration wiring; derive the budget during initialization or launch preparation instead.
- Scope and over-engineering: Minimal implementation: keep
steel_solver.pyandsteel_solver_cfg.pyunder the existing Newton solver owners, retain task-family preset roots and benchmark dispatch, collapse flat-task preset reconstruction into direct field resets, and delete source-layout manifest tests. Scope is cohesive; no split recommended. - API: API changes look good.
- Compatibility and deprecation: No breaking changes identified.
- Implementation: Implementation looks good.
- Style consistency: Two changed changelog fragments duplicate branch history and describe an unreleased rename; fold them into the existing Steel addition fragment.
- Test quality: Delete the source-layout grep, preset-owner manifest, and duplicate unknown-preset case; retain the distinct solver, filtering, force, benchmark, and resolved-preset coverage.
Minor fixes needed. Posted 6 inline findings.
Automated review; human maintainers own approval decisions.
| from isaaclab.test.utils import test_devices | ||
|
|
||
|
|
||
| def test_steel_stays_in_the_solver_layer() -> None: |
There was a problem hiding this comment.
🟡 Warning · Test Quality — Delete source-layout grep test
This asserts never-existing files are absent and greps __init__.pyi text, guarding branch-local layout rather than behavior. The manager build-and-step case already covers Steel solver integration.
| @@ -0,0 +1 @@ | |||
| * Renamed the Steel task selector to ``presets=newton_steel`` and made the tuned solver settings the default while preserving task substep counts. | |||
There was a problem hiding this comment.
🟡 Warning · Style Consistency — Changelog describes unreleased selector rename
presets=newton_steel is added by this diff, so "Renamed the Steel task selector" documents branch history users never saw, and steel-pr12-presets.changed.rst repeats it. Fold both into the single .added fragment.
| self.sim.render_interval = self.decimation | ||
| self.sim.visualizer_cfgs = VisualizerCfg(eye=(0.85, -0.75, 1.0), lookat=(0.25, 0.0, 0.1), focal_length=28.0) | ||
|
|
||
| def validate_config(self) -> None: |
There was a problem hiding this comment.
🟡 Warning · Design Architecture — validate_config performs configuration wiring
Validation hooks may only check a config's own fields; this writes collision_cfg.rigid_contact_max derived from scene.num_envs. Derive the Steel contact budget in __post_init__ or launch preparation instead.
| newton_mjwarp.solver_cfg.cone = "elliptic" | ||
| newton_mjwarp.solver_cfg.impratio = 100.0 | ||
| self.sim.physics.default = newton_mjwarp | ||
| self.sim.physics.newton_steel = RoughPhysicsCfg().newton_steel |
There was a problem hiding this comment.
🟡 Warning · Scope Complexity — Revert one field, not preset
Reconstructing RoughPhysicsCfg().newton_steel silently discards any other parent Steel tuning and adds a module import to revert one field. Assign solver_cfg.iterations = 8 here, and joint_limit_activation_gap = 0.2 in go2/flat_env_cfg.py.
| ) | ||
|
|
||
|
|
||
| def test_newton_steel_preset_has_one_owner_per_task_family() -> None: |
There was a problem hiding this comment.
🟡 Warning · Test Quality — Delete preset-owner manifest test
This AST walk hard-codes an exact set of preset-owning files and forbidden names, so legitimate preset additions fail it while no behavior is protected. The resolved-task preset tests already cover composition.
| assert cfg.sim.physics.default_shape_cfg.gap == 0.002 | ||
|
|
||
|
|
||
| def test_legacy_steel_selector_is_rejected() -> None: |
There was a problem hiding this comment.
🟡 Warning · Test Quality — Duplicate unknown-preset negative control
steel was never a released selector, so this only re-exercises the generic unknown-preset guard already owned by test_unknown_preset_name_raises in this file. Remove it.
There was a problem hiding this comment.
These tests feel out of place, if not un-needed? LGTM otherwise! Thanks Octi!
# Description Update the pinned Newton revision from `42f7def118c2` (1.8.0.dev0) to `7f0c13af6e4d` (1.9.0.dev0), and align MuJoCo and MuJoCo Warp from 3.15 to 3.17 in `pyproject.toml`, `uv.lock`, and the wheel-builder overrides. Newton 1.9 requires explicit opt-in when its USD actuator parser loads a Torch checkpoint. Scope that opt-in to `NewtonActuator` prims whose `newton:modelPath` ends in `.pt`, `.pth`, or `.pt2`; add focused coverage for checkpoint and non-checkpoint paths. Refresh the MPM rendering reference produced by the updated Newton stack. Warm up the Valiant PPISP camera before comparing its RGB output: CI captured an unshaded green frame while depth was already populated. Keep the 12% pixel-difference gate and use a 0.90 SSIM gate for the warmed splat image, which measured 0.9155 in CI. This dependency update is required by [the Steel integration PR](#8940), which will be narrowed to Steel-specific changes. # Validation - `uv lock --check` - Newton adapter tests: 23 passed - MuJoCo/MJWarp solver tests (CPU and CUDA): 36 passed - Rendering architecture tests: 2 passed - `ISAACLAB_CHANGELOG_BASE_REF=upstream/main uv run isaaclab -f` - CI on `91bca223b`: `rendering-correctness`, `rendering-correctness-kitless (legacy)`, `isaaclab_newton`, and `pre-commit` passed - CI `performance-smoke-benchmarks`: passed on retry after runner shared-memory startup failures
| solver_class = SolverSteel | ||
| deterministic = True | ||
|
|
||
| @classmethod |
There was a problem hiding this comment.
P1: Current main instantiates NewtonSolver and calls self.build(model, mode, env_template). This override is still classmethod build(cls,cfg,model,mode,...), so the model binds to cfg and cfg.contact_torsion raises immediately after merging. Use build(self,model,mode,env_template), read self.cfg and call the instance super().build(...).
| self.sim.render_interval = self.decimation | ||
| self.sim.visualizer_cfgs = VisualizerCfg(eye=(0.85, -0.75, 1.0), lookat=(0.25, 0.0, 0.1), focal_length=28.0) | ||
|
|
||
| def validate_config(self) -> None: |
There was a problem hiding this comment.
P2: NewtonCfg allows collision_cfg=None, but this validation hook immediately writes through it. That override raises AttributeError. With a real config, an explicit rigid_contact_max=1000000 is silently replaced by696320 at4096worlds. Derive a default budget during configuration preparation, handle None, and preserve explicit user values.
| resolve_presets, | ||
| ) | ||
|
|
||
|
|
There was a problem hiding this comment.
P2: This AST walk pins an exact set of preset-owning files and rejects harmless source reorganization. The real resolved-task preset tests already cover configuration composition. Drop it, the filesystem/grep test_steel_stays_in_the_solver_layer, and the redundant legacy-selector case; retain runtime solver build/step and resolved preset behavior tests.
## Description Use Newton's `CONTACT_F` solver observables for Isaac Lab contact sensors with MuJoCo, XPBD, VBD, Kamino, and Steel. The backend allocates the solver output when a contact sensor is registered, requests it on the final solver substep of the environment step, and passes it to the sensor. Native collision detectors receive a `Contacts` buffer for observable contact indexing. Late sensor registration invalidates captured step graphs. Newton deprecated `Contacts.force` and `solver.update_contacts()` in version 1.7. Isaac Lab no longer uses that path for contact sensors. Featherstone and implicit MPM do not provide `CONTACT_F` in the pinned Newton version, so contact-sensor registration reports that limitation directly. The changelog fragment records this until Newton adds support. This PR contains no Steel solver or task presets and no contact-capacity change. [#8940](#8940) adds Steel; [#8957](#8957) independently aligns explicit contact capacity. ## Base Rebased on `main` at `bb4d9915f`, which includes [#8953](#8953) (Newton 1.9 and MuJoCo/MuJoCo Warp 3.17) and [#8946](#8946) (Newton manager redesign). The solver observable changes use the new instance-based solver interface. ## Validation - On `bb4d9915f`: the Newton manager, Newton solver, and contact-sensor test files passed with 119 passed and 3 existing skips. Resting-contact cases cover both MuJoCo collision paths, XPBD, VBD, and Kamino with both collision paths. - Pre-commit hooks, changelog gate, and diff whitespace checks passed. - Follow-up `90e1f74d9`: 4 coupled-solver runtime tests and 56 Newton manager tests passed locally. [Activated Docker + Tests CI](https://github.com/isaac-sim/IsaacLab/actions/runs/42301974155) passed, including `isaaclab_assets` and contrib environments.
2214322 to
b0ae176
Compare
|
Addressed the latest review in
Focused checks passed: 5 Steel solver, 1 manager, 1 Steel contact sensor, 17 task preset, and 20 benchmark capture tests; Ruff and whitespace checks passed. The PR description now marks the old benchmark table as historical. #8957 remains the open contact-capacity dependency. |
|
run-ci |
kellyguo11
left a comment
There was a problem hiding this comment.
could you also update the command builder docs with the new solver backend? we should include the new solver for any tasks/examples that support it.
@fatimaanes for viz - we should also include the new solver in the benchmarks once this is merged.
) ## Description Set an explicit `NewtonCollisionPipelineCfg.rigid_contact_max` on the model before constructing the solver. This keeps solver scratch and the collision pipeline at the same contact capacity. Reject a conflicting `KaminoPADMMSolverCfg.max_contacts_per_world` instead of silently overriding that value. This change is independent of the contact-sensor observable migration in [#8954](#8954). [#8940](#8940) has merged. This PR remains a needed follow-up: its SO101 Steel preset sets an explicit collision capacity, and this change applies that capacity to the model before solver construction. ## Validation - Newton manager tests are rerunning in CI on the rebased head. - Ruff, Python syntax, changelog gate, and diff whitespace checks passed locally after rebase. ## Type of change - Bug fix
Description
Add Newton Steel as a solver in the shared Newton backend and expose
presets=newton_steelacross supported Isaac Lab task families. Steel uses point friction by default, the shared Newton manager, and one owner for each task family preset.This branch is rebased onto upstream
mainatd4be26397. The Steel presets include the tuned settings from contributor PR #12. Franka Reach and Drawer select the driven PhysX USD variant.Dependencies
PRs #8953 and #8954 are merged into
main. PR #8957 is still open and remains a dependency for explicit contact-capacity alignment. The benchmark table below was collected before the Newton Manager redesign and is retained as historical data, not as a current-revision performance claim.Historical benchmark: Steel point friction vs MJWarp
All 42 Steel-configured task families were benchmarked sequentially on RTX 5090 GPU 0. The original 16,384-environment pairs used point-friction runtime code at
8b8799c40. Steel rows affected by the driven Franka USD variant or the default solver tuning were rerun with the final integration settings; their MJWarp rows are unchanged. The SO101 row was rerun after #8954's contact-observable migration, before the Newton Manager redesign merged intomain. The other rows predate that migration and should be read as a baseline, not current-code measurements. The measurements include the dependency versions in #8953: official Newton7f0c13af6e4dand MuJoCo/MuJoCo Warp 3.17. Steel usesfriction_anchor_beta=0.0.The SO101 task packs 108 keyboard joints into one Newton articulation per environment. Its default Steel preset keeps two substeps. On the earlier combined code with #8954, Steel took 23.7 ms per full
env.step()call at 4,096 environments; MJWarp took 30.3 ms in its paired rerun. Each result is one 100-call run. These timings have not been repeated after the Newton Manager redesign on currentmain.What the numbers mean
We timed 100 full
env.step()calls after 20 warmup calls. The table shows the total environment steps per second across all environments: environments × 100 ÷ the combined host wall time of those calls. Higher is better. This includes work insideenv.step(), not just the physics solver. GPU completion is not synchronized at every call.Default Steel tuning
The tuned solver settings from contributor PR #12 are selected by
presets=newton_steel. The measurements below were taken before this rebase; the tuning improves some tasks and reduces throughput on others in that earlier run.Historical result table (
presets=newton_steel)Type of change
Validation
Focused checks on the rebased branch:
git diff --checkpassedThe historical benchmark table has not been rerun on this revision. PR #8957 is still open, so the full integration and CI remain subject to that dependency.
Checklist