mirror of
https://github.com/Comfy-Org/comfy-kitchen.git
synced 2026-11-04 23:37:42 +00:00
[PR #271] sol_attn: caller-supplied block lists (block-sparse attention) #275
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#275
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/271
Author: @kijai
Created: 10/22/2026
Status: 🔄 Open
Base:
main← Head:flashvsr_block_sparse📝 Commits (1)
16e4b27sol_attn: caller-supplied block lists📊 Changes
8 files changed (+163 additions, -42 deletions)
View changed files
📝
comfy_kitchen/__init__.py(+14 -3)📝
comfy_kitchen/backends/cuda/__init__.py(+9 -2)📝
comfy_kitchen/backends/cuda/dlpack_bindings.cpp(+31 -11)📝
comfy_kitchen/backends/cuda/sage_attention/sol_attn.cu(+36 -20)📝
comfy_kitchen/backends/eager/sol_attn.py(+18 -6)📝
comfy_kitchen/backends/hip/__init__.py(+4 -0)📝
comfy_kitchen/constraints.py(+11 -0)📝
tests/test_sol_attn.py(+40 -0)📄 Description
Adds optional
kv_indices/kv_countstosol_attn. When given, they replace routing. Each 64-token query block attends exactly its listed 64-token key blocks through the existing exact stage, starting from an empty softmax state. Sinks, the forced diagonal, the pooled tail and token routing don't apply, and a query block with no ids returns zeros.This is used with FlashVSR+ (core support to follow) was trained with its own block mask: a local window intersected with a top-k over pooled window scores, chunk-causal. It needs exact attention over exactly those blocks. Without this, the only option is masked SDPA with a per-token mask.
Results: FlashVSR+ Turbo on an RTX 4090, outputs within bf16 noise of the upstream reference:
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.