mirror of
https://github.com/Comfy-Org/comfy-kitchen.git
synced 2026-11-04 23:37:42 +00:00
[PR #167] [MERGED] MiniMax H3 VAE kernels: fused encoder pad/norm, fp16-accumulate conv3d and GEMM, int8 residual epilogue #195
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Comfy-Org/comfy-kitchen#195
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Comfy-Org/comfy-kitchen/pull/167
Author: @kijai
Created: 9/8/2026
Status: ✅ Merged
Merged: 9/13/2026
Merged by: @comfyanonymous
Base:
main← Head:minimax_vae📝 Commits (10+)
ad9a4a8initial int8 sol-attn implemenation75113d3Merge remote-tracking branch 'upstream/main' into sol_attn6716dfaMerge remote-tracking branch 'upstream/main' into sol_attnc27d802sol_attn: centroid-tail routing (1.38x), u8 P quantization, and key_bias masks79a7532Fixesd7fc603Merge remote-tracking branch 'upstream/main' into sol_attn883e710ruffc04ef20Add reuse_qkv_memory to reduce peak VRAM85c4142Merge remote-tracking branch 'upstream/main' into sol_attnb17db5dOptimize routing📊 Changes
27 files changed (+2914 additions, -558 deletions)
View changed files
📝
comfy_kitchen/__init__.py(+97 -5)📝
comfy_kitchen/backends/_activations.py(+29 -1)📝
comfy_kitchen/backends/cuda/CMakeLists.txt(+3 -0)📝
comfy_kitchen/backends/cuda/__init__.py(+333 -42)📝
comfy_kitchen/backends/cuda/dlpack_bindings.cpp(+321 -27)📝
comfy_kitchen/backends/cuda/input_act_codes.h(+2 -2)📝
comfy_kitchen/backends/cuda/ops/convrot_w4a4.cu(+14 -11)➕
comfy_kitchen/backends/cuda/ops/cutlass_conv3d_fp16.cu(+146 -0)➕
comfy_kitchen/backends/cuda/ops/cutlass_gemm_common.cuh(+259 -0)➕
comfy_kitchen/backends/cuda/ops/cutlass_gemm_fp16.cu(+246 -0)📝
comfy_kitchen/backends/cuda/ops/cutlass_gemm_int8.cu(+174 -433)➕
comfy_kitchen/backends/cuda/ops/group_norm_pad3d.cu(+226 -0)📝
comfy_kitchen/backends/cuda/ops/int8_linear.cu(+81 -17)📝
comfy_kitchen/backends/cuda/ops/w4a8_gemm.cu(+5 -2)📝
comfy_kitchen/backends/eager/__init__.py(+33 -0)➕
comfy_kitchen/backends/eager/conv3d.py(+44 -0)➕
comfy_kitchen/backends/eager/group_norm_pad3d.py(+67 -0)📝
comfy_kitchen/backends/eager/quantization.py(+38 -3)📝
comfy_kitchen/backends/hip/__init__.py(+15 -2)📝
comfy_kitchen/backends/triton/quantization.py(+13 -2)...and 7 more files
📄 Description
Kernels to speedup the MiniMax-H3 video VAE. Requires core side PR to use:
https://github.com/Comfy-Org/ComfyUI/pull/16187
Encoder (conv)
pass, NDHWC output so cuDNN runs without layout conversions. Lossless, always on.
Only used under --fast fp16_accumulation
Decoder (ViT)
launches too small to fill the GPU are handed back to cuBLAS.
quantizer, wave-quantization guard between the 128x256/128x128 tiles, quantizer
block sizes tuned per K. Bias is read in the output dtype across the GEMM family.
Measured on a 5090 at 1344x768, 362 frames (end-to-end comfy.sd.VAE calls):
encode fp16 46.6 -> 32.0 s, encode with the flag 47.2 -> 21.2 s,
decode fp16 34.6 -> 31.1 s, decode with the flag 27.7 -> 23.2 s, decode int8 18.7 -> 12.9 s.
Quality: int8 decode 67.7 dB and fp16-accum encode 68 dB against the exact path
(the VAE's own reconstruction floor is ~38 dB).
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.