mirror of
https://github.com/Comfy-Org/comfy-kitchen.git
synced 2026-11-04 23:37:42 +00:00
[PR #168] sol_attn: optional blk_cnt out-parameter for the routed-block count #191
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#191
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/168
Author: @fblissjr
Created: 9/8/2026
Status: 🔄 Open
Base:
main← Head:sol-blk-cnt-pr📝 Commits (3)
06abeedsol_attn: optional blk_cnt out-parameter for the routed-block count1a3475dsol_attn: the eager blk_cnt check is its own, not the fused backends'956fc58sol_attn_chunked: optional keyword-only blk_cnt out-parameter📊 Changes
6 files changed (+345 additions, -4 deletions)
View changed files
📝
comfy_kitchen/__init__.py(+10 -0)📝
comfy_kitchen/backends/cuda/__init__.py(+30 -2)📝
comfy_kitchen/backends/eager/sol_attn.py(+30 -2)📝
comfy_kitchen/backends/hip/__init__.py(+15 -0)📝
comfy_kitchen/constraints.py(+12 -0)📝
tests/test_sol_attn.py(+248 -0)📄 Description
TLDR changes:
Sol's route stage already works out how many key blocks each query block attends exactly and writes it into the scratch workspace that
sol_attnallocates for the call. that workspace is freed the moment the call returns and the count is gone before the caller sees any of it - this copies it out first to a consumer (if there is one, since it's opt-in and off by default)****Note: It's opt-in and off by default (
blk_cnt=None), pass nothing and nothing changes: no allocation, no copy, no sync, and no kernel reads the destination so you end up with the same output either wayso what?
other stuff:
happy to move it off the main signature if you'd rather not grow the args
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.