mirror of
https://github.com/Comfy-Org/comfy-kitchen.git
synced 2026-11-04 23:37:42 +00:00
[PR #116] [MERGED] Add fused HIP ConvRot INT8 activation quant with global spill for G=256 (RDNA3/3.5/4) #158
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#158
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/116
Author: @tvukovic-amd
Created: 8/13/2026
Status: ✅ Merged
Merged: 8/18/2026
Merged by: @comfyanonymous
Base:
main← Head:convrot-int8-quant-fused📝 Commits (10+)
acbcad3HIP: fused and global spill ConvRot INT8 quant for G=2569640968HIP ConvRot INT8: pick fused block size by LDS fit before spill7c490ecMerge branch 'Comfy-Org:main' into convrot-int8-quant-fused4e48439Fix HIP ConvRot spill workspace and LDS dispatch per review.8fc007cValidate spill dtype and allocate spill workspace only when needed.60828a7Pin convrot perf microbench to the tensor device for route probe.8ca5b7bFix fused convrot None spill args and dtype rounding contract.8a6748aFix ruff import formatting in convrot perf teste2a4297Align ConvRot LDS dispatch with RowT element size, pass dtype into spill probe, and tune K=10240 block size.d24e341Address PR review: block-aware legacy LDS sizing, fresh per-device LDS query, conservative needs_spill probe.📊 Changes
7 files changed (+1036 additions, -72 deletions)
View changed files
📝
comfy_kitchen/backends/hip/__init__.py(+37 -18)📝
comfy_kitchen/backends/hip/dlpack_bindings.cpp(+25 -4)📝
comfy_kitchen/backends/hip/hadamard.h(+622 -34)📝
comfy_kitchen/backends/hip/ops/quantize_int8.hip(+65 -5)📝
tests/conftest.py(+1 -0)➕
tests/test_hip_convrot_perf.py(+220 -0)📝
tests/test_hip_wmma.py(+66 -11)📄 Description
Summary
Adds a fused HIP GPU path for INT8 ConvRot G=256 activation quantization on WMMA-capable RDNA3 / RDNA3.5 / RDNA4 GPUs: a fused single-kernel path when the rotated row fits in LDS, and a global spill path when it does not.
Replaces slow legacy HIP and eager Python Hadamard + quant paths for large-K layers (e.g. Z-Image Turbo INT8 at K=3840/10240).
Target workload:
int8_linear(..., convrot=True, convrot_groupsize=256)Changes
hadamard.h: fusedconvrot_quant_fused_kernel(FHT stage64, G=256); global spill kernels; legacy G=16/64/int4 unchanged;convrot_pick_fused_block_threads()for LDS-aware dispatch.quantize_int8.hip: global spill workspace (hipMalloc) for large K when fused does not fit.hip/__init__.py: route INT8 ConvRot G=256 through fused/spill via_rotate_quant_int8;int8_global_spillin_convrot_supportedso Python no longer rejects large K.performancepytest marker.Running tests
Correctness — fused LDS (K=3840) and large K (K=10240) vs eager:
Performance — Z-Image Turbo INT8 shapes (M=4128, K=3840/10240, G=256); prints timing tables with
-s:Benchmarks (Windows)
Setup
mainbuilt checkouts, ComfyUI Z-Image Turbo INT8, 8 steps @ 1024², n=1.gfx1201 (Navi 48 XTX, RDNA4)
Z-Image Turbo INT8
Microbench
gfx1100 (7900 XTX, RDNA3)
Z-Image Turbo INT8
Microbench
gfx1151 (Strix Halo, RDNA3.5)
Z-Image Turbo INT8
Microbench
gfx1150 (Strix Point APU, RDNA3.5)
Z-Image Turbo INT8
Microbench
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.