Skip to content

perf(ds4): optimize q5 fused verifier on AMD - #569

Draft
davide221 wants to merge 4 commits into
mainfrom
codex/ds4-q5-verifier
Draft

perf(ds4): optimize q5 fused verifier on AMD#569
davide221 wants to merge 4 commits into
mainfrom
codex/ds4-q5-verifier

Conversation

@davide221

@davide221 davide221 commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add an opt-in q=5 fused verifier for the AMD heterogeneous DS4 path
  • handle two ratio-4 compressor boundaries and exact partial-rejection rollback
  • keep five-row dense projections on MMVQ with qualified cache defaults
  • extend the fused ROCmFP4 x4 dot path to q=5 as x4+1 on gfx1201
  • add a self-contained exact-context qualification wrapper and clients

PR #565 is now merged; this branch is rebased directly on main and remains a draft while gated rejected candidates are cleaned up.

AMD validation

Hardware profile: R9700 target plus Strix Halo expert device, in-process expert parallelism, four active experts, 36 hot experts per layer, one request at a time, 128 output tokens, temperature 0.

All 25 requests in the 2K -> 4K -> 8K -> 16K -> post-16K 2K sequence produced the exact expected SHA-256:

0f785a7ffa406498aafb14553966eaed0f52220fed0f7cc016b66921d104d194

Context prior AMD q=5 median x4+1 hot-36 median change
2K 64.212 tok/s 67.957 tok/s +5.8%
4K 62.428 tok/s 65.927 tok/s +5.6%
8K 59.267 tok/s 62.544 tok/s +5.5%
16K 53.750 tok/s 56.335 tok/s +4.8%
post-16K 2K 63.804 tok/s 67.458 tok/s +5.7%

The two-second monitor observed a 30.561 GiB R9700 peak during the full hot-36 sweep. This expert budget is a hardware profile, not a portable default for smaller cards.

The final test_deepseek4_unit GPU suite completed with OK. The sweep left MMVQ width, verifier slots, and x4+1 on auto; logs confirmed width 5, nine slots, and the gfx1201 x4+1 default.

Reproduction

Run server/scripts/qualify_ds4_q5_amd.sh with TARGET_MODEL, DRAFT_MODEL, and HOTNESS_CSV. It records the manifest, exact response hashes, timings, ROCm state, and VRAM trace.

Measured A/B decisions

  • retained x4+1: 67.420 tok/s hot-32 median with exact hashes
  • rejected full five-column reuse: 67.217 tok/s median
  • rejected forced graph replay: +0.05%, within noise
  • retained hot-36 hardware profile: 67.902 tok/s isolated 2K median before the full sweep

Before marking ready

  • remove or split any remaining gated kernel candidate that did not improve the full-model benchmark
  • complete final review of the rebased diff against main

@davide221 davide221 changed the title perf(ds4): prototype q5 fused verifier on AMD perf(ds4): optimize q5 fused verifier on AMD Aug 1, 2026
@davide221
davide221 force-pushed the codex/ds4-16k-amd-opt branch from be20268 to 0208630 Compare August 3, 2026 21:26
@davide221
davide221 force-pushed the codex/ds4-q5-verifier branch from 5417326 to e24ad65 Compare August 4, 2026 10:17
@davide221
davide221 changed the base branch from codex/ds4-16k-amd-opt to main August 4, 2026 10:17
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.

1 participant