mirror of
https://github.com/Comfy-Org/comfy-kitchen.git
synced 2026-11-04 23:37:42 +00:00
[PR #111] [MERGED] add minimal bf16 flash attention for seqlen capability #151
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#151
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/111
Author: @rattus128
Created: 8/12/2026
Status: ✅ Merged
Merged: 8/12/2026
Merged by: @comfyanonymous
Base:
main← Head:dev/rattus/flash📝 Commits (5)
2676f97add minimal bf16 flash attention for seqlen capability5b562b5fix build issue40cd2bffix build issue0867038Fix ruff.843eda3Fix ruff.📊 Changes
12 files changed (+343 additions, -7 deletions)
View changed files
📝
.github/workflows/build-wheels.yml(+7 -7)📝
.gitmodules(+3 -0)📝
NOTICE(+9 -0)📝
comfy_kitchen/__init__.py(+2 -0)📝
comfy_kitchen/backends/cuda/CMakeLists.txt(+4 -0)📝
comfy_kitchen/backends/cuda/dlpack_bindings.cpp(+58 -0)➕
comfy_kitchen/backends/cuda/flash_compat/ATen/cuda/CUDAGeneratorImpl.h(+12 -0)➕
comfy_kitchen/backends/cuda/flash_compat/ATen/cuda/detail/UnpackRaw.cuh(+11 -0)➕
comfy_kitchen/backends/cuda/ops/flash_decode.cu(+107 -0)➕
comfy_kitchen/flash_attention.py(+75 -0)➕
tests/test_flash_attention.py(+54 -0)➕
third_party/flash-attention(+1 -0)📄 Description
AR attention needs a performant seqlen capable attention kernel. Pytorch hides this option in its internals. Just use flash attention with the seqlen stuff on the API.
The seqlen variable allows cuda-graphing through the attention kernel as the CPU does not need to manage the iteration variable for sequence length increment as the AR attention iterates.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.