perf(ds4): batch exact prefill through width-4 vector kernels
Summary
- batch exact DeepSeek4 prefill in compressor-safe groups of at most four tokens
- use the existing quantized matrix-vector path only for those exact width-2-to-4 feed-forward graphs
- keep speculative verification, approximate prefill, and unsupported hybrid paths unchanged
- add no option or environment flag
Result
Ryzen AI Max+ 395 / gfx1151, ROCm 7.2.2, exact prefill, no drafter or caches.
Fresh current-main smoke (f5475131, one warmup then three interleaved runs):
| Prompt | Main median | PR median | Lower time |
|---|---|---|---|
| 64 tokens | 3341.6 ms | 2776.9 ms | 16.90% |
| 128 tokens | 6710.7 ms | 5602.6 ms | 16.51% |
The frozen five-run qualification measured 17.72% and 16.62% lower total prefill time respectively. The expert feed-forward phase was about 37% lower. Its 95% gain intervals were [17.13%, 18.33%] and [16.21%, 17.37%].
Correctness
The frozen Q=1 versus Q=4 qualification was byte-identical across ordered route IDs, normalized route weights, attention and feed-forward recurrent state, every-position F32 logits, and committed tokens.
After rebasing on current main, the server built with -j4 and these focused tests passed 4/4:
test_deepseek4_hc_cudatest_rocmfpx_mmqdeepseek4_mmid_grouped_cudadeepseek4_unit
All current-main benchmark responses emitted the same first token.
Scope
Three files, 21 insertions, 6 deletions. This PR claims the exact all-hot M64/M128 prefill result only; long-context and speculative decode are separate qualifications.