Repository navigation
DFlash2 Strix-Windows carryovers: selector full-rank, watchdog fix, Phase-G skip, nvfp4 launcher - #62
Merged
Merged
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> (cherry picked from commit 6c53de7)
(cherry picked from commit 45e3c49)
…ip qwen3.8-27b Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com> (cherry picked from commit 808dc30)
…s NVFP4-packed On NVFP4-packed checkpoints the shared lm_head DenseWeight pointer addresses PACKED bytes (e.g. nvidia/Qwen3.8-27B-NVFP4 ships lm_head.weight as U8 [248320, 2560] — ~636 MB, not ~2.5 GB of BF16). The decode path already guards this: the drafter's logits GEMM routes through the NVFP4 twin via w4a16, with a comment naming the exact failure — a BF16 GEMM on packed bytes reads 4x the buffer and faults (CUDA-700 ILA). Phase G missed that guard in two places: 1. from_weights.rs quantized lm_head_shared as BF16 unconditionally. With ATLAS_DFLASH_DRAFTER_FP8=1 the load crashed deterministically on gfx1151 — 90+ gfxhub page faults, hipErrorIllegalAddress — after all 35 per-layer quantizes succeeded, at the lm_head launch. 2. The fp8 decode branches in batch_forward.rs and forward_block.rs fell back to dense_gemm_bf16_pipelined on lm_head_shared when the FP8 mirror was absent — the same OOB read, deferred to first decode. Fix mirrors the existing non-fp8 dispatch: skip the lm_head quantize when lm_head_nvfp4 is Some (the packed-twin signal), and collapse the fp8 branch into the shared dispatch — when no FP8 mirror exists the head drafts logits through the NVFP4 twin exactly like the BF16 path. On checkpoints whose lm_head is genuinely BF16 (no nvfp4 twin) the quantize and the fp8 row-scaled path are unchanged. Validated on AzeezStrix gfx1151: ATLAS_DFLASH_DRAFTER_FP8=1 now boots clean — Phase G logs "drafter weights ready as FP8" with the lm_head quantize skipped — and a probe request drafted via the nvfp4 fallback (mean_na=2.583, p1=0.917, coherent output). cargo fmt clean. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com> (cherry picked from commit 45791e7)
…umbers
Found on winbox serving Qwen3.8-Flash-Next-NVFP4 (2026-09-20, gfx1151;
identical logic on GB10): on the MinHeap+unittest prompt both decode arms
were cut at 641 tokens mid `values = [8, 3, 1, 6, 4, 2, 7,`.
serial: decode_logits_content — "Content-loop watchdog fired
(period-2…64 repeat); rolled back to boundary, re-steering
content_tokens=570 dropped=70 rollback=1" → rollback=2 →
"ending response early (rollback declined)"
MTP: emit_step — "Content-loop watchdog fired in MTP/emit path …
ending response"
detect_content_token_loop_normalized_with maps every numeric token to
NUMERIC_SENTINEL, so a comma-separated list of distinct numbers
normalizes to `N , N , N , …` — a period-2 anchored repeat at
NORM_MIN_REPEATS=4. Any list of ≥5 distinct numbers (test fixtures,
arrays, tables) tripped it.
Fix: a new `VocabMasks::punctuation` (token decodes to non-empty
ASCII punctuation/whitespace) lets the normalized detector learn the
matched period via detect_token_loop_period and decline when the window
is only sentinels and punctuation. A real numeric runaway (`1, 1, 1, …`)
still fires — identical tokens repeat literally, so the exact detector
catches it. `punct == None` keeps the legacy fail-open behaviour.
(cherry picked from commit 92d53d2)
…hazard) (cherry picked from commit a4295fd)
helpers_tests.rs crossed the 500-LoC CI cap when the watchdog tests landed; follows the confidence_tests.rs split precedent. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This was referenced Sep 25, 2026
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
Cherry-picks the 6 commits stranded on
port/dflash2-strix-windows-r2that never reached main (the port branch merged via #52 before these landed):d199348baDFlash2 selector scores the full rank and top-k the checkpoint declares58f55b936selector parity fixture uses distinct bf16 logits48cc72f0fdeclare DFlash Phase-G fp8 probes expected-absent on strix-hip qwen3.8-27b73beebc31skip Phase G lm_head FP8 quantize when the shared head is NVFP4-packedceab72f98content-loop watchdog must not fire on lists of distinct numbers6476844dewin_serve_dflash2_nvfp4.ps1launcher (ASCII-safe for WinPS 5.1)Plus
932492194: splits the watchdog tests out ofhelpers_tests.rs— the watchdog tests pushed it over the 500-LoC cap; follows theconfidence_tests.rssplit precedent.All commits were runtime-validated on gfx1151 Windows (28.5 tok/s DFlash2 E2E at the port-branch head
a4295fda).Test plan
helpers_tests.rsback to 477 LoC, newnumber_list_tests.rs107 LoCGenerated with Devin