Skip to content

Update the template generator for RSL-RL#5117

Open
ClemensSchwarke wants to merge 1 commit intoisaac-sim:mainfrom
ClemensSchwarke:fix/update_template_generator_for_rsl_rl
Open

Update the template generator for RSL-RL#5117
ClemensSchwarke wants to merge 1 commit intoisaac-sim:mainfrom
ClemensSchwarke:fix/update_template_generator_for_rsl_rl

Conversation

@ClemensSchwarke
Copy link
Copy Markdown
Collaborator

Description

This PR adds Distillation to the list of available algorithms for RSL-RL. It also updates the config templates to RSL-RL version 5.0.

Type of change

  • Template generator update

Checklist

  • I have run the pre-commit checks with ./isaaclab.sh --format
  • My changes generate no new warnings

@github-actions github-actions bot added bug Something isn't working infrastructure labels Mar 27, 2026
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Mar 27, 2026

Greptile Summary

This PR updates the Isaac Lab template generator to target RSL-RL v5.0 by introducing a new DISTILLATION algorithm template and migrating the existing PPO template from the old RslRlPpoActorCriticCfg API to the new RslRlMLPModelCfg / obs_groups model. It also improves the CLI display of algorithms in the RL library table (word-wrapping with textwrap.fill and overflow="fold") and updates the RSL-RL distributed training flag to Yes.\n\nKey changes:\n- tools/template/common.py"DISTILLATION" added to SINGLE_AGENT_ALGORITHMS; the generator auto-discovers it via the new template file.\n- tools/template/templates/agents/rsl_rl_ppo_cfg — Migrated to RSL-RL v5.0 API: RslRlPpoActorCriticCfgRslRlMLPModelCfg, with explicit obs_groups and separate actor/critic model definitions.\n- tools/template/templates/agents/rsl_rl_distillation_cfg (new) — Provides a starter config for the RSL-RL distillation workflow. The teacher model carries init_std=0.0 in its GaussianDistributionCfg, which is a potentially degenerate initialisation (zero standard deviation) that should be verified against RSL-RL's implementation.\n- tools/template/cli.py — Table display improvements and RSL-RL distributed-training flag updated to State.Yes.

Confidence Score: 4/5

Safe to merge after confirming how RSL-RL v5.0 handles init_std=0.0 on the teacher's Gaussian distribution.

All changes are confined to template generator tooling (not runtime Isaac Lab code) and are straightforward. The one substantive concern is the init_std=0.0 value on the teacher model in rsl_rl_distillation_cfg. If RSL-RL v5.0 treats this as deterministic/no noise, the template is correct; if it feeds this directly into log(std) or similar, the generated config will produce NaN at runtime for any user who runs distillation without modifying the template.

tools/template/templates/agents/rsl_rl_distillation_cfg — specifically the init_std=0.0 value on the teacher model config.

Important Files Changed

Filename Overview
tools/template/cli.py Adds textwrap.fill import for word-wrapping algorithm names in the table, switches column overflow to "fold", and updates RSL-RL's distributed training support to State.Yes for v5.0.
tools/template/common.py Adds "DISTILLATION" to SINGLE_AGENT_ALGORITHMS so it is discoverable and validated by the generator's template-scanning logic.
tools/template/templates/agents/rsl_rl_distillation_cfg New RSL-RL Distillation config template; init_std=0.0 on the teacher's Gaussian distribution is potentially degenerate (zero std). Also carries a stale 2022-2025 copyright year despite being created in 2026.
tools/template/templates/agents/rsl_rl_ppo_cfg Updated PPO template for RSL-RL v5.0: replaces RslRlPpoActorCriticCfg with the new RslRlMLPModelCfg API, adds obs_groups, and separates actor/critic into distinct model configs.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[User runs CLI tool] --> B{Single-agent workflow?}
    B -- Yes --> C[Discover RL libraries\nand algorithms via\nget_algorithms_per_rl_library]
    C --> D[Display updated table\nwith textwrap.fill + overflow=fold]
    D --> E[User selects: rsl_rl]
    E --> F[Available algorithms\nPPO / DISTILLATION]
    F --> G{User picks algorithm}
    G -- PPO --> H[Render rsl_rl_ppo_cfg\nusing new RslRlMLPModelCfg API\nobs_groups + actor + critic]
    G -- DISTILLATION --> I[Render rsl_rl_distillation_cfg\nstudent init_std=1.0\nteacher init_std=0.0 ⚠️]
    H --> J[Write .py config to agents/]
    I --> J
Loading

Reviews (1): Last reviewed commit: "update template generator for rsl rl" | Re-trigger Greptile

Copy link
Copy Markdown

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

Choose a reason for hiding this comment

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

🤖 Isaac Lab Review Bot

Summary

This PR updates the RSL-RL template generator to support the v5.0 API: migrates the PPO template from the deprecated RslRlPpoActorCriticCfg (policy field) to the new RslRlMLPModelCfg pattern (separate actor/critic with obs_groups), adds a new Distillation algorithm template, updates the CLI table formatting to handle wider algorithm lists, and marks RSL-RL as supporting distributed training. The changes are correct and well-aligned with the existing rl_cfg.py and distillation_cfg.py config classes.

Architecture Impact

No cross-module impact — changes are self-contained within tools/template/. These template files are only consumed by the template generator CLI (tools/template/cli.pygenerator.py) to scaffold new projects. Existing projects and runtime code are unaffected.

The SINGLE_AGENT_ALGORITHMS list in common.py is used by get_algorithms_per_rl_library() in generator.py to validate discovered algorithms. Adding DISTILLATION there is necessary and correct — the function will only associate it with rsl_rl since only rsl_rl_distillation_cfg exists as a template file.

Implementation Verdict

Minor fixes needed — Correct approach, 1 issue to address (license header year).

Test Coverage

No tests required. The template generator has no existing test suite, and these are template/config/tooling changes that affect only scaffolded project output. The risk of regression is low since template correctness is validated by pre-commit checks on generated output.

CI Status

  • pre-commit — passed
  • Check secrets — passed
  • labeler — passed
  • Build Docs, license-check, test-general, test-isaaclab-tasks — in progress

Findings

🔵 Improvement: templates/agents/rsl_rl_distillation_cfg:1 and templates/agents/rsl_rl_ppo_cfg:1 — License header year is 2022-2025 but the rest of the codebase has been updated to 2022-2026.

The new distillation template copies the stale year from the existing PPO template. Since this PR touches the PPO template anyway, both should be updated to 2022-2026 for consistency. (The pre-commit hook passed, so this isn't enforced by CI, but it's still the correct year per the rest of the repo.)

@ooctipus
Copy link
Copy Markdown
Collaborator

is this target to main or develop?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working infrastructure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants