mirror of
https://github.com/Comfy-Org/comfy-kitchen.git
synced 2026-11-04 23:37:42 +00:00
[PR #267] Add long key sequence tests for int8 attention #271
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#271
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/267
Author: @potoior
Created: 10/22/2026
Status: 🔄 Open
Base:
main← Head:long-sequence-int8-attention-tests📝 Commits (1)
d57a90cAdd long key sequence tests for int8 attention📊 Changes
1 file changed (+50 additions, -0 deletions)
View changed files
📝
tests/test_int8_attention.py(+50 -0)📄 Description
Follow-up to #178 with verification and regression coverage.
Context
#178 reported an
OverflowErrorfromint8_attentionpast 299,520 key rows (comfy-kitchen 0.2.31). On current master the boundary no longer exists: commitb54f851("Support larger shapes in cuda int8 attention") rewrote the stride checks, split within-head offsets from batch/head bases, and gave the launcher a 64-bitOffsetvariant for large base strides. That commit was never linked to the issue, so the fix went unnoticed there.Verified on main (NVIDIA Thor, sm_110, torch 2.11.0+cu130), comparing against
scaled_dot_product_attentionwith the usual nrmse < 0.03 gate:Offsetvariant)The last row is the interesting one: the 64-bit
Offsethead-base path had no test coverage at all before this change.Tests added (
tests/test_int8_attention.py)test_int8_attention_long_key_sequences— the issue's boundary shapes including the CTA_K-unaligned onetest_int8_attention_long_key_sequences_multi_batch— multi-batch long key sequencestest_int8_attention_wide_head_base_offsets— a shape that forces the launcher's 64-bitOffsetvariantAll three skip without a CUDA int8-attention extension, are marked
slow, and skip when free VRAM is insufficient (the wide-offset case needs ~25 GB).Remaining limits (documented here for the issue): within-head offsets are still int32 by design, so
kv_len * head_dim > 2^31(≈ 16.7 M rows at head_dim 128) still raises a cleanoverflow_error— unreachable on current hardware. The HIP backend passes all strides as int64 and is not affected.Tests run: the 5 new cases pass; 30 existing comparison tests in the same file still pass.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.