mirror of
https://github.com/Comfy-Org/comfy-kitchen.git
synced 2026-11-04 23:37:42 +00:00
[PR #227] Tune unmasked SM120 D64 attention with smaller query tiles #236
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#236
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/227
Author: @Tokha233
Created: 10/1/2026
Status: 🔄 Open
Base:
main← Head:cuda/sm120-d64-query-tile📝 Commits (5)
f395165Tune unmasked SM120 D64 attention with smaller query tiles07e3a00Record current-main and combined attention test results3c4e42cAdd isolated-process D64 reproduction and decoder evidence5ff2a31Reject benchmark checkout and extension import fallbacksfee9b94Preserve SM120 D64 tuning alongside upstream Ampere tiles📊 Changes
7 files changed (+2310 additions, -1 deletions)
View changed files
📝
comfy_kitchen/backends/cuda/sage_attention/sage_attn_launcher.cu(+28 -1)➕
docs/benchmarks/bench_sm120_d64_query_tile.py(+132 -0)➕
docs/benchmarks/sm120-d64-independent-decode.json(+149 -0)➕
docs/benchmarks/sm120-d64-independent-micro.json(+1326 -0)➕
docs/benchmarks/sm120-d64-query-tile.json(+568 -0)➕
docs/benchmarks/sm120-d64-query-tile.md(+76 -0)➕
tests/test_int8_attention_d64_tile.py(+31 -0)📄 Description
H3 video VAE attention on SM120 uses a 128-query/32-query-warp tile by default. This uses a 64-query/16-query-warp tile for the measured unmasked D64 workload, preserving the existing 128-row quantization scale layout and output bytes. Dispatch is restricted to SM120, 32 query/key heads, batch 1–8, equal sequence lengths 1024–2048, and positive attention scale. Quantizers, the cached-Q pipeline and public APIs are unchanged.
On RTX 5090 D v2, direct
[4,32,1797,64]attention time falls by 4.56% (FP16) / 5.82% (BF16). A separate public prequantized-API benchmark in independent ABBA processes reproduces 4.55% / 4.80%; the smallest batch1/1024 shape is effectively neutral, and the 2049 fallback is unchanged within 0.09%.Full INT8 VAE decode in independent ABBA processes improves from 9.962410 to 9.866619 seconds (0.9615%) on one 243-frame 768×1344latent. Each process loads only one extension, warms once and performs two formal decodes (four formal observations per arm); floating RGB and RGB8 hashes match across all 12 decodes. Two earlier attention-only integration checks measured 0.56% and 0.35%. These are decoder measurements, not end-to-end generation or online throughput claims.
Validation:
The benchmark, all raw timings and scope notes are in
docs/benchmarks/sm120-d64-query-tile.md. Simultaneously loading/swapping multiple experimental_Cmodules caused an unrelated GEMM timing artifact; the independent-process reproduction avoids that harness issue.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.