Skip to content

[diffusion] Optimize LingBot realtime transport and camera conditioning - #27297

Merged
mickqian merged 5 commits into
sgl-project:mainfrom
mickqian:codex/lingbot-cam-raw-transport-20260605
Jun 5, 2026
Merged

mickqian merged 5 commits into
sgl-project:mainfrom
mickqian:codex/lingbot-cam-raw-transport-20260605

Conversation

@mickqian

@mickqian mickqian commented Jun 4, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

This PR reduces LingBot realtime serving latency in two places:

  • Cache LingBot camera conditioner scale/shift for denoise timesteps and prefetch the per-block cached values once per model forward. Context-cache update forwards recompute instead of reusing the denoise cache, so the causal state update stays bitwise consistent.
  • Send default realtime raw RGB as lossless raw bytes instead of delta-gzip, and split large payloads into a small msgpack header followed by raw bytes. The realtime collector supports both combined frame batches and header + payload messages.

Benchmark

Measured on a 4xH200 LingBot realtime run at 832x480, 6 chunks, using chunks 3/4/5 as steady-state.

Variant Steady chunk total Steady scheduler forward raw payload build
main baseline 2360 ms 2252 ms ~20-22 ms/chunk
this PR 2114 ms 2092 ms ~1 ms/chunk

This is a 10.3% steady chunk total improvement and a 7.1% scheduler-forward improvement in the measured run.

Consistency

4xH200 realtime consistency matched the baseline bitwise:

  • frames: [45, 480, 832, 3]
  • sha256: e7692f77377df12aebed86b4193b33f0007bc8489757d32e41f9989a471c1d8d

Tests

python -m pytest \
  python/sglang/multimodal_gen/test/unit/realtime/test_realtime_output_transport.py \
  python/sglang/multimodal_gen/test/unit/realtime/test_lingbot_causal_denoising.py \
  -q

Result: 27 passed in latest CI-fix validation.

Additional CI OOM validation:

  • Single-GPU LingBot realtime server case lingbot_world_realtime_plastic_beach: 1 passed in 115.69s.
  • Fix scope: disable LingBot realtime request warmup in CI and wait for server_warmup_done on realtime websocket before accepting generation work.

CI States

Latest PR Test (Base): ✅ Run #26999422139
Latest PR Test (Extra): ✅ Run #26999422012

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@mickqian

mickqian commented Jun 4, 2026

Copy link
Copy Markdown
Collaborator Author

/tag-and-rerun-ci

@github-actions github-actions Bot added diffusion SGLang Diffusion run-ci CI: run the baseline test suite on this PR labels Jun 4, 2026
@mickqian
mickqian force-pushed the codex/lingbot-cam-raw-transport-20260605 branch from 724a521 to 57ca8f5 Compare June 4, 2026 20:35
@mickqian

mickqian commented Jun 4, 2026

Copy link
Copy Markdown
Collaborator Author

/tag-and-rerun-ci

@mickqian

mickqian commented Jun 5, 2026

Copy link
Copy Markdown
Collaborator Author

/tag-and-rerun-ci

@mickqian

mickqian commented Jun 5, 2026

Copy link
Copy Markdown
Collaborator Author

/tag-and-rerun-ci extra

@github-actions github-actions Bot added the run-ci-extra CI: also run the extra suite (requires run-ci) label Jun 5, 2026
@mickqian
mickqian merged commit 4ef081b into sgl-project:main Jun 5, 2026
118 of 124 checks passed
Chronostasys pushed a commit to MindLab-Research/sglang that referenced this pull request Aug 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

diffusion SGLang Diffusion run-ci CI: run the baseline test suite on this PR run-ci-extra CI: also run the extra suite (requires run-ci)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant