mirror of
https://github.com/Comfy-Org/comfy-kitchen.git
synced 2026-11-04 23:37:42 +00:00
[PR #146] Reuse Sage INT8 kernel for Sol exact attention #174
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#174
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/146
Author: @Zironic
Created: 8/31/2026
Status: 🔄 Open
Base:
main← Head:reuse-sage-int8-sol-exact📝 Commits (1)
f94e2b1Use Sage INT8 kernel for Sol exact attention📊 Changes
7 files changed (+274 additions, -50 deletions)
View changed files
📝
comfy_kitchen/backends/cuda/CMakeLists.txt(+1 -0)📝
comfy_kitchen/backends/cuda/sage_attention/qk_int_sv_i8_cuda.cuh(+96 -28)📝
comfy_kitchen/backends/cuda/sage_attention/sage_attn_launcher.cu(+1 -1)➕
comfy_kitchen/backends/cuda/sage_attention/sage_attn_sparse_launcher.cu(+97 -0)📝
comfy_kitchen/backends/cuda/sage_attention/sol_attn.cu(+56 -15)📝
comfy_kitchen/backends/cuda/sage_attention/sol_attn_preprocess.cu(+12 -6)📝
tests/test_sol_attn.py(+11 -0)📄 Description
Summary
tail=FalsecallsResults
RTX 4070 (SM89), BF16
[1, 79567, 56, 128], publicsol_attn:mainAt
[1, 4096, 4, 128]with every block routed, relative L2 error versus FP32 dense attention improves from 1.975% to 1.545% (21.8% lower). Incremental Torch peak allocation was byte-identical in each paired benchmark.Tests
pytest tests/test_sol_attn.py tests/test_int8_attention.py -q: 146 passed, 2 skippeddae00a1Sidenote
Kitchen's pure-INT8 Sage consumer could also be extended to replace the remaining Sol exact path, including resuming from the approximate-tail softmax state. I deliberately left that out of this PR for two reasons:
For that reason, I don't think adding tail support belongs in this optimization PR, even though the underlying online-softmax representation makes it technically feasible.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.