[GH-ISSUE #4938] [Engine] 0.2.9 iq_kernels 160-dot fastpath inflates VGPR for all non-trellis types (-12% batch decode) #2273

Open
opened 2026-11-04 01:58:05 +07:00 by bsakaguchi · 3 comments
Owner

Originally created by @hyz1848 on GitHub (Nov 1, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/4938

Hardware:

  • GPU: 2x AMD Radeon RX 7900 XTX (gfx1100, 24 GB VRAM each)
  • RAM: 89 GiB
  • OS: Ubuntu 26.04.1 LTS, kernel 7.0.0-42-generic
  • Strata: 0.1.55 (0.2.9 source), model pack: Qwen3.8-Flash-Next IQ3_S, --batch 4 --layer-split, spec + MTP
  • ROCm: rocm-sdk 10.3 nightly wheels (pip), gfx1100 device package

Environment: Strata 0.1.55 (0.2.9 source), 2x RX 7900 XTX (gfx1100), ROCm 10.3 nightly SDK, Qwen3.8-Flash-Next IQ3_S pack, --batch 4, --layer-split, spec+MTP.

What happened: row_dot_multi() (src/kernels/cuda/iq_kernels.cu) gained a
prefetch fastpath guarded by a RUNTIME check if (nb * F::ipb == 160).
The check never fires for the IQ types (at n_embd 2560 their row dot count is
80/40, never 160), but the branch is still instantiated for every Split type.
Registers are allocated per worst-path, so the dead path raises the kernel's
VGPR requirement for ALL instantiations.

Static evidence (gfx1100 code object, 485 kernels):
0.2.8 binary: VGPR avg 76.3, spill avg 0.10
0.2.9 binary: VGPR avg 114.9, spill avg 0.60
mmvq_multi family total instrs: 100,615 -> 353,169 (3.5x)
Same source compiled with both clang snapshots behaves the same: it is the
source shape, not the compiler.

Measured effect: 4-concurrency growing-conversation decode, live aggregate
throughput dropped 160 -> 140 tok/s between 0.1.54 and 0.1.55 on IQ3_S.
No functional diff (correctness unaffected).

Suggested fix (verified on this box): gate the fastpath with if constexpr so
it is only compiled for the trellis types it was written for:
if constexpr (kTqType || TY == 147 || TY == 148 || TY == 149) {
if (nb * F::ipb == 160) { ... }
}
Rebuild result: VGPR avg 115 -> 89, spill 0.6 -> 0.10, live median 140 ->
149.5 (peak 162.4), batch rows/s 36.9 -> 93.9 on the same workload.
Trellis types keep the fastpath untouched.

Originally created by @hyz1848 on GitHub (Nov 1, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/4938 Hardware: - GPU: 2x AMD Radeon RX 7900 XTX (gfx1100, 24 GB VRAM each) - RAM: 89 GiB - OS: Ubuntu 26.04.1 LTS, kernel 7.0.0-42-generic - Strata: 0.1.55 (0.2.9 source), model pack: Qwen3.8-Flash-Next IQ3_S, --batch 4 --layer-split, spec + MTP - ROCm: rocm-sdk 10.3 nightly wheels (pip), gfx1100 device package Environment: Strata 0.1.55 (0.2.9 source), 2x RX 7900 XTX (gfx1100), ROCm 10.3 nightly SDK, Qwen3.8-Flash-Next IQ3_S pack, --batch 4, --layer-split, spec+MTP. What happened: row_dot_multi() (src/kernels/cuda/iq_kernels.cu) gained a prefetch fastpath guarded by a RUNTIME check `if (nb * F::ipb == 160)`. The check never fires for the IQ types (at n_embd 2560 their row dot count is 80/40, never 160), but the branch is still instantiated for every Split type. Registers are allocated per worst-path, so the dead path raises the kernel's VGPR requirement for ALL instantiations. Static evidence (gfx1100 code object, 485 kernels): 0.2.8 binary: VGPR avg 76.3, spill avg 0.10 0.2.9 binary: VGPR avg 114.9, spill avg 0.60 mmvq_multi family total instrs: 100,615 -> 353,169 (3.5x) Same source compiled with both clang snapshots behaves the same: it is the source shape, not the compiler. Measured effect: 4-concurrency growing-conversation decode, live aggregate throughput dropped 160 -> 140 tok/s between 0.1.54 and 0.1.55 on IQ3_S. No functional diff (correctness unaffected). Suggested fix (verified on this box): gate the fastpath with if constexpr so it is only compiled for the trellis types it was written for: if constexpr (kTqType<TY> || TY == 147 || TY == 148 || TY == 149) { if (nb * F::ipb == 160) { ... } } Rebuild result: VGPR avg 115 -> 89, spill 0.6 -> 0.10, live median 140 -> 149.5 (peak 162.4), batch rows/s 36.9 -> 93.9 on the same workload. Trellis types keep the fastpath untouched.
Author
Owner

@github-actions[bot] commented on GitHub (Nov 1, 2026):

Thanks for the issue. To keep the tracker readable, every item needs an area prefix in the title and the parts of the issue form filled in. This one is missing:

  • Start the title with its area: [Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other], then a short description. Example: "[Engine] decode stops after 2 minutes".
  • Add your graphics card with its VRAM, your RAM and your operating system.

Edit the issue (title and description) and this note goes away on its own. If it is still missing parts in 5 days it will be closed, which is not a rejection: fix it and comment /reopen.

Details: CONTRIBUTING.md

<!-- gh-comment-id:6560476104 --> @github-actions[bot] commented on GitHub (Nov 1, 2026): Thanks for the issue. To keep the tracker readable, every item needs an area prefix in the title and the parts of the issue form filled in. This one is missing: - [ ] Start the title with its area: [Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other], then a short description. Example: "[Engine] decode stops after 2 minutes". - [ ] Add your graphics card with its VRAM, your RAM and your operating system. Edit the issue (title and description) and this note goes away on its own. If it is still missing parts in 5 days it will be closed, which is not a rejection: fix it and comment `/reopen`. Details: [CONTRIBUTING.md](https://github.com/Niko1221/Strata/blob/main/CONTRIBUTING.md)
Author
Owner

@github-actions[bot] commented on GitHub (Nov 1, 2026):

Thanks, this follows the format now.

<!-- gh-comment-id:6560499816 --> @github-actions[bot] commented on GitHub (Nov 1, 2026): Thanks, this follows the format now.
Author
Owner

@github-actions[bot] commented on GitHub (Nov 1, 2026):

Thanks, this follows the format now.

<!-- gh-comment-id:6560501600 --> @github-actions[bot] commented on GitHub (Nov 1, 2026): Thanks, this follows the format now.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#2273
No description provided.