Repository navigation
Studio video: stream the Wan encode under model / sequential offload too - #15173
Merged
Merged
Conversation
open_stream_encode refused any Wan VAE whose decoder parameters sat on the host when the render began. Model and sequential offload park the VAE there between renders and onload it for the decode, so every offloaded Wan render (low_vram, A14B / 14B on smaller cards) encoded only after the decode. The gate now also accepts a host-parked decoder when the pipeline executes on CUDA, as the MiniMax-H3 session already does. The frame identity check and every fallback are unchanged.
Member
Author
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. More of your lovely PRs please. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
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
#14405 encodes a Wan clip while the VAE decodes it. A forward hook on the decoder turns each finished chunk into frames, and a libx264 thread encodes them during the decode.
open_stream_encodeonly accepted a decoder whose weights were already on CUDA when the render started. Model and sequential offload keep the VAE on the host between renders, so every offloaded Wan render (low_vram, the 14B / A14B models on smaller cards, T4) never streamed and paid the whole encode after the decode.Changes
UNSLOTH_STUDIO_VIDEO_STREAM_ENCODE=0.Results
Exclusive B200, real weights, default size, frames and steps. One warm-up, then off / on / on / off / off / on in one process. Medians of 3, seconds.
low_vram(newly streams)low_vram(newly streams)low_vramVAE sits oncpuwith the execution devicecuda:0, and the render reportsstreamed: false.Output identity
low_vramand Wan2.1-1.3Blow_vramproduced the same mp4 bytes in every run of both arms.low_vramfile).Tests
tests/test_video_stream_encode.py: a host-parked decoder opens a session only when the pipeline executes on CUDA (not with no execution device or a CPU one), and the kill switch still turns it off.tests/test_video_*.py: 2611 passed, 105 skipped.Limits