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#175
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/143
Author: @0xDELUXA
Created: 8/30/2026
Status: ✅ Merged
Merged: 9/1/2026
Merged by: @comfyanonymous
Base:
main← Head:amd/hip-sol-attn📝 Commits (2)
f622accRestore the registry's backend selection between testsd9630b8HIP port of #117: int8 Sol-Attn sparse attention📊 Changes
18 files changed (+2432 additions, -114 deletions)
View changed files
📝
README.md(+1 -1)📝
comfy_kitchen/backends/hip/CMakeLists.txt(+6 -0)📝
comfy_kitchen/backends/hip/__init__.py(+381 -0)📝
comfy_kitchen/backends/hip/dlpack_bindings.cpp(+258 -0)📝
comfy_kitchen/backends/hip/launchers.h(+22 -0)📝
comfy_kitchen/backends/hip/sage_attention/int8_attn.hip(+0 -58)📝
comfy_kitchen/backends/hip/sage_attention/sage_common.h(+111 -0)➕
comfy_kitchen/backends/hip/sage_attention/sol_attn.hip(+234 -0)➕
comfy_kitchen/backends/hip/sage_attention/sol_attn_exact.hip(+203 -0)➕
comfy_kitchen/backends/hip/sage_attention/sol_attn_preprocess.hip(+268 -0)➕
comfy_kitchen/backends/hip/sage_attention/sol_attn_producer.hip(+131 -0)➕
comfy_kitchen/backends/hip/sage_attention/sol_attn_route.hip(+259 -0)➕
comfy_kitchen/backends/hip/sage_attention/sol_attn_vtranspose.hip(+87 -0)➕
comfy_kitchen/backends/hip/sage_attention/sol_common.h(+243 -0)📝
tests/conftest.py(+23 -0)📝
tests/test_constraints.py(+1 -1)📝
tests/test_sol_attn.py(+189 -51)📝
tests/test_tensor.py(+15 -3)📄 Description
Brings the HIP backend back to parity with #117.
A capability port:
sol_attnandsol_attn_chunkeddid not exist on HIP, so ROCm fell through to the O(T^2) eager reference, which refuses video length outright. Both entry points, the workspace plan, the chunked QKV producer,key_bias,block_len,tail=Falseand the VSA coarse gate are all covered, andtests/test_sol_attn.pynow runs against whichever fused backend is built.The kernels are a reimplementation. The CUDA carriers are stored under
sol::perm_dandsol::perm_key, which exist only to turn anm16n8k32lane's two operand words into one 8-byte load; RDNA's16x16x16WMMA already hands a lane a contiguous K slice, so both permutations are dropped and the scores are evaluated transposed the wayint8_attn.hipdoes, which puts one query per lane and makesP^Tthe operand of the second MMA directly. Everything goes through the existingMmaInt8/MmaBf16policies, so gfx11 and gfx12 both fall out of the port.On a gfx1200 card,
(1, T, H, 128)bf16 attau=1.4, against bf16 SDPA with the AOTriton flash backend enabled: 11.3x at T=32768 (113.3 ms to 10.0 ms), and 2.3x to 7.1x against this backend's own fused INT8 attention. Cosine against the eager Sol-Attn reference is 0.9999. Compile-verified on all 17 targets inarchitectures.jsonwith no scratch spill; run-verified on RDNA4 only. RDNA2 is unsupported because it has no matrix cores.One fix rides along in its own commit because it is what hid the rest.
test_backend_prioritychanges registry priority without restoring it, leaving HIP registered but unreachable and causing two INT8 tests to run against eager incorrectly.tests/conftest.pynow restores priority and the disabled set per test. Those INT8 tests now compare against the exact dequantized product instead of eager, since the fused kernels accumulate in INT32. ROCm failures drop from 113 to 101 - the same failures already present onmain.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.