Skip to content

Add tuned FlashSAC agents and fix G1 symmetry augmentation - #9125

Merged
lgulich merged 4 commits into
isaac-sim:mainfrom
lgulich:lgulich/g1-symmetry-fixes
Nov 21, 2026
Merged

lgulich merged 4 commits into
isaac-sim:mainfrom
lgulich:lgulich/g1-symmetry-fixes

Conversation

@lgulich

@lgulich lgulich commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

G1 symmetry augmentation (isaaclab_tasks.core.velocity.mdp.symmetry.g1:compute_symmetric_states) fails on Isaac-Velocity-Flat-G1 and Isaac-Velocity-Rough-G1, for PPO and SAC alike. This PR fixes it and gives the tasks from the PPO vs FlashSAC benchmark a tuned SAC agent next to their PPO agent.

Two joints of the velocity-task G1 have symmetric limits and names without a roll, yaw or pitch token, so the mirror map cannot resolve their signs and raises: the waist yaw torso_joint and the Dex3 thumb rotation *_zero_joint. torso_joint is a yaw and flips under a sagittal mirror. I checked the full map with forward kinematics: one robot in a random pose, a second in the mirrored pose, and every body of the second compared with the reflection of its counterpart. Over 20 poses, all bodies outside the hands match within 3.3 mm, and flipping the waist or a hip sign moves bodies by 0.6 to 1.1 m, so the check is sensitive. The thumb links stay several centimetres off for every combination of finger signs, because the left and right Dex3 hands are not mirror images of each other. Finger mirroring is therefore approximate on this robot; zero_joint keeps the existing thumb convention (hand_thumb_0_joint, +1).

The vector mirror factors were also rebuilt from Python tuples on every call. That is a host-to-device copy, which fails inside a captured CUDA graph, as used by rsl_rl SAC's updates. The factors are now built once per term, device and size.

The benchmark tuned FlashSAC per task under the same rewards as PPO. Those settings now ship as rsl_rl_sac_cfg_entry_point agents for Isaac-Cartpole, Isaac-Ant, Isaac-Humanoid, Isaac-Open-Drawer-Franka, Isaac-Reorient-Cube-Allegro, and the flat and rough ANYmal-D and G1 velocity tasks. Each config matches the benchmarked run field by field, and its max_iterations is what that run reached in its time budget. Most tasks use the RSL-RL FlashSAC defaults with a higher discount, more updates per iteration, a cosine learning-rate schedule and a short warm-up; the two rough tasks only raise the learning rates and were tuned with 1024 environments. Isaac-Reach-Franka has no SAC agent: SAC reaches the target but much more slowly than PPO, and none of the settings tried closed that gap.

The flat G1 SAC agent from #8866 moves to the tuned settings. It also named a proprio observation group, which the flat G1 environment does not have; it now reads policy like the PPO agent. Without mirrored samples, SAC learns left/right asymmetric gaits on G1, holding one leg in the air or spreading both legs wide, so both G1 SAC agents use the symmetry augmentation. Its settings move into G1_SYMMETRY_CFG, shared with the G1 PPO teacher.

Per-task curves and videos: https://linkify.nvidia.com/s/rsl-rl-ppo-flashsac-supermimic/ (NVIDIA internal).

To try a SAC agent:

uv run isaaclab train --rl_library rsl_rl --task Isaac-Velocity-Flat-G1 \
    --agent rsl_rl_sac_cfg_entry_point physics=newton_mjwarp visualizer=none

🤖 Generated with Claude Code

G1 symmetry augmentation failed on the velocity tasks: the waist yaw
torso_joint and the Dex3 thumb rotation zero_joint have symmetric limits
and names without a roll, yaw or pitch token, so the mirror map could not
resolve their signs. torso_joint is a yaw and flips; forward kinematics
of mirrored poses matches the reflected bodies within a few millimetres
everywhere except the hands. The left and right Dex3 hands are not
mirror images, so no sign reflects the thumb exactly; zero_joint keeps
the existing thumb convention.

The vector mirror factors were rebuilt from Python tuples on every call,
which is a host-to-device copy and fails inside captured CUDA graphs, as
used by SAC's updates. They are now built once per term, device and
size.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions github-actions Bot added bug Something isn't working isaac-lab Related to Isaac Lab team labels Nov 20, 2026
The PPO vs FlashSAC benchmark tuned SAC per task under the PPO rewards.
These settings now ship as rsl_rl_sac_cfg_entry_point agents, so each
of the tasks has a PPO and a SAC agent: cartpole, ant, humanoid, Franka
drawer, Allegro cube, and the flat and rough ANYmal-D and G1 velocity
tasks. Each config matches the benchmarked run field by field, with the
iteration count it reached in its time budget.

The flat G1 agent moves from the single-setting FlashSAC recipe to the
tuned one and reads the policy observation group; the proprio group it
named does not exist in the flat G1 environment. Both G1 agents use the
symmetry augmentation, now shared with the PPO teacher as G1SymmetryCfg.

The G1 mirror unit test is dropped.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Nov 20, 2026
@lgulich lgulich changed the title Resolve G1 velocity-task mirror signs and capture-safe vector mirrors Add tuned FlashSAC agents and fix G1 symmetry augmentation Nov 20, 2026
@lgulich
lgulich marked this pull request as ready for review November 20, 2026 16:50
@lgulich
lgulich requested a review from a team November 20, 2026 16:50
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@greptile-apps

