Repository navigation
strix-hip/qwen3.8: GDN K=4 DP4A verify arm + fused conv + strided QKV GEMV - #30
Merged
Merged
Conversation
The bail predates the dense forward path's ProjectionWeight dispatch: gemv()/dense_ffn_forward_generic already route Nvfp4 through w4a16_decode_gemv, and propose_batch_scope_ok confines the BF16-only batched propose (scope check fails -> serial per-seq propose). KV stays FP8 as with MoE NVFP4 heads; drafter-context prefill declines with a warning as it does for fp8. Acceptance on a dense head is unmeasured — gate on the A/B before adopting --mtp-quantization nvfp4. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Adds the nvidia/Qwen3.8-27B-NVFP4 bfcl-subset entry (83.22/79.02, run-1789114625433625524) with the fp8to4 requant derivative's 82.71/79.58 recorded as provenance — normalized +0.56, inside noise; the requant is shippable. Also vendors the vectorized requant script and a checkpoint fingerprint sidecar so the derived weights are reproducible/verifiable. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
strix-hip never shipped gdn_verify_fused_conv_kn.cu, so every GDN MTP verify ran the per-token conv1d_update_l2norm loop plus a conv_state copy_d2d per position: K=4 verify cost 4 conv launches + 3 D2D copies per SSM layer per step (~48 layers => ~144 copies + ~144 launches/step of the profiled copyBuffer mass). The K=2 twin and the cross-sequence batched variant (gdn_verify_fused_conv_kn_batched, 2 launches/depth-run instead of n*K) resolve automatically once the modules exist. Port both files verbatim from gb10/common (hip compat covers bf16/shfl; KERNEL.toml --fmad=false is already global on strix-hip) and dispatch K=3/K=4 through ops::gdn_verify_fused_conv_kn when the handle resolves and conv_state_intermediates are pool-contiguous. Bit-identical to the per-token path (same accumulation order; gdn_verify_fused_microtest cos == 1.0 on gb10). Kill switch: ATLAS_GDN_FUSED_CONVK=0. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
The factory silently rewrote any non-Bf16 --mtp-quantization to Bf16 when the checkpoint's quantization_config.ignore_modules lists mtp.* — which the NVFP4 checkpoint does. Since mtp_quant defaults to bf16, reaching that branch non-bf16 is always an explicit user request; the veto made --mtp-quantization nvfp4 un-engageable on exactly the checkpoints where runtime-quantizing the BF16 MTP head is the intended path (Qwen3.8 dense lever). Warn and honor instead; ATLAS_MTP_RESPECT_QUANT_EXCLUDE=1 restores the protective override where acceptance is known to collapse. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
The strix generic-K fused conv arm removes exactly the K-1 conv-state snapshot copies; the non-contiguous fallback keeps them. MockGpuBackend counts copy_d2d calls, so the delta pins the win without a GPU. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
The upstream test pinned w8a16_gemm_pipelined geometry at R=7, but the strix stack's w8a16_gemv_batch16 arm (4003f74) sits ahead of the num_tokens>4 GEMM fallback and resolves on every target — under the mock it always wins. Pin the batch16 grids instead. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…atter
ms_qkv_batchn at n<=8 ran three batched GEMVs into scratch and then
copied every row into the interleaved qkv_buf (3*n D2D copies per
attention layer per verify step — 12/layer at K=4, ~192/step across 16
layers). New w4a16_gemv_batch{4,8}_os and w4a16_gemv_dp4a_batch4_d4_os
entry points take an output row stride, so each projection lands in its
qkv_buf slice directly — same bit-exact body, same bytes. The DP4A arm
also quantizes the shared normed input once instead of three times.
Fallback chain is unchanged: missing _os kernels or ATLAS_NO_QKV_OS=1
restore the scratch+scatter route, and the dispatch keeps whichever
numeric path (DP4A vs float) the scratch route would have used.
Generated with [Devin](https://devin.ai)
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…proj — DP4A arm for GDN The batched single-seq verify path (trait_decode_batched) called\nw4a16_gemv_batchm directly for both GDN projections at num_tokens==4,\nleaving the two biggest per-layer weight reads on the non-DP4A GEMV\nwhile attention/FFN/multi-seq mixer already ran w4a16_gemv_dp4a_batch4_d4.\nProfile basis: w4a16_gemv_batch4 29.9% of step GPU time vs DP4A kernels\n35% — roughly half the verify GEMV traffic unported.\n\nssm_fp4_proj engages the W4A8 DP4A arm at m==4 under ATLAS_W4A16_DP4A=1\nand falls back to the identical batchm call otherwise; visibility widened\npub(super) -> pub(crate) for the sibling module. No kernel changes. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
spark-runtime's stream_is_capturing (telemetry tap gate) references\ncuStreamIsCapturing on non-SCALE builds; the strix-hip shim never\nexported it, so test/bin links failed with undefined symbol. Wraps\nhipStreamIsCapturing — same status enum values as CUDA. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
The Nvfp4 arm nulled every optional handle, but dense-checkpoint heads\nstill run BF16-kernel helpers: dense_ffn_forward_generic silu_muls its\ngate/up pair via moe_silu_mul (moe_forward.rs:60 — panic observed on\nstrix, thread unwrap on None at first draft), the batched path repeats\nit (forward_batch.rs:469) and gated-Q uses deinterleave_qg. Resolve\nthose three under Nvfp4; MoE-only handles (topk, weighted_sum, fp8w)\nstay None — NVFP4 MoE goes through the fused MoeLayer. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Inherited over-cap on port/qwen3.8-strix-linux via 9bf3487; the whole-checkout scan fails every fresh PR off this base. Split tracked in #31. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…10 shadows The warp-per-row offset-convention norm was added to gb10/common for the Strix Qwen3.8 port's short-row Q/K shapes; the nine pre-existing gb10 rms_norm.cu shadows predate it and the only dispatch site is a soft probe().unwrap_or(KernelHandle(0)), so omission degrades to the block-per-row kernel rather than failing the startup audit. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
The entries carry real measured data, but the gate's self-start resolves recipe from atlas-recipes and no recipe can express the strix serve environment (env-var-bound levers the recipe schema has no field for). A measured entry without a resolvable recipe fails the coverage check; an invented recipe would self-start the wrong config. Floors preserved in the notes; also records the full-stack 83.02/80.41 re-run. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
cargo-deny's advisory check started failing on the newly published rustls advisory (TLS 1.3 handshake messages accepted at the wrong encryption level). Lockfile-only update via cargo update -p rustls; also pulls rustls-webpki 0.103.15. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…opts out Accuracy-validated on gfx1151 (995-row bfcl-subset 83.02/80.41; 511/511 M=1 argmax match vs the float path) and every dispatch site still requires resolved kernel handles, so targets without the DP4A kernel set miss on KernelHandle(0) and take the float E2M1-LUT path unchanged — inert on GB10. The flag remains as an explicit-off escape hatch; =1 is still accepted for harness back-compat. Also adds scripts/start-qwen38-strix.sh: the native-bare-metal serve invocation for Qwen3.8-27B NVFP4 on Strix Linux, flag-expressible end to end now that no env vars are required. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
… defaults default_num_drafts=3 (the measured K=4 arm: 28.3-28.6 tok/s, bfcl-subset 83.02/80.41, run-1789370409958768995) and default_kv_dtype=bf16 — the latter fixes a real gap: unset resolved to the engine default fp8, the unproven path on gfx1151. serve-amd.sh: drop the ATLAS_W4A16_DP4A export (now default-on; keeping it would override a user's =0 opt-out), spec on by default via NUM_DRAFTS=3 (=0 reproduces the frozen non-spec accuracy recipe), drop the thinking/tool-grammar determinism pins (thinking stays requestable; soak ran 52% thinking clean), and pick the newest shim dir that actually contains libcuda.so instead of the plain ls -dt head. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…h defaults to the validated config README gains a Strix Halo (gfx1151) recipe: build-amd.sh + serve-amd.sh, measured fingerprint (28.3-28.6 tok/s K=4, 83.02/80.41 bfcl-subset), and the env knobs. serve-amd.sh: spec on by default via NUM_DRAFTS=3 (=0 reproduces the frozen recipe), drops the DP4A export (default-on; a user =0 still opts out), drops thinking/tool-grammar determinism pins, picks the newest shim dir containing libcuda.so. MODEL.toml bakes default_num_drafts=3 and default_kv_dtype=bf16 (unset silently resolved to engine fp8). Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
The deep validation (995-row bfcl-subset 83.02/80.41, K=4 decode numbers, 2.55h soak) all ran on the nvidia Qwen3.8-27B-NVFP4 family — the default should be the tested path. LM_HEAD=bf16 remains the switch for the unsloth preservation checkpoint (its lm_head ships per-row FP8). Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
1 task done
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
Strix-hip (gfx1151) decode-path stack for the Qwen3.8-27B dense NVFP4 port. Routes the single-sequence K=4 verify QKVZ and output projections — and the attention QKV M=4 path — through the W4A8 integer-DP4A GEMV arm; adds a fused generic-K (K=3/K=4) GDN conv-verify kernel; adds strided-output (
_os) QKV GEMV variants that write projections directly into the interleavedqkv_buf; fixes a real panic in dense +--mtp-quantization nvfp4MTP construction; and adds the missingcuStreamIsCapturingsymbol to the HIPlibcudashim.Observed under serialized, own-PID-verified same-binary A/B on AzeezStrix: 24.62–24.66 → 28.3–28.6 tok/s K=4 decode (+~15%), decode @30k ctx 10.4 → 13.3–13.6 tok/s. Authoritative 995-row BFCL leg (the MLPerf ST golden draw): 83.02 overall / 80.41 normalized — no regression vs the requantized-checkpoint record (82.71 / 79.58).
Test plan
cargo fmt --all -- --check— clean at6c77f41a6ATLAS_SKIP_BUILD=1 CUDARC_CUDA_VERSION=13000 cargo clippy --workspace --tests— clean (the ci.yml gate;--all-featuresvariant fails onobjc2, an Apple-only dep — pre-existing workspace property on Linux, unaffected by this diff)bash scripts/check-license-headers.sh— 2315 files, 0 invalidtypos— clean (one pre-existing README typo fixed in6c77f41a6)_osdispatch order;qwen3_ssm+multi_seqattention suites pass (25 tests)Evidence
All perf numbers are single-harness serialized A/Bs (own-PID socket-verified serves, n=3 × 1024-token MinHeap-prompt runs, temp 0,
reasoning_effort:"none", K=4 spec verify, bf16-mtp). Fingerprints: binaryspark_gdndp4a2sha256f94e6d34…built at3645161b3for strix-hip; checkpoint/home/azeez/HaloLoom/workspace/qwen38-27b-fp8to4(all-NVFP4, FP8→NVFP4 requant); host AzeezStrix.64ea7cc980ce2bc,c93329c66032313(expected — int8 acts)4a0766c_osstrided writes46e697f3645161Arm engagement proven in serve logs (
GDN/attention W4A8 DP4A M=4 arm ACTIVE) and ROCProfiler kernel trace (w4a16_gemv_dp4a_batch4_d431.0% +_dual_batch4_d427.5% of GPU time).Accuracy
run-1789370409958768995.json, ~4 h leg on the full stack. Prior requantized-ckpt record: 82.71 / 79.58 → +0.31 / +0.83. The runner displays the Qwen3.6 floors (83.64/85.32); those do not gate this Qwen3.8 validation baseline.--max-seq-len 8192— same as baselines).Notes for reviewers
ATLAS_W4A16_DP4A=0is the opt-out (=1still accepted for harness back-compat). Eligibility requires exact m=4, both kernel handles resolved, and non-null int8 scratch — any negative falls back to the float E2M1-LUT path bit-identically. On non-gfx1151 targets the handles areKernelHandle(0), so the float path is unconditional there — the flip is inert on GB10. Justified by the accuracy record: 83.02/80.41 on the 995-row golden draw + 511/511 M=1 argmax match vs float.serve-amd.shremains the single user entry point — updated so the validated config is the default: spec decode on viaNUM_DRAFTS=3(=0reproduces the frozen non-spec recipe), the DP4A export removed (default-on now; a user=0still opts out), thinking/tool-grammar determinism pins dropped (requestable thinking; soak ran a 52%-thinking mix clean), and the shim pick now selects the newest build dir that actually containslibcuda.so. MODEL.toml also bakesdefault_num_drafts=3anddefault_kv_dtype="bf16"— the latter fixes a real gap: unset resolved to the engine defaultfp8, the unproven path on gfx1151. README gains a Recipe D quickstart for the bare-metal Linux/AMD path (build-amd.sh→serve-amd.sh).w4a16_gemv.cugains aC_strideparam on the internal impl; every existingextern "C"entry point passesN(identical codegen), plus two new_ossymbols.rms_norm.cuappendsrms_norm_offset_warp_row. No existing GB10 kernel was modified.w4a16_gemv_swlaunch contract preserved: base GEMV 4 outs/block, SW 8 outs/block, SW only when lever + handle valid.MtpQuantization::Nvfp4the handle tuple was fully nulled but the dense-FFN path still unwrapsmoe_silu_mul_k(moe_forward.rs:60); the commit resolves the dense-needed handles. Validated end-to-end (drafts engage,mtp=1.00)._osgrid math is coupled to the kernel output-block constants.Known issues / follow-ups
pure virtual method calledfires after "Shutdown complete" on HIP-shim builds. Cosmetic teardown-ordering bug — request results are unaffected — but worth a follow-up before publicizing.realistic_soak.py, 6 clients, 52% thinking requests, 86 tool calls): 320 requests, 4 errors (1.2%, flat — no accumulation), zero crashes or leaks. Sustained fresh prefill 93 tok/s (harness forces 0% prefix-cache hit); 36,353 decode tokens generated, 56% reasoning. Aggregate decode ≈4 tok/s reflects the thinking-heavy mix (inside-<think>runs the serial floor by design), not the K=4 path the burst numbers measure.maininvalidates them — green needs a fresh 10-gate campaign (~4–5 h) on a GB10 host at a frozen head. This PR targets the unprotectedport/qwen3.8-strix-linuxbranch; the campaign belongs to the main-bound landing, not this port-stage merge.CLA