Repository navigation
DFlash2: selector scores the declared rank-256 / top-16, Strix probe declarations, parity fixture - #46
Closed
AzeezIsh wants to merge 3 commits into
Closed
DFlash2: selector scores the declared rank-256 / top-16, Strix probe declarations, parity fixture#46AzeezIsh wants to merge 3 commits into
AzeezIsh wants to merge 3 commits into
Conversation
…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>
This was referenced Sep 21, 2026
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 readsselector_top_k = 16, and the bilinear score over only the first 64 dimensions (s_context[64],tid < 64) where it readsselector_rank = 256. The host fallback already honoured both; only the fast path truncated. Now: runtimetop_k(capDF2_SEL_MAX_TOP_K = 16), context over the full rank (capDF2_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::newfails 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/_m16are optional; the BF16 fallback path is what runs. Audit on gfx1151 now reports 0 unresolved (was 2).Measured (all on
incoai/Qwen3.8-27B-DFlash2overnvidia/Qwen3.8-27B-NVFP4, γ=8 Option-B)mean_na 4.91, 34.1 tok/smean_na 5.99, 39.4 tok/s--check-kernels, 27B)--disable-tool-grammar)da9438533b4f7c2e0,mean_na 5.72over 1000 requests, 0 faultsServe log confirms
DFlash2 candidate selector loaded: rank=256, top_k=16on both targets.Test plan
check_kernel_shadows.py, clippy,cargo test -p atlas-kernels(arity pin),dflash2_selector_bounds(GB10)dflash2_selector_parity -- --ignoredat45e3c494d(queued as job 190; the first run failed on the fixture, not the kernel)Generated with Devin