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#154
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/115
Author: @0xDELUXA
Created: 8/13/2026
Status: ✅ Merged
Merged: 8/18/2026
Merged by: @comfyanonymous
Base:
main← Head:amd/hip-flash-attention-decode📝 Commits (1)
66d2ac2HIP port of #111: bf16 flash attention decode📊 Changes
7 files changed (+698 additions, -10 deletions)
View changed files
📝
comfy_kitchen/backends/hip/CMakeLists.txt(+1 -0)📝
comfy_kitchen/backends/hip/__init__.py(+45 -0)📝
comfy_kitchen/backends/hip/dlpack_bindings.cpp(+133 -0)📝
comfy_kitchen/backends/hip/launchers.h(+11 -0)➕
comfy_kitchen/backends/hip/ops/flash_decode.hip(+366 -0)📝
comfy_kitchen/flash_attention.py(+34 -10)📝
tests/test_flash_attention.py(+108 -0)📄 Description
Adds
flash_attention_decodeto the HIP backend as an independent performance port of #111. It keeps the same launcher signature, split-then-combine structure, and Python API as CUDA, with a native HIP kernel inops/flash_decode.hip.comfy_kitchen/flash_attention.pynow selects the backend likesage_attention.py. The GQA reshape, split heuristic, and workspace allocation remain shared.Kernel
The kernel targets GQA decode, which is primarily bandwidth- and latency-bound.
Key optimizations:
ds_bpermutereduction with a bit-identical DPP sequence, improving GQA performance by 1.7-2.2x.Performance
Compared with
scaled_dot_product_attention(enable_gqa), BF16, head_dim 128:The main gains come from GQA reuse and avoiding unnecessary cache reads.
Variable-length decode shows larger gains because SDPA must process the full cache capacity:
Correctness
ds_bpermute.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.