Fix MiniMax H3 audio VAE DynamicVRAM thrashing - #15371
Conversation
|
✅ All contributors have signed the CLA. Thank you! This PR is ready to be merged. |
|
I have read and agree to the Contributor License Agreement |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📜 Recent review details🧰 Additional context used📓 Path-based instructions (6)**/*📄 CodeRabbit inference engine (AGENTS.md)
Files:
**/*.py📄 CodeRabbit inference engine (AGENTS.md)
Files:
**/*.{py,json}📄 CodeRabbit inference engine (AGENTS.md)
Files:
**/*.{py,md,txt,json}📄 CodeRabbit inference engine (AGENTS.md)
Files:
**⚙️ CodeRabbit configuration file
Files:
comfy/**⚙️ CodeRabbit configuration file
Files:
🧠 Learnings (3)📚 Learning: 2026-02-21T14:01:41.482ZApplied to files:
📚 Learning: 2026-05-13T12:31:45.069ZApplied to files:
📚 Learning: 2026-08-06T22:18:59.719ZApplied to files:
🔇 Additional comments (1)
📝 WalkthroughWalkthroughThe MiniMax H3 audio VAE configuration now sets 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
what are the repeated VRAM transfers? This doesnt add up. CoreModelPatcher does not imply a repeating transfer (aka async offload). Something else must be going on. |
Summary
Problem
MiniMaxH3AudioVAEis about 577 MB, but it currently inheritsdisable_offload = False. That selectsCoreModelPatcher, so its weights are streamed during decode. In the reproduced Windows/NVIDIA path this caused repeated VRAM transfers and made a 5-second audio decode take about 153 seconds.This also avoids the exact
576MB Staged, 401 weightsDynamicVRAM path reported in #15276 and the broader host-buffer failures discussed in #15255.Change
Set the VAE-owned
disable_offloadflag when the MiniMax H3 audio checkpoint is detected. This selects the regularModelPatcherand the existing full-load decode path, matching other audio VAE integrations that disable offloading.The tradeoff is keeping about 577 MB resident while the audio VAE is loaded. Global DynamicVRAM remains enabled for larger models.
Validation
python -m py_compile comfy/sd.pygit diff --checkminimax_h3_audio_vae_fp32.safetensorsthroughcomfy.sd.VAEdisable_offload == True,ModelPatcher, andis_dynamic() == False[1, 32, 2, 200]5-second latent to finite[1, 160000, 2]audioloaded completely; 577.08 MB loaded, full load: Trueand completed the prompt in 0.70 s