Repository navigation
Studio video: keep the stream encode hook out of a compiled VAE decode graph - #14822
Merged
Merged
Conversation
…e graph With UNSLOTH_DIFFUSION_COMPILE_VAE=1 the decoder forward hook ran inside the compiled decode, and its thread start, queue put and CUDA stream context each broke the graph (6 breaks, 6 graphs on the tiny Wan VAE). Register the hook through torch.compiler.disable so it runs as one eager island: 2 breaks, 3 graphs, and the streamed mp4 is still used.
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. Keep it up! 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". |
danielhanchen
added a commit
that referenced
this pull request
Oct 23, 2026
… in #14822 (#14852) pre-commit.ci fails `ruff-format-with-kwargs` again on PRs queued after 00:36 UTC (#14834, #14835, #14836, #14842, #14845): `studio/backend/tests/test_video_stream_encode.py` was merged in #14822 without the formatter, so every PR's all-files run rewrites it. Same class as #14817. `python scripts/run_ruff_format.py` (the hook's entry point, `ruff==0.6.9`) applied to that one file. The AST is identical before and after, `ruff check` passes, and a full run of the hook over every tracked Python file on this branch changes nothing else.
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.
With
UNSLOTH_DIFFUSION_COMPILE_VAE=1, Studio compilesvae.decode, and the stream-encode forward hook onvae.decoderran inside that graph. Its thread start, queue put and CUDA stream context each broke the graph: 6 breaks and 6 graphs on a tiny Wan VAE, under both the eager backend and inductor.The hook is now registered through
torch.compiler.disable, so it runs as one eager island: 2 breaks and 3 graphs. The decoder compute stays compiled, and the streamed mp4 still matches the exported frames and is still used. Skipping the stream session under a compiled decode would give 0 breaks but lose the overlapped encode, so streaming is kept.Tests: a new test compiles the decode the way Studio does (
fullgraph=False, dynamic=True) and checks the frames, the stream use and the break count on CPU and CUDA. On a B200: 2 failed / 11 passed on main, 13 passed here.Not measured: the time cost of the 2 remaining breaks under compile.