Skip to content

Add postprocessing to cam2v lingbot - #586

Merged
gtong-nv merged 12 commits into
mainfrom
dev/gtong/upsampler-v2
Sep 10, 2026
Merged

Add postprocessing to cam2v lingbot#586
gtong-nv merged 12 commits into
mainfrom
dev/gtong/upsampler-v2

Conversation

@gtong-nv

@gtong-nv gtong-nv commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Add persistent, prewarmed postprocessing for the Lingbot Cam2V rollout.
  • Let any configured postprocessor declare its output size; the app presents that size without mutating the model session descriptor.
  • Add --postprocess-comparison-ui to show the raw/upscaled and postprocessed streams side by side.
  • Keep postprocessing running when its UI toggle changes, and select only which output frames are presented.
  • Preserve presentation backlog draining and scope the change away from Interactive Drive.

Signed-off-by: Gangzheng Tong <gtong@nvidia.com>
@copy-pr-bot

copy-pr-bot Bot commented Sep 4, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

Signed-off-by: Gangzheng Tong <gtong@nvidia.com>
Signed-off-by: Gangzheng Tong <gtong@nvidia.com>
Signed-off-by: Gangzheng Tong <gtong@nvidia.com>
Signed-off-by: Gangzheng Tong <gtong@nvidia.com>
@gtong-nv
gtong-nv marked this pull request as ready for review September 4, 2026 19:45
@greptile-apps

greptile-apps Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

The pull request appears safe to merge, with the previously reported presentation-size and reset failures no longer outstanding.

Summary

  • Prepares and retains postprocessor resources for the session lifecycle.
  • Keeps postprocessing active while the UI selects raw or processed presentation.
  • Resizes raw fallback frames to the declared presentation contract.
  • Composes synchronized original and processed frames for comparison mode.
  • Updates presentation pacing to include postprocessing time and preserve backlog draining.
  • Adds CPU tests for stream lifecycle, output dimensions, comparison pairing, UI behavior, and pacing.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Cam2V model step] --> B[Generated frames]
  B --> C[Persistent postprocess stream]
  C --> D[Postprocessed frames]
  B --> E{Presentation mode}
  D --> E
  E -->|Raw selected| F[Resize raw frames to output size]
  E -->|Processed selected| G[Present processed frames]
  E -->|Comparison| H[Pair and concatenate raw plus processed]
  F --> I[StepResult]
  G --> I
  H --> I
  I --> J[Presentation manager and output sink]
Loading

Comment thread apps/cam2v/cam2v/session.py
@gtong-nv gtong-nv changed the title Add postprocessing to lingbot and interactive drive v2 demos Add postprocessing to cam2v lingbot Sep 4, 2026
Signed-off-by: Gangzheng Tong <gtong@nvidia.com>
Signed-off-by: Gangzheng Tong <gtong@nvidia.com>
Signed-off-by: Gangzheng Tong <gtong@nvidia.com>
Signed-off-by: Gangzheng Tong <gtong@nvidia.com>
@gtong-nv

gtong-nv commented Sep 5, 2026

Copy link
Copy Markdown
Collaborator Author

/ok to test 876eef1

Signed-off-by: Gangzheng Tong <gtong@nvidia.com>
@gtong-nv

gtong-nv commented Sep 5, 2026

Copy link
Copy Markdown
Collaborator Author

/ok to test c0e878b

@jmccaffrey-nv jmccaffrey-nv left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for the thoughtful iteration here—the persistent stream, fixed presentation sizing, and comparison UI are a solid direction.

I’m requesting changes for two P1s:

  • The new reset contract is not satisfied by every preset Cam2V advertises, so an RTX preset fails the reconnect/reset lifecycle required by #479.
  • Once cadence is learned, the shared presentation clock ignores backlog, undoing the latency safeguard from #542 and changing Interactive Drive behavior despite that being out of scope.

The latest commit fixed the earlier pacing-test mismatch; the focused CPU suite now passes: 137 passed.

Two P2 follow-ups:

  • For a stream beginning with exactly 8/16 frames, pass the real first chunk as AR0 (the encoder accepts it) instead of priming temporal/KV state with a discarded repeated-frame chunk; please add a non-constant-input test.
  • --postprocess-compile defaults to false even though the preset default and Lingbot docs imply the compiled/prewarmed path is the default. Please preserve the preset unless the flag is explicitly supplied (for example, default=None), or align the docs and help text.

I did not duplicate the existing inline comment about raw-frame presentation sizing.

— assisted by GPT 5.6 Sol

Comment thread flashdreams/flashdreams/infra/postprocess/base.py
Comment thread flashdreams/flashdreams/runtime_v2/presentation_manager.py Outdated
@gtong-nv

gtong-nv commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator Author

/ok to test 430caef

@gtong-nv

gtong-nv commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator Author

It measures the model.step(), but this is still not the end to end FPS that the user will perceive.
For example, for CUDA tensors in the stepResult, it generally does not measure actual GPU completion or D2H copy:

Maybe we name it model_step_FPS

@gtong-nv
gtong-nv added this pull request to the merge queue Sep 9, 2026
Merged via the queue into main with commit 6472ef3 Sep 10, 2026
9 checks passed
@gtong-nv
gtong-nv deleted the dev/gtong/upsampler-v2 branch September 10, 2026 00:11
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