Commit dc010d6
committed
feat(paged): gate GDN prefill geometry by scan length (patch 0046)
Patch 0022 retuned the gated-DeltaNet (GDN) sequential-recurrence dispatch
(case 128) to a (NUM_WARPS=16, COLS_PER_WARP=8) column-fold tile. That is a
DECODE win (short scans: small n_tokens, large n_seqs) but an UNCONDITIONAL
dense-prefill regression vs stock: on a long sequential scan the launch grid.z
collapses from S_v/4=32 to S_v/(16*8)=1, so the SMs starve. Profiling the
dense-prefill path attributed the whole regression (~-6%) to gated_delta_net
(+54% GPU time) at the (16,8) geometry.
Gate the geometry by per-call scan length instead of applying (16,8)
unconditionally. Long scans (prefill, n_tokens >= GDN_PREFILL_NTOK, default 256)
take stock's high-grid.z (4,1) geometry; short scans (decode) keep the (16,8)
retune. This recovers dense prefill +7.2% back to stock parity while preserving
the (16,8) decode win.
Bit-exact: patch 0022 proved every selectable {NUM_WARPS, COLS_PER_WARP} variant
is byte-identical (the sweep cannot change the md5), so this scan-length gate is
greedy-md5 bit-exact. GDN_PREFILL_NTOK tunes the crossover; the explicit
GDN_NW / GDN_CPW one-build %peak sweep still wins (the gate yields when either is
set), so the A/B harness is unchanged.
Root cause: patch 0022 applied the (16,8) tile unconditionally. This patch
sequences after 0022/0044 (it edits the same gated_delta_net.cu case-128
dispatch) and adds only the scan-length gate.
Assisted-by: Claude:opus-4.8 [Claude Code]
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>1 parent 263d181 commit dc010d6
1 file changed
Lines changed: 17 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
550 | 550 | | |
551 | 551 | | |
552 | 552 | | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
553 | 570 | | |
554 | 571 | | |
555 | 572 | | |
| |||
0 commit comments