Skip to content

DFlash2: selector scores the declared rank-256 / top-16, Strix probe declarations, parity fixture - #46

Closed
AzeezIsh wants to merge 3 commits into
mainfrom
fix/dflash2-selector-full-rank-topk
Closed

AzeezIsh wants to merge 3 commits into
mainfrom
fix/dflash2-selector-full-rank-topk

Conversation

@AzeezIsh

@AzeezIsh AzeezIsh commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The single DFlash2 PR — everything DFlash that is pending, consolidated here (#40 folded in and closed; #21 was superseded by #33).

1. Selector fidelity (6c53de756). The on-device candidate selector evaluated a cheaper selector than the drafter checkpoint declares: top-4 where the loader reads selector_top_k = 16, and the bilinear score over only the first 64 dimensions (s_context[64], tid < 64) where it reads selector_rank = 256. The host fallback already honoured both; only the fast path truncated. Now: runtime top_k (cap DF2_SEL_MAX_TOP_K = 16), context over the full rank (cap DF2_SEL_MAX_RANK = 256), one warp per candidate across the whole rank, candidates ordered (value desc, index asc) — the engine's first-index-wins argmax rule — on both GPU and host. Dflash2CandidateSelector::new fails fast beyond the caps. gb10 and strix-hip copies byte-identical.

2. Parity fixture fix (45e3c494d). The GPU parity test's f32 ramp collapsed to 1242 distinct bf16 values for 4096 logits; it now steps bf16 bit patterns (distinct up to ~49k, intentional ties beyond).

3. Strix [expected_absent] for the two Phase-G fp8 probes (808dc3030, was #40). fp8_gemm_t_row_scaled / _m16 are optional; the BF16 fallback path is what runs. Audit on gfx1151 now reports 0 unresolved (was 2).

Measured (all on incoai/Qwen3.8-27B-DFlash2 over nvidia/Qwen3.8-27B-NVFP4, γ=8 Option-B)

where old selector new selector
GB10, same 4 MinHeap requests, same binary otherwise (job 182, n=4 each) mean_na 4.91, 34.1 tok/s mean_na 5.99, 39.4 tok/s
GB10 kernel audit (--check-kernels, 27B) — exit 0
Strix gfx1151 audit 2 unresolved 0 unresolved
Strix ST-995 (golden draw, n=995, thinking off, --disable-tool-grammar) 85.23 / 78.61 @ da943853 85.43 / 79.05 @ integ head 3b4f7c2e0, mean_na 5.72 over 1000 requests, 0 faults

Serve log confirms DFlash2 candidate selector loaded: rank=256, top_k=16 on both targets.

Test plan

  • fmt, typos, diff --check, check_kernel_shadows.py, clippy, cargo test -p atlas-kernels (arity pin), dflash2_selector_bounds (GB10)
  • GB10 build + serve; acceptance A/B above
  • Strix HIP build + serve + ST-995 above
  • GB10 dflash2_selector_parity -- --ignored at 45e3c494d (queued as job 190; the first run failed on the fixture, not the kernel)
  • Windows/ROCm ST-995 at the integration head (queued behind another run on that box)

Generated with Devin

AzeezIsh and others added 3 commits September 20, 2026 04:24
…nt declares

The on-device DFlash2 candidate selector reduced each row's unary logits
to a top-4 list and evaluated the bilinear score over only the first 64
selector dimensions (`s_context[64]`, `tid < 64`, two-warp partial sum),
while the loader reads `selector_rank` (256) and `selector_top_k` (16)
from the drafter config and the host fallback already honours both. The
fast path therefore evaluated a cheaper selector than the trained one.

The kernel now takes `top_k`, keeps per-thread/warp/block top-k lists up
to DF2_SEL_MAX_TOP_K=16, builds the context vector over the full rank up to
DF2_SEL_MAX_RANK=256, scores one candidate per warp across the whole rank,
and orders candidates (value desc, index asc) so tie-breaks match the
engine's first-index-wins argmax rule. `Dflash2CandidateSelector::new`
fails fast when a checkpoint exceeds the caps instead of degrading; the
host fallback uses the same order. Pinned: kernel arity (10), the Rust
mirrors of the kernel caps, gb10/strix-hip copies byte-identical, and an
ignored GPU parity test against an f32 host reference.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…ip qwen3.8-27b

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@AzeezIsh AzeezIsh changed the title kernels: DFlash2 selector scores the full rank and top-k the checkpoint declares DFlash2: selector scores the declared rank-256 / top-16, Strix probe declarations, parity fixture Sep 21, 2026
@AzeezIsh

Copy link
Copy Markdown
Contributor Author

Closing as superseded: all three commits are already on main, patch-equivalent (git cherry origin/main fix/dflash2-selector-full-rank-topk → all -), landed via #62 (d199348 selector full-rank/top-16, 58f55b9 parity fixture, 48cc72f Phase-G probe declarations) and #64. Nothing left to merge.

@AzeezIsh AzeezIsh closed this Sep 25, 2026
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