Repository navigation
Conversation
…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>
|
Box re-run on AzeezStrix (gfx1151, ROCm 10, The 2026-09-18 validation cited in the description ran on a branch whose strix-hip |
|
Folded into the Linux follow-ups PR (port/qwen38-strix-linux-followups) — cherry-picked as a238405. |
Summary
Cherry-pick of
f977c9af0(written 2026-09-18 on the DFlash2 line, validated on AzeezStrix gfx1151) onto currentmain; applied cleanly over #37/#38.On NVFP4-packed checkpoints the shared
lm_headDenseWeightpointer addresses PACKED bytes (nvidia/Qwen3.8-27B-NVFP4shipslm_head.weightas U8[248320, 2560], ~636 MB — not ~2.5 GB of BF16). The decode path already guards this (drafter logits via the NVFP4 twin throughw4a16). DFlash Phase G (ATLAS_DFLASH_DRAFTER_FP8=1) missed the guard in two places:from_weights.rsquantizedlm_head_sharedas BF16 unconditionally → deterministichipErrorIllegalAddressat load on gfx1151 (90+ gfxhub page faults) after all 35 per-layer quantizes succeeded.batch_forward.rs/forward_block.rsfell back todense_gemm_bf16_pipelinedonlm_head_sharedwhen the FP8 mirror was absent — the same 4×-oversized read, deferred to first decode.Fix mirrors the existing non-fp8 dispatch: skip the lm_head quantize when
lm_head_nvfp4isSome, and collapse the fp8 branch into the shared dispatch so a missing FP8 mirror drafts logits through the NVFP4 twin exactly like the BF16 path. Checkpoints whose lm_head is genuinely BF16 are unchanged.Validated (original commit, AzeezStrix):
ATLAS_DFLASH_DRAFTER_FP8=1boots 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). Not re-run on the box after the cherry-pick (the diff applied without conflicts).Test plan
cargo fmt --all -- --check;ATLAS_SKIP_BUILD=1 CUDARC_CUDA_VERSION=13000 cargo clippy -p spark-model --testsclean on the pinned 1.93.1 toolchaincargo test -p spark-model dflashon a CUDA/stub host (the Mac cannot linklibcuda)fp8_gemm_t_row_scaled(_m16)are not in that w4a16 module — see comment)Generated with Devin