Skip to content

feat(teleop): add latest-result pipelined retargeting#467

Merged
hougantc-nvda merged 2 commits into
NVIDIA:mainfrom
hougantc-nvda:hougantc/pipelined-retargeting
May 7, 2026
Merged

feat(teleop): add latest-result pipelined retargeting#467
hougantc-nvda merged 2 commits into
NVIDIA:mainfrom
hougantc-nvda:hougantc/pipelined-retargeting

Conversation

@hougantc-nvda
Copy link
Copy Markdown
Contributor

@hougantc-nvda hougantc-nvda commented May 5, 2026

This PR adds opt-in pipelined retargeting for TeleopSession, allowing applications to submit the current frame’s retarget request while returning the latest completed result after an initial seed frame. The default synchronous mode preserves exact current-frame sample/compute/return behavior, while pipelined mode runs the normal step body on a single background worker and keeps returned outputs, last_context, and step metadata self-consistent for the completed frame.

It also adds execution and pacing configuration, including immediate and deadline-based pacing, plus last_step_info timing/age diagnostics for observing result freshness, dropped submissions, deadline misses, and worker failures. Snapshot support for TensorGroup values was added so external inputs and cached outputs can safely cross the async boundary, with docs and tests covering the new contract.

Summary by CodeRabbit

  • New Features

    • Pipelined async retargeting execution mode with configurable pacing strategies (immediate and deadline-based)
    • New session properties for step execution metadata and compute context tracking
  • Bug Fixes

    • Improved snapshot handling for device-backed arrays using framework-specific methods instead of deep copies
  • Documentation

    • Comprehensive guide for retargeting execution configuration and pipelining semantics
    • Build guidance for CMake configuration options
  • Tests

    • Extensive async retargeting execution coverage
    • Tensor group snapshot compatibility tests

@hougantc-nvda hougantc-nvda requested review from nvddr and rwiltz May 5, 2026 02:51
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 5, 2026

📝 Docs preview is not auto-deployed for fork PRs.

A maintainer with write access to NVIDIA/IsaacTeleop can deploy a preview by
commenting /preview-docs on this PR. Once deployed, the preview
will live at:

https://nvidia.github.io/IsaacTeleop/preview/pr-467/

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 5, 2026

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 79ccb1c9-88a0-40ad-8b65-d56d072924f6

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

This pull request introduces pipelined asynchronous retargeting execution for TeleopSession. A new AsyncRetargetRunner manages a background worker thread that executes retargeting steps with configurable deadline-based or immediate pacing, allowing the main application thread to submit work and retrieve the latest completed frame. The tensor snapshotting mechanism is enhanced to prefer device-specific copy operations (via create_snapshot() hooks or DLPack protocol) before falling back to deep-copy. TeleopSession now dispatches between synchronous and pipelined execution modes, tracks per-step timing metadata via RetargetingStepInfo, and filters external inputs before snapshotting to prevent cross-frame aliasing. Configuration types for execution mode and pacing strategies are introduced, along with comprehensive test coverage for pipelined semantics, context propagation, and worker exception handling.

Sequence Diagram

sequenceDiagram
    participant App as Application
    participant TS as TeleopSession
    participant Runner as AsyncRetargetRunner
    participant Worker as Background Worker
    
    App->>TS: step(external_inputs, ...)
    TS->>TS: Determine execution mode (latch)
    
    alt First Step (Pipelined)
        TS->>TS: Seed: execute synchronously
        TS->>Runner: publish_seed(frame)
        Runner->>Runner: Store initial frame
        TS->>App: Return seeded frame
    else Subsequent Steps (Pipelined)
        TS->>Runner: submit(StepRequest)
        activate Runner
        Runner->>Runner: Replace pending work (if pacing allows)
        Runner->>Runner: Notify worker
        deactivate Runner
        
        par Background Execution
            Worker->>Worker: Wait for pacing delay
            Worker->>Worker: _execute_step_request()
            Worker->>Worker: Snapshot outputs & context
            Worker->>Runner: Publish completed frame
        end
        
        TS->>Runner: latest()
        Runner->>TS: Return newest completed frame
        TS->>App: Return frame (may be from previous submission)
    else Synchronous
        TS->>TS: _execute_step_request()
        TS->>App: Return frame immediately
    end
    
    Note over TS,Runner: Mode latched on first step<br/>prevents mid-run switching
    Note over Runner,Worker: Pacing delay allows<br/>request superseding
    Note over App,TS: last_step_info tracks<br/>age, timing, deadlines
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 45.57% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat(teleop): add latest-result pipelined retargeting' directly summarizes the main change: introducing pipelined retargeting with latest-result semantics.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/core/teleop_session_manager/python/teleop_session.py`:
- Around line 374-383: The bug: when snapshot_external_inputs is false
(sync/default path) we still forward unexpected nested per-leaf keys to
execute_pipeline because _filter_external_inputs is only applied inside the
snapshot_external_inputs branch; fix by applying _filter_external_inputs
regardless of snapshot flag before building request_external_inputs. Update the
logic around _validate_external_inputs, _filter_external_inputs,
snapshot_pipeline_inputs, and request_external_inputs so that external_inputs is
passed through _filter_external_inputs unconditionally (then
snapshot_pipeline_inputs only when snapshot_external_inputs is true) so both
sync and pipelined modes drop extra per-leaf keys consistently.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: ae084988-ad5f-485f-84dc-da676be73136

📥 Commits

Reviewing files that changed from the base of the PR and between 4da8221 and 3ffb4ab.

📒 Files selected for processing (12)
  • AGENTS.md
  • docs/source/getting_started/teleop_session.rst
  • src/core/AGENTS.md
  • src/core/retargeting_engine/python/interface/tensor_group.py
  • src/core/retargeting_engine_tests/python/test_tensor_group.py
  • src/core/teleop_session_manager/CMakeLists.txt
  • src/core/teleop_session_manager/python/__init__.py
  • src/core/teleop_session_manager/python/async_retarget_runner.py
  • src/core/teleop_session_manager/python/config.py
  • src/core/teleop_session_manager/python/teleop_session.py
  • src/core/teleop_session_manager_tests/python/test_session_reset.py
  • src/core/teleop_session_manager_tests/python/test_teleop_session.py

Comment thread src/core/teleop_session_manager/python/teleop_session.py
Pipelined retargeting now submits the current request and returns the latest completed output after the seed frame. Exact current-frame sample/compute/return behavior stays in sync mode, while deadline-guarded pacing improves temporal alignment without current-frame barriers.

Add the async runner, immediate/deadline pacing configs, docs, and tests for the simplified contract.
@hougantc-nvda hougantc-nvda force-pushed the hougantc/pipelined-retargeting branch from 52183e7 to 11607bd Compare May 7, 2026 14:14
@hougantc-nvda hougantc-nvda merged commit 260f766 into NVIDIA:main May 7, 2026
43 checks passed
hougantc-nvda added a commit that referenced this pull request May 7, 2026
* feat(teleop): add latest-result pipelined retargeting

Pipelined retargeting now submits the current request and returns the latest completed output after the seed frame. Exact current-frame sample/compute/return behavior stays in sync mode, while deadline-guarded pacing improves temporal alignment without current-frame barriers.

Add the async runner, immediate/deadline pacing configs, docs, and tests for the simplified contract.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants