Enables pipelined IsaacTeleop retargeting#5493
Conversation
There was a problem hiding this comment.
🤖 Isaac Lab Review Bot
Summary
This PR adds support for IsaacTeleop's pipelined retargeting execution mode, allowing retargeting to run on a worker thread instead of blocking the simulation loop. The implementation correctly handles backward compatibility with older IsaacTeleop versions that don't expose RetargetingExecutionConfig, falling back gracefully with appropriate warnings. The code is well-structured with proper feature detection and comprehensive test coverage.
Architecture Impact
Self-contained within isaaclab_teleop. The changes affect:
IsaacTeleopCfg- adds newretargeting_executionfield with smart defaultTeleopSessionLifecycle._try_start_session()- passes the config toTeleopSessionConfigwhen supported- No external callers are broken - the new field has a default factory that handles both old and new IsaacTeleop versions transparently
Implementation Verdict
Ship it - Clean implementation with proper feature detection, graceful fallback, and thorough test coverage.
Test Coverage
Thorough. The new TestRetargetingExecutionConfig class covers:
- Default value when IsaacTeleop supports the API (
test_cfg_defaults_to_pipelined_retargeting) - Default value when IsaacTeleop lacks the API (
test_cfg_defaults_to_none_with_legacy_isaacteleop) - Config propagation to session (
test_session_config_receives_cfg_retargeting_execution) - Graceful omission for legacy IsaacTeleop with warning (
test_session_config_omits_retargeting_execution_for_legacy_isaacteleop) - Error propagation from supported IsaacTeleop (
test_session_config_propagates_typeerror_from_supported_isaacteleop)
The test stub setup correctly adds RetargetingExecutionConfig to the mocked isaacteleop.teleop_session_manager module.
CI Status
No CI checks available yet.
Findings
🔵 Improvement: source/isaaclab_teleop/isaaclab_teleop/session_lifecycle.py:495-504 — Consider catching TypeError for unsupported kwargs
The current logic warns when _RETARGETING_EXECUTION_SUPPORTED is False but cfg.retargeting_execution is set. However, if a user has an older IsaacTeleop and somehow bypasses the default factory to set a non-None value, the code silently drops it. This is actually the correct behavior as tested, but a debug log might help users understand why their setting was ignored:
else:
logger.warning(
"Installed IsaacTeleop does not support retargeting_execution; "
"using its default retargeting behavior."
)
# Current: correctly omits from extra_kwargsThis is already handled correctly - just noting the logic is sound.
🔵 Improvement: source/isaaclab_teleop/isaaclab_teleop/isaac_teleop_cfg.py:43-46 — Type annotation could be more precise
The retargeting_execution field uses Any | None which is correct for cross-version compatibility, but the docstring could include a type hint comment for IDE support:
retargeting_execution: Any | None = field(default_factory=_default_retargeting_execution_config)
"""IsaacTeleop retargeting execution settings.
...
Type: ``RetargetingExecutionConfig | None`` when isaacteleop >= X.Y.Z
"""This is minor - the current approach is pragmatic given the dynamic nature of the dependency.
🔵 Improvement: source/isaaclab_teleop/test/test_cloudxr_lifecycle.py:74-80 — Test stub dataclass could match real API more closely
The stub RetargetingExecutionConfig defaults mode="sync", but the production default is "pipelined". While this doesn't affect test correctness (tests explicitly check the factory-produced default), matching the real API's signature would make the stub more authentic:
@dataclass
class RetargetingExecutionConfig:
mode: str = "pipelined" # Match real default if knownThis is cosmetic - the tests correctly verify the behavior regardless.
🔵 Improvement: source/isaaclab_teleop/changelog.d/hougantc-pipelined-retargeting.rst — Consider adding migration note
The changelog correctly documents the change, but a brief note about how existing configs are affected would help users:
Changed
^^^^^^^
* Changed :class:`~isaaclab_teleop.IsaacTeleopCfg` to enable IsaacTeleop
pipelined retargeting by default when supported by the installed
IsaacTeleop version. Set
``retargeting_execution=RetargetingExecutionConfig(mode="sync")`` to restore
exact current-frame retargeting.
.. note::
Existing configs without explicit ``retargeting_execution`` will automatically
use pipelined mode. This is backward compatible with older IsaacTeleop versions.
Greptile SummaryThis PR introduces pipelined IsaacTeleop retargeting by default via a new
Confidence Score: 3/5The unconditional import and unconditional kwarg in the retargeting integration will break any environment with an older IsaacTeleop install that predates RetargetingExecutionConfig. The install-side pip_upgrade_dependencies logic is solid and well-tested, but the module-level import in isaac_teleop_cfg.py and the TeleopSessionConfig call site in session_lifecycle.py have no backward-compat guards, so any older IsaacTeleop environment fails to load the extension entirely. The PR description explicitly promises a fallback for older installs, making the gap a meaningful correctness concern. source/isaaclab_teleop/isaaclab_teleop/isaac_teleop_cfg.py and source/isaaclab_teleop/isaaclab_teleop/session_lifecycle.py both need backward-compat guards for the RetargetingExecutionConfig import and kwarg. Important Files Changed
Reviews (2): Last reviewed commit: "fix: Upgrade teleop dependency during in..." | Re-trigger Greptile |
There was a problem hiding this comment.
🤖 Isaac Lab Review Bot
Summary
This is a follow-up review. The previous review found no blocking issues - only minor improvement suggestions. The new commit (aa04e7b) appears identical to the previous review state based on the diff and file contents.
Implementation Verdict
Ship it - No new issues introduced. The previous improvement suggestions were optional/cosmetic (better docstring type hints, changelog migration notes, test stub defaults). The core implementation is correct with proper feature detection, graceful fallback for older IsaacTeleop versions, and comprehensive test coverage.
CI Status
Core checks passing (pre-commit ✅, changelog fragments ✅, wheel build ✅). Infrastructure checks still pending but unrelated to code correctness.
aa04e7b to
90da029
Compare
7f5025e to
6d193ff
Compare
Add IsaacLab configuration to opt into IsaacTeleop pipelined retargeting when the installed IsaacTeleop version supports it. Fall back to the historical IsaacTeleop execution path on older installs that do not expose RetargetingExecutionConfig, and cover both paths in lifecycle tests.
Use DeadlinePacingConfig for pipelined retargeting so IsaacTeleop work is scheduled closer to when IsaacLab consumes the action. This reduces Python GIL contention during the start of simulation step and improves overlap with rendering, which can lower end-to-end teleoperation latency.
Check for RetargetingExecutionConfig and DeadlinePacingConfig before enabling the pipelined retargeting default. Older IsaacTeleop packages can expose teleop_session_manager without these newer configuration classes, so import success alone is not enough. Update the CloudXR lifecycle tests to cover both supported and legacy IsaacTeleop APIs while keeping their heavy dependency stubs isolated.
Default IsaacTeleop to deadline-paced pipelined retargeting. Pass the execution config directly into TeleopSessionConfig. Document why the 25 ms pacing margin staggers IsaacTeleop Python work. It lets native rendering overlap instead of competing for the GIL.
Read per-extension pip upgrade opt-ins from extension.toml so install.py can refresh selected install_requires dependencies without duplicating version specs. Use uv --upgrade-package for targeted upgrades and keep pip behavior narrow, which lets CI pick up newer compatible isaacteleop releases without broad dependency churn.
a386f88 to
9ea33ba
Compare
|
@greptile |
9ea33ba to
a92da7b
Compare
There was a problem hiding this comment.
Code Review
Thanks for this PR enabling pipelined IsaacTeleop retargeting! The deadline-paced execution approach is a solid optimization for reducing GIL contention. A few observations:
🔴 Potential Import-Time Compatibility Issue
File: source/isaaclab_teleop/isaaclab_teleop/isaac_teleop_cfg.py
The PR description states it should "Fall back to the historical IsaacTeleop execution path on older installs that do not expose RetargetingExecutionConfig." However, the import at line 15:
from isaacteleop.teleop_session_manager import DeadlinePacingConfig, RetargetingExecutionConfigis unconditional. This will raise an ImportError when loading IsaacTeleopCfg on older isaacteleop versions that don't have these classes, rather than falling back gracefully.
Suggested fix: Consider wrapping this import in a try/except block with a fallback (e.g., defining stub dataclasses or setting them to None) and adjusting session_lifecycle.py to handle the None case by omitting the retargeting_execution kwarg when calling TeleopSessionConfig.
🟡 Test Coverage Note
The tests stub out DeadlinePacingConfig and RetargetingExecutionConfig in the test fixtures, which is reasonable for unit testing but means CI won't catch the import-time failure scenario described above. Consider adding an integration test that verifies the module imports cleanly in environments with older isaacteleop versions (or without isaacteleop installed, if that's a supported configuration).
🟢 Well-Designed Features
-
Install upgrade mechanism: The
pip_upgrade_dependenciesfeature inextension.tomlis cleanly implemented with proper PEP 503 name normalization, metadata parsing, and support for both pip and uv. Good test coverage here. -
Documentation: Comprehensive updates to RST docs, README, and changelogs explaining the 25ms safety margin rationale.
-
Configuration design: The
RetargetingExecutionConfigintegration withIsaacTeleopCfgfollows the existing dataclass pattern well, with sensible defaults.
a92da7b to
9ea33ba
Compare
This PR improves IsaacLab Teleop retargeting performance and installation reliability.
IsaacTeleopCfg.retargeting_execution.pip_upgrade_dependenciessetting inextension.tomlso./isaaclab.sh --installcan explicitly upgrade selectedinstall_requiresdependencies after editable install.isaaclab_teleopto upgrade to the latest compatibleisaacteleopwithout duplicating the version spec outsidesetup.py.Why
The pipelined retargeting path reduces Python-side frame pressure by returning the latest completed retargeting output while the current frame is submitted in parallel.
The install change fixes CI/local environments where an older compatible
isaacteleopversion is already installed. Sincepip install -e source/isaaclab_teleopdoes not upgrade already-satisfied dependencies by default, CI could keep using a stale IsaacTeleop package. The new targeted upgrade keeps the version range insetup.pyas the source of truth while still allowing the install command to refreshisaacteleop.Description
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context.
List any dependencies that are required for this change.
Fixes # (issue)
Type of change
Screenshots
Please attach before and after screenshots of the change if applicable.
Checklist
pre-commitchecks with./isaaclab.sh --formatconfig/extension.tomlfileCONTRIBUTORS.mdor my name already exists there