You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add a LingBot-World v2 7-GPU split streaming configuration with async VAE decode and condition prefetch. The runtime can place condition/T5 encoding, VAE decoding, and DiT ranks on separate GPUs.
Motivation
LingBot-World v2 streaming was bottlenecked by serialized condition encode, DiT, and VAE decode stages. Splitting VAE decode onto a separate GPU and prefetching the next condition chunk allows condition encode and VAE decode to overlap with DiT work, improving steady-state streaming throughput.
Type of Change
Bug fix (non-breaking change which fixes an issue)
New feature (non-breaking change which adds functionality)
Breaking change (fix or feature that would cause existing functionality to not work as expected)
Performance improvement
Code refactoring
Documentation update
Other (please describe):
Changes Made
Add an async LingBot VAE decode worker with ordered chunk handles, cancellation, cleanup, and profiling metadata.
Add optional separate async_vae_config so VAE encode and VAE decode can use different GPU/runtime placements.
Add condition prefetch support to encode the next condition chunk ahead of DiT consumption.
PR title follows the convention: [TYPE] Brief description
Related Issues
Fixes #
Additional Notes
This PR does not add or modify CUDA/Triton kernels. The async VAE worker is Python/PyTorch runtime orchestration only.
The benchmark was run on H100 GPUs with the final 7-GPU layout:
GPU0: condition VAE encode + T5/text encode
GPU1: async VAE decode
GPU2-6: DiT ranks 0-4
GPU Architecture Support
SM80 (Ampere, Ada Lovelace)
SM90 (Hopper H100)
SM100+ (Blackwell)
Performance Impact
The 7-GPU split async VAE configuration reached 17.068 FPS in the measured 20-chunk benchmark. Compared with the prior 8-GPU synchronous measurement of 10.38 FPS, this improves steady-state throughput by approximately 64.4%, while using one fewer GPU.
The current LingBot v2 realtime path already uses an actor-based three-stage pipeline:
VAE encode: dedicated actor
DiT denoise: dedicated multi-GPU actor (FSDP/Ulysses)
VAE decode: dedicated actor
The stages are connected through bounded edges, so encode, DiT, and decode are not invoked serially from the service loop. The realtime ingress now prefetches subsequent control chunks whenever the actor graph has capacity and the control is already known. It does not speculate about
controls that are still being held by the user.
This lets encode process the next input while the previous chunk is running in DiT, while decode can overlap with later encode/DiT work. This matches the goal of this PR—splitting VAE streaming and allowing condition / DiT / decode to form an asynchronous pipeline.
The main difference is that the current implementation reuses TeleFuser’s generic actor scheduler and bounded queues instead of maintaining a separate async VAE manager inside the service. LiveKit is not involved in this path.
We validated this with a real WebRTC session on 4×H100: later encode_condition_chunk work completed before the previous denoise_and_update_cache finished, and decode continued to interleave with subsequent encode/DiT work. The scheduler also reported a continuous DiT interval with
idle=0.000s.
It would be useful to add a reproducible A/B benchmark:
Use a fixed image, seed, and prerecorded control sequence for 20+ chunks.
Compare the previous “submit only after the current chunk is consumed” behavior with the current bounded-prefetch behavior.
Collect DiT stage_idle_intervals, chunk compute latency, end-to-end first/subsequent-frame latency, and peak memory.
Verify output ordering and deterministic equivalence for fixed controls.
The expected outcome is lower DiT idle time and smoother output cadence, while preserving bounded per-session queue capacity.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Add a LingBot-World v2 7-GPU split streaming configuration with async VAE decode and condition prefetch. The runtime can place condition/T5 encoding, VAE decoding, and DiT ranks on separate GPUs.
Motivation
LingBot-World v2 streaming was bottlenecked by serialized condition encode, DiT, and VAE decode stages. Splitting VAE decode onto a separate GPU and prefetching the next condition chunk allows condition encode and VAE decode to overlap with DiT work, improving steady-state streaming throughput.
Type of Change
Changes Made
async_vae_configso VAE encode and VAE decode can use different GPU/runtime placements.Testing
pytest tests/)Test commands:
python -m py_compile telefuser/pipelines/lingbot_world_fast/async_vae.py telefuser/pipelines/lingbot_world_fast/denoising.py telefuser/pipelines/lingbot_world_fast/pipeline.py telefuser/pipelines/lingbot_world_fast/service.py telefuser/pipelines/lingbot_world_fast/session.py examples/lingbot/stream_lingbot_world_v2_7gpu_split_async_vae.pypython -m ruff check telefuser/pipelines/lingbot_world_fast/async_vae.py telefuser/pipelines/lingbot_world_fast/denoising.py telefuser/pipelines/lingbot_world_fast/pipeline.py telefuser/pipelines/lingbot_world_fast/service.py telefuser/pipelines/lingbot_world_fast/session.py examples/lingbot/stream_lingbot_world_v2_7gpu_split_async_vae.py tests/unit/pipelines/lingbot_world_fast/test_pipeline_call.py tests/unit/pipelines/lingbot_world_fast/test_runtime_baseline.py tests/unit/pipelines/lingbot_world_fast/test_service_action_loop.py tests/unit/pipelines/lingbot_world_v2/test_service.pypython -m ruff format --check telefuser/pipelines/lingbot_world_fast/async_vae.py telefuser/pipelines/lingbot_world_fast/denoising.py telefuser/pipelines/lingbot_world_fast/pipeline.py telefuser/pipelines/lingbot_world_fast/service.py telefuser/pipelines/lingbot_world_fast/session.py examples/lingbot/stream_lingbot_world_v2_7gpu_split_async_vae.py tests/unit/pipelines/lingbot_world_fast/test_pipeline_call.py tests/unit/pipelines/lingbot_world_fast/test_runtime_baseline.py tests/unit/pipelines/lingbot_world_fast/test_service_action_loop.py tests/unit/pipelines/lingbot_world_v2/test_service.pygit diff --checkpytestwas not run because the current environment does not havepytestinstalled.Manual benchmark summary:
Checklist
ruff)pre-commit run --all-files)pytest tests/)[TYPE] Brief descriptionRelated Issues
Fixes #
Additional Notes
This PR does not add or modify CUDA/Triton kernels. The async VAE worker is Python/PyTorch runtime orchestration only.
The benchmark was run on H100 GPUs with the final 7-GPU layout:
GPU Architecture Support
Performance Impact
The 7-GPU split async VAE configuration reached 17.068 FPS in the measured 20-chunk benchmark. Compared with the prior 8-GPU synchronous measurement of 10.38 FPS, this improves steady-state throughput by approximately 64.4%, while using one fewer GPU.