Repository navigation
Conversation
…ansport Signed-off-by: mglyn <1203789601@qq.com>
Signed-off-by: mglyn <1203789601@qq.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
This draft adds an opt-in transport path that removes three redundant host-side copies after video generation:
The implementation writes CUDA output directly into registered POSIX shared memory, preserves the mapping for the lifetime of the receiver's borrowed view, and uses
VideoFrame.from_numpy_bufferfor contiguous RGBuint8frames. The mandatory device-to-host transfer remains; "zero copy" refers to the eliminated host-side copies around IPC and encoding.The existing path remains the default. Enable the experiment with:
The direct GPU-to-SHM direction was proposed earlier in upstream PR #2197, which removed the NumPy staging copy. This draft extends that early work by registering POSIX SHM for D2H, borrowing the receiver mapping, and borrowing RGB buffers in PyAV. It remains a small copy-elision baseline that can compose with the chunkwise producer/consumer design in RFC #6872.
Evaluation
Both experiments used separately started server blocks in
A1 -> B1 -> B2 -> A2order. Prompt, seed, model configuration, and commit were fixed; only the two environment flags differed.MiniMax-H3 end-to-end breakdown
Stage-0 includes model generation, Video-VAE decode, and output transport.
Output-ready waitand the derived transport boundary are two views of that transport tail; they are not additional sequential stages.The request-level bootstrap 95% confidence interval for the mean end-to-end difference was
[-0.620, -0.261] s. All 20 measured MP4 files were byte-identical. GPU memory was unchanged: 94,272 MiB profiler peak; 99,865 MiB existing versus 99,863 MiB experimental maximum sampled usage.LTX-2.5 generation breakdown
The LTX run used native pipeline-profiler aggregation. Its Stage-0 subphases below are not exhaustive, but they show that the observed change is outside denoise and VAE decode.
Client E2E, output-ready wait, derived transport, and MP4 encoding were not aggregated with the same request-level methodology as the MiniMax-H3 run, so they are intentionally not compared here. All eight measured requests succeeded. The two existing-path Stage-0 block means were 30.270 s and 27.037 s, making the 9.97% result directional rather than a stable point estimate.
Validation