Skip to content

qwen27 Metal prompts: drop the GDN tails buffer nothing reads (#2905) - #2915

Merged
ashhart merged 2 commits into
mainfrom
lead/q27-gdn-tails
Nov 13, 2026
Merged

ashhart merged 2 commits into
mainfrom
lead/q27-gdn-tails

Conversation

@ashhart

@ashhart ashhart commented Nov 11, 2026

Copy link
Copy Markdown
Owner

Fixes #2905.

In a prompt pass, tf_delta_gdn_pre stored every row's conv tail into a tails buffer (buffer(15)) that nothing reads. The conv commit takes the window it needs from the history it writes as it goes. This drops the store loop, the binding, the pool allocation and scratch share, and the contract's byte field. Arithmetic, store order, launch geometry and barriers are unchanged.

At 2,048 rows on the 27B: 3 × 10,240 × 2 × 2,048 = 125,829,120 bytes (120 MiB) less scratch.

Tests: the 2,048-row GDN budget test and the contract byte test fail against unchanged main and pass here (eleven remaining allocations pinned). qwen27 host 589/590 (1 skipped). The runtime GDN source compiles offline.

Not yet checked on a device: --compare-chunk and served greedy/seeded replies byte-equal on an M5 and an M3, and a short A/B (expected +0.2-0.5% on cold 8K-32K prompts on an M5).

@ashhart

ashhart commented Nov 12, 2026

Copy link
Copy Markdown
Owner Author

Checked on an M5 Ultra, Qwen3.8-27B MLX 4-bit, served, against main 3885dceb2b, base-new-new-base, exact 2K, 8K and 32K prompts, fresh servers:

  • Tokens: 49,152 measured reply tokens (and 2,048 warm-up) equal to main's, at 1 and 4 streams, greedy and seeded.
  • Time to first token: 0.45% to 1.16% shorter in every one of the 12 cells, e.g. 32K at one stream 19.21 s → 19.12 s, and 32K at four streams 63.95 s → 63.66 s.
  • Decode: level (-0.36% to +0.56%, one cell +2.9%).

Small, but exact and consistent, since the GDN tails buffer nothing read is no longer written. Queued to land.

  • Synthena (Ash's Agent)

@ashhart
ashhart merged commit 47d08dd into main Nov 13, 2026
6 of 14 checks passed
@ashhart
ashhart deleted the lead/q27-gdn-tails branch November 13, 2026 09:41
ashhart added a commit that referenced this pull request Nov 13, 2026
Figures and scope corrected to the PRs (#2948, #2863, #2934, #2933, #2921, #2906, #2878, #2892, #2851, #2728, #3072,
#2915, #2864, #2854 and others), promises of later work removed (#2903, #2875, #1630, #1720), #3074 and #3047/#3046
said as their PRs scope them, the duplicate #2861, #2585, #2321 and #2719 entries and two copies of released 1.2.5
lines removed, #1953's line named for its PR, and a line for #3255. Released sections unchanged.
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.

qwen27 Metal prompts: drop the GDN tails buffer nothing reads

1 participant