GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix: keep MiniMax-H3 VAE weights resident across temporal chunks by losewayy · Pull Request #2103 · leejet/stable-diffusion.cpp

Conversation

@losewayy

@losewayy losewayy commented Oct 6, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Each temporal chunk of the MiniMax-H3 video VAE decode (and encode) goes through VAE::decode/VAE::encode, whose trailing runner_end() evicts the weights from the compute backend (~4.6GB for the decoder). With 7 temporal chunks per decode this re-stages the full weights 7 times, and under auto-fit on a VRAM-constrained GPU the params land on the disk tier, so every chunk re-reads the safetensors (~3s each, ~20s wasted per video).

Keep the runner alive across the temporal chunk loop and end it once when the loop finishes. VAE::decode/VAE::encode gain a non-virtual overload taking an auto_end flag (mirroring compute()'s auto_runner_end); the virtual signatures are unchanged, so every existing override keeps working.

MiniMax-H3 is the only affected model: it is the only VAE runner that drives VAE::decode/VAE::encode inside a temporal chunk loop (Wan/LTX do temporal tiling inside _compute within a single runner lifetime).

Tested

  • sd-cli -M vid_gen, MiniMax-H3 (Q4_K DiT + Q2_K_M Qwen3-VL + fp16 video VAE), 864x480, 124 frames, 8 steps, seed 12345, auto-fit defaults, CUDA 13 / Windows / RTX 5070 Ti Laptop (12 GB)
  • decode_first_stage: 53.4s -> 34.3s (-36%); generate_video: 299.7s -> 281.7s; decoded output is bit-identical to unpatched (per-frame pixel diff 0.0)
  • Builds clean on master with the recorded ggml

The encode path shares the same defect and is fixed the same way; it cannot be exercised end-to-end on a 12 GB card because the H3 encoder workspace demand (~9.8GB per chunk) exceeds the device budget — the same failure occurs on unpatched stock, so this is not a regression.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@losewayy
fix: keep MiniMax-H3 VAE weights resident across temporal chunks
fb30e52
Each temporal chunk of the MiniMax-H3 video VAE decode and encode went through VAE::decode/VAE::encode, whose trailing runner_end() evicts the ~5GB weights from the compute backend, so the next chunk re-staged them (under auto-fit even re-reading the safetensors from disk).

Keep the runner alive across the temporal chunk loop and end it once when the loop finishes. VAE::decode/VAE::encode gain a non-virtual overload with an auto_end flag; the virtual signatures are unchanged so existing overrides are unaffected.
@losewayy
losewayy force-pushed the h3-vae-runner-lifetime branch from 2710b40 to fb30e52 Compare October 6, 2026 07:32
@leejet
leejet merged commit 0963357 into leejet:master Oct 6, 2026
10 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@laurentvv laurentvv mentioned this pull request Oct 8, 2026
Video regressions on 16 GB Vulkan: LTX-2.5 + MiniMax-H3 broken since master-864, Wan 2.2 broken by master-866 (graph segmentation / weight-budget behavior) — --auto-fit off only rescues Wan #1976
Closed
@losewayy
losewayy deleted the h3-vae-runner-lifetime branch November 10, 2026 18:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@losewayy @leejet
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.