greptile-apps Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no new actionable issue was found.

Summary

Adds tuned FlashSAC agents for the listed control, manipulation, and velocity tasks, and fixes G1 mirror signs and vector-factor caching.

  • Cartpole, Ant, Humanoid, Franka, Allegro, and ANYmal-D tasks offer tuned SAC agents.
  • G1 SAC training uses tuned settings and mirrors both sides of the robot.
  • G1 symmetry augmentation resolves the waist and thumb joints and reuses vector factors.

Reviews (2) · Last reviewed commit: "Address review: explicit obs groups, inh..." · Reviewed by Greptile

Comment on lines +32 to +41
_EXPLICIT_SIGNS = {
"hand_thumb_0_joint": 1.0,
# waist yaw of the velocity-task G1; its limits are symmetric, so neither limits nor name resolve it
"torso_joint": -1.0,
# Dex3 thumb rotation. The left and right Dex3 hands are not mirror images, so no sign reflects the thumb
# exactly; finger mirroring is approximate on this hand either way.
"zero_joint": 1.0,
}
# Vector mirror factors per (term, device, size), built once so captured CUDA graphs need no host-to-device copy
_FACTOR_CACHE: dict[tuple[str, str, int], torch.Tensor] = {}

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.

P2 Mirror fixes lack tests

The G1 mirror fixes have no regression tests. Add tests with symmetric joint limits for torso_joint and paired *_zero_joint joints, plus a CUDA test that warms the factor cache before capturing a second call. These cover the exact failures this change fixes; the existing ANYmal tests do not exercise this code.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Left out on purpose to keep the PR to the fix and the configs. The signs were checked with a forward-kinematics comparison (in the description). Both G1 SAC agents run the augmentation with CUDA graphs on, and they train. I can add a small CPU test back if maintainers want one.

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.

That makes sense — you've validated the signs with forward kinematics and confirmed the CUDA graph path works in practice with the actual SAC agents. Keeping the PR focused on the fix and configs is reasonable, especially when the functionality is already being exercised. If maintainers want test coverage, you can add it then.

@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

Needs attention: Scope and over-engineering (2), Compatibility and deprecation (1), Implementation (1), Style consistency (3). Other reviewed categories look good.

  • PR description: Title matches registrations and symmetry changes; shorten tuning repetition and support PPO/SAC timing claims with reproducible baseline/candidate revisions, command, hardware, backend, environment count, warmup, and learning-time metrics.
  • Design and architecture: Architecture looks good.
  • Scope and over-engineering: Minimal implementation: Keep all six added task-local rsl_rl_sac_cfg.py modules for their registered configuration contracts; merge symmetry_cfg.py into the existing G1 agent configuration owner, reuse a configured instance, and inherit shared flat settings with rough overrides. Keep reflection signs and factors in g1.py. Suggested PR breakdown: 1. G1 reflection/cache fixes, validated by reflection and capture replay. 2. SAC configurations, compatibility bridge, registrations, and documentation, validated through agent loading and observation/action contracts.
  • API: API changes look good.
  • Compatibility and deprecation: Breaking changes: the existing flat G1 SAC entry point halves action bounds without a deprecation bridge; preserve the old action contract temporarily, warn users, and separately document and test the tuned transition.
  • Implementation: The factor-cache lookup converts torch.device to a string for every vector term; key directly by the hashable device to remove repeated representation allocation.
  • Style consistency: Repeated tuning sentences, field summaries, and gait rationale duplicate nearby declarations and documentation; remove boilerplate and retain each useful constraint or rationale once.
  • Test quality: Test quality looks good.

Significant concerns. Posted 7 inline findings.

Automated review; human maintainers own approval decisions.

action_range=(-2.0, 2.0), std_range=(math.exp(-10.0), math.exp(2.0))
),
network_cfg=RslRlResidualMLPCfg(hidden_dim=128, num_blocks=2),
distribution_cfg=RslRlMLPModelCfg.SquashedGaussianDistributionCfg(action_range=(-1.0, 1.0)),

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 · Compatibility — Preserve the existing flat SAC contract

The existing class and entry point now halve action bounds and change observation selection and training defaults. Keep the old recipe functional through a warned deprecation transition; expose tuning separately and document and validate both…

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I don't think a deprecation bridge is needed here:

  • the old config read a proprio group the flat G1 env doesn't have, so it couldn't train as merged
  • it came in with Add native RSL-RL SAC support #8866 two days ago and hasn't been released

So there's no working contract to keep. Happy to add one if maintainers still want it.

@AntoineRichard

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 Nov 20, 2026
The five task SAC agents without obs_groups now set them, so their
configs pass validate(); their environments only have a policy group.
The rough ANYmal-D and G1 agents inherit their flat siblings and only
override the algorithm, the iteration count and the experiment name.
The G1 symmetry settings are a shared RslRlSymmetryCfg instance in the
PPO config module instead of a preset subclass, and the mirror factor
cache keys on torch.device. Docstrings drop the restated settings.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@maxkra15
maxkra15 self-requested a review November 21, 2026 14:20
@lgulich
lgulich merged commit 8f5e275 into isaac-sim:main Nov 21, 2026
62 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working documentation Improvements or additions to documentation isaac-lab Related to Isaac Lab team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants