mirror of
https://github.com/Comfy-Org/comfy-kitchen.git
synced 2026-11-04 23:37:42 +00:00
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#197
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/175
Author: @0xDELUXA
Created: 9/13/2026
Status: ✅ Merged
Merged: 9/14/2026
Merged by: @comfyanonymous
Base:
main← Head:amd/hip-minimax-h3-vae📝 Commits (1)
4983016HIP port of #167: MiniMax H3 VAE kernels📊 Changes
15 files changed (+1404 additions, -37 deletions)
View changed files
📝
comfy_kitchen/backends/hip/CMakeLists.txt(+7 -0)📝
comfy_kitchen/backends/hip/__init__.py(+250 -4)📝
comfy_kitchen/backends/hip/dlpack_bindings.cpp(+170 -4)📝
comfy_kitchen/backends/hip/epilogue.h(+22 -0)📝
comfy_kitchen/backends/hip/gemm_wmma.h(+40 -11)📝
comfy_kitchen/backends/hip/hadamard.h(+93 -12)📝
comfy_kitchen/backends/hip/mma.h(+17 -0)➕
comfy_kitchen/backends/hip/ops/conv3d_fp16.hip(+86 -0)➕
comfy_kitchen/backends/hip/ops/gemm_fp16.hip(+33 -0)➕
comfy_kitchen/backends/hip/ops/group_norm_pad3d.hip(+263 -0)📝
comfy_kitchen/backends/hip/ops/quantize_int8.hip(+12 -3)📝
tests/test_hip_dispatch.py(+1 -1)📝
tests/test_hip_wmma.py(+408 -0)📝
tests/test_int8_input_act.py(+1 -1)📝
tests/test_int8_residual.py(+1 -1)📄 Description
Ports #167 to the HIP backend. A performance port, HIP already routed every new call through the eager fallbacks added by #167. Numbers are from gfx1200, fp16.
fp16_conv3duses implicit GEMM on the existing WMMA tile core, gathering A rows directly from NDHWC (no im2col); bias + residual are fused in the epilogue. At C=128, 5x130x130: 1.4 ms vs 6.6 ms for torch channels_last_3d and 3.9 ms for torch NCDHW with MIOpen off. At 258x258: 5.3 vs 48.0 and 11.5 ms. Accumulation is fp32.fp16_linearuses the same fp16 WMMA core. It only handles K > 4096, where it beats the eager path; smaller K falls back to torch. At the H3w2shape (1797x2048x8192), it is 1.13x faster thanF.linear, or 1.15x with residual fused.group_norm_silu_pad3dis ported fromgroup_norm_pad3d.cuand registers on RDNA2. Statistics use fp32, with normalized values rounded viaround_to. At C=128, 384x672: 2.9 ms vs 99.2 ms for the eager op.int8_linear(input_act="rms_norm")folds RMS norm into the fused G=256 ConvRot quantizer; spill and G=16/64 paths remain eager. The quantizer is 1.23–1.35x faster, withint8_linearreaching 1.00–1.07x end to end on H3 decoder shapes.The int8 residual epilogue was measured but not kept: 1.05–1.08x at N=6144/16384, but 0.93–0.98x at N=2048 where H3 uses it. No HIP bias-dtype changes are needed.
ComfyUI's H3 VAE currently keeps ROCm encoder paths in NCDHW (Comfy-Org/ComfyUI#16187), so only
fp16_linearand the RMS-norm fold are reached today. The conv3d and group-norm kernels are ready when that path changes.The tile core now supports gathered operands without changing the ISA of existing GEMMs on gfx1030/gfx1100/gfx1200. Compile-verified on gfx1030, gfx1100, gfx1151, and gfx1200 with no new scratch spills; the 17-target build links. Run-verified on gfx1200.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.