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#260
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/252
Author: @0xDELUXA
Created: 10/16/2026
Status: ✅ Merged
Merged: 10/16/2026
Merged by: @comfyanonymous
Base:
main← Head:amd/hip-situ-input-act📝 Commits (2)
a880913HIP port of #251: SiTU input activation in the INT8 ConvRot quantizerb2e5299Fix HIP rope split-half rounding, fp8 NaN decode and a width-check test📊 Changes
10 files changed (+139 additions, -65 deletions)
View changed files
📝
comfy_kitchen/backends/hip/__init__.py(+7 -4)📝
comfy_kitchen/backends/hip/dlpack_bindings.cpp(+3 -3)📝
comfy_kitchen/backends/hip/fp8_utils.h(+8 -4)📝
comfy_kitchen/backends/hip/hadamard.h(+27 -11)📝
comfy_kitchen/backends/hip/ops/apply_rope.hip(+4 -4)📝
comfy_kitchen/backends/hip/ops/quantize_int8.hip(+8 -2)📝
comfy_kitchen/backends/hip/ops/rms_rope.hip(+4 -4)📝
comfy_kitchen/backends/hip/rope_math.h(+12 -10)📝
tests/test_hip_wmma.py(+65 -22)📝
tests/test_int8_input_act.py(+1 -1)📄 Description
Performance port of #251.
situis now folded into the ConvRot quantizer next toswiglu, in the G=16/64/256 kernels and the global spill path, so MOSS-Image'sffn_down(as called by ComfyUI #17099) no longer materializes the activation. HIP has no fused M=1 GEMV, so the quantizer is the only place it lands. The tanh caps use the sameexpm1fform as CUDA'sstable_tanh, since this build is-ffast-mathtoo. Non-convrot routes still apply the activation eagerly, as on CUDA.Measured on gfx1200, bf16, MOSS-Image
ffn_down([M, 16384]in, K=8192, N=3072, ConvRot G=256), the current ComfyUI expression plusint8_linearagainst the fused call: M=4096 goes 6.08 -> 3.17 ms and M=1024 1.47 -> 0.90 ms. The quantizer alone at M=4096 goes 5.01 -> 1.04 ms.Also fixes the three HIP test failures on
main. Split-halfapply_ropeandrms_ropelost bit parity with eager aftere4106ddmovedapply_rope_split_half1toaddcmul_; the kernels now round the same product eager does.dequantize_per_tensor_fp8decoded the e4m3 NaN code as 480 with a newer clang, which drops the constant-NaN branch under-ffinite-math-only; the bits now pass through an empty asm.test_swiglu_row_is_half_the_inputnow accepts theValueErrorHIP raises for the width mismatch.The swiglu tests in
test_hip_wmma.pynow cover both gated pairs across G=16/64/256, global spill, no convrot and M=1, in fp32, fp16 and bf16, with near-zero rows. Compile-verified for gfx1030, gfx1100 and gfx1200 with no scratch in the changed files. Run-verified on gfx1200 only.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.