perf(ds4): optimize q5 fused verifier on AMD
Merged
DA
2mo ago+2377+2377+0123456789012345678901234567890123456789-89-89-01234567890123456789
Summary
- add the AMD q=5 fused DSpark verifier path
- support exact partial-rejection rollback across both compressor boundaries
- keep five-row dense projections on MMVQ and use the qualified gfx1201 x4+1 ROCmFP4 path
- add deterministic context-sweep tooling and unit coverage
- pin the JSON fallback to an immutable source archive so builds avoid the flaky release-asset route
This is the first PR in the heterogeneous DeepSeek 4 performance stack.
Validation
Tested on an R9700 target with Strix Halo expert offload, four routed experts, q=5, and deterministic 128-token completions.
| Context | Previous median | Fused q=5 median |
|---|---|---|
| 2K | 64.212 tok/s | 67.957 tok/s |
| 4K | 62.428 tok/s | 65.927 tok/s |
| 8K | 59.267 tok/s | 62.544 tok/s |
| 16K | 53.750 tok/s | 56.335 tok/s |
| 2K after 16K | 63.804 tok/s | 67.458 tok/s |
All 25 measured responses matched the expected SHA-256. The DeepSeek 4 GPU unit suite passed.
Reproduction
Run harness/qualification/deepseek4/qualify_ds4_q5_amd.sh with TARGET_MODEL, DRAFT_MODEL, and HOTNESS_CSV. The qualifier records configuration, response hashes, timings, ROCm state, and memory use.