Skip to content

Overlap H3 video decode and MP4 export with exact R85 output - #1

Open
Tokha233 wants to merge 3 commits into
mainfrom
feat/r85-streaming-export
Open

Tokha233 wants to merge 3 commits into
mainfrom
feat/r85-streaming-export

Conversation

@Tokha233

@Tokha233 Tokha233 commented Oct 2, 2026 •

Copy link
Copy Markdown
Owner

Decode and encode a single H3 MP4 concurrently through an optional Decode and Save Video node. Keep the R85 VAE/RGB8 arithmetic and codec contract: two pinned D2H slots feed a request-owned copy worker and a bounded CPU encoder. Existing Decode/Save nodes remain available.

On RTX 5090 D v2, two saved R85 latents measured 11.509 → 9.311 s and 12.474 → 9.965 s from video decode to completed MP4 (BAAB/ABBA, four formal repeats per arm/case). Every RGB, PCM and MP4 hash matches the historical baseline. These are output-stage latency improvements. No DiT kernel or precision changes.

The October 8 full-pipeline check adds fixed conditioning → DiT → VAE → completed local MP4 for two representative 10/11-second clips. Same-GPU subprocess-export controls give 461.182 → 457.122 s and 461.942 → 457.664 s in opposite orders. An additional resident in-process encoder control gives 461.569 → 458.662 s (2.907 s saved; +0.634% inverse two-request queue duration). Across six runs, all 12 formal requests and six warmups retain the historical latent/RGB/PCM/MP4 hashes. GPU completion spans are essentially unchanged: the benefit is predominantly the final file tail. No sustained serving-QPS or P95 improvement is claimed. The resident-codec result is one same-card pair, not a long stress test; reference/text encoding, network and cold checkpoint loading are excluded.

Validation: 16 CPU/codec tests on the CUDA host; five CUDA chunk layouts, two concurrent sinks, callback failure and cleanup; full helper and actual Comfy output node produce the historical MP4; interrupt removes partial output and joins workers. Includes an opt-in public benchmark CLI, source hashes and raw records. A stalled native codec/driver still requires external process supervision; no hard cancellation deadline is claimed.

Inspired by SGLang #41819. This integration keeps SpeedKit’s PyAV codec contract and moves pinned-slot draining off the GPU submission thread. It is a SpeedKit feature, not a duplicate SGLang/Kitchen submission.

See docs/R85-STREAM-EXPORT.zh-CN.md, evidence/r85-stream-1002/, and evidence/r85-pipeline-1008/ for protocol, limitations and evidence.

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.

1 participant