Skip to content

Add explicit SheetSage2 encoder attention tiling - #999

Merged
0xShug0 merged 1 commit into
mainfrom
fix/sheetsage2-vulkan-attention
Oct 20, 2026
Merged

0xShug0 merged 1 commit into
mainfrom
fix/sheetsage2-vulkan-attention

Conversation

@0xShug0

@0xShug0 0xShug0 commented Oct 20, 2026

Copy link
Copy Markdown
Owner

Summary

Fixes #996 by adding explicit, backend-independent query tiling to SheetSage2 encoder attention.

--session-option sheetsage2.attention_tile_rows=1024
  • Omitted or 0 preserves the existing full-attention path.
  • Positive values set the maximum query rows per tile on any backend; negative values are rejected.
  • Every tile retains all keys and values, FP32 noncausal attention, RoPE, and the full padded window.
  • For the published model's 7,500 positions and 16 heads, 1024 rows reduce each score tensor from 3,600,000,000 bytes to at most 491,520,000 bytes. This is not a peak-VRAM claim.

Uses the existing framework Slice, SDPA, and Concat modules in the existing session-owned cached graph. No shared framework/ggml changes or decoder math changes. Adds the normalized session option to the model spec, documents usage, and extends the existing parity probe with encoder coverage.

Tiling is opt-in and can trade throughput for smaller intermediates. No automatic backend selection or CPU fallback is introduced.

Validation

Built using the existing build/debug cache (Debug, -O3 -g, CUDA/Vulkan enabled, parallel build 8) in conda qwen3-tts. Model/probe runs were sequential, with --log and successful session.wall_ms output.

  • Reproduced the original 3.6 GB allocation failure using GGML_VK_FORCE_MAX_BUFFER_SIZE=2147483648.
  • Default Vulkan encoder: all 7,680,000 FP32 output values byte-identical to main for a deterministic 30,000-frame mel input.
  • Explicit 1024-row CUDA encoder: all 7,680,000 output values byte-identical to the untiled CUDA baseline for the same input.
  • Actual Vulkan CLI with sheetsage2.attention_tile_rows=1024 under the 2 GiB cap: completes on a non-silent 30-second music sample, with text, ABC score, and event JSON byte-identical to the unrestricted baseline. Uses default complete decoding, without a token-limit override.
  • git diff --check passes. Rebased onto main 1dfbd503; range-diff confirms the patch is unchanged.

Hardware was a Linux RTX 5090 with a controlled Vulkan buffer cap, not the reporter's Windows Radeon 880M. The reporter's exact native limit remains unverified. CPU and Metal execution were not tested.

Local binaries, hashes, patches, logs and comparison results are retained under logs/issue-996/explicit-control/, with original baseline provenance under logs/issue-996/fix-aef84a63/ (ignored local artifacts, not part of this PR).

@0xShug0
0xShug0 merged commit 99cd28e into main Oct 20, 2026
7 checks passed
@0xShug0
0xShug0 deleted the fix/sheetsage2-vulkan-attention branch October 20, 2026 03:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Vulkan: SheetSage2 fails with "encoder backend buffer allocation failed" (single ~4.1 GB buffer exceeds device buffer limit) on AMD Radeon 880M

1 participant