Skip to content

strix: SCALE 1.8.0 gfx1151 WMMA/FLA/DFlash2 kernel & MODEL.toml parity - #437

Merged
AzeezIsh merged 1 commit into
mainfrom
feat/strix-scale18-parity
Dec 4, 2026
Merged

AzeezIsh merged 1 commit into
mainfrom
feat/strix-scale18-parity

Conversation

@AzeezIsh

@AzeezIsh AzeezIsh commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Stacked on #436 (fix/strix-scale18-ootb).

Summary

Brings the kernels/strix/ (SCALE 1.8.0) kernel tree and kernels/strix/qwen3.8-27b/MODEL.toml to parity with strix-hip on gfx1151:

  1. Zero-spill AMD-WMMA prefill GEMMs & FLA GDN under SCALE 1.8.0 (kernels/strix-hip/ + kernels/strix/):
    • SCALE 1.8.0's clang-23 declares __builtin_amdgcn_wmma_f32_16x16x16_bf16_w32 taking short __attribute__((ext_vector_type(16))) instead of __bf16[16]. Add a 4-line #if defined(__SCALE__) atlas_wmma_bf16_w32 helper using __builtin_bit_cast in the 5 shared WMMA files (common/{w4a16_gemm,w8a16_gemm_t_m128,w8a16_gemm_n_m128,gated_delta_rule_fla}.cu and qwen3.6-27b/nvfp4/w4a16_gemm.cu). On hipcc, #else macro-expands identically to the original builtin (verified with hipcc --genco --offload-arch=gfx1151 on all 5 files).
    • Symlink kernels/strix/common/w4a16_gemm.cu and kernels/strix/qwen3.6-27b/nvfp4/w4a16_gemm.cu to the zero-spill AMD-WMMA kernels, eliminating the 3,036 B/lane VGPR spills and ~11 min compile time of the old CUDA w4a16_gemm.cu under SCALE 1.8.0.
    • Symlink the missing gfx1151 modules (gated_delta_rule_fla.cu, w4a16_gemv_dp4a.cu, moe_expert_gemv_dp4a.cu, w8a16_gemm_{t,n}_m128.cu, w8a16_gemv_batch4.cu, dequant_fp8_bs128_bf16_v8.cu) and gb10/common/ DFlash2 / GDN / grammar modules (gated_delta_rule_wyn.cu, gdn_verify_fused_{conv_kn,k2}.cu, dequant_nvfp4_bf16.cu, dense_gemv_{bf16_batchm,fp8w_batch2,fp8w_batchm}.cu, dflash*, grammar_bitmask.cu, quantize_bf16_to_fp8_blockscaled.cu, inferspark_prefill_paged_*sink*.cu).
  2. Strict-boot & DFlash2 parity in kernels/strix/qwen3.8-27b/MODEL.toml:
    • Adds default_num_drafts = 3, default_kv_dtype = "bf16", tool_call_steering = false, max_inter_tool_prose = 0, verbatim_prompt = true, [dflash] (incoai/Qwen3.8-27B-DFlash2), and [expected_absent.*] so spark serve boots cleanly without --dangerously-allow-unresolved-kernel-lookups.
  3. serve-amd.sh:
    • Restores uniform ATLAS_FFN_SMALLM="${ATLAS_FFN_SMALLM:-0}" default now that strix ships zero-spill AMD-WMMA m128 kernels.

Measured Impact (vs parent #436 b283c8e44 on Framework Desktop gfx1151, SCALE 1.8.0)

Fresh-checkout receipt for pushed SHA e57bc689a will be posted below once its clean rebuild finishes.
Preview from identical pre-commit tree (nvidia/Qwen3.8-27B-NVFP4, strict boot, zero env overrides):

Metric #436 (b283c8e44) This PR (e57bc689a)
Clean build (strix/qwen3.8-27b) 12m 37s (96 kernels) 2m 01s (123 kernels, 6.3× faster)
Strict boot (no --dangerously-allow-unresolved-kernel-lookups) Failed (unresolved probes) PASS (both MTP K=4 & DFlash2)
Math 28t TTFT (391) 10.08s 1.58s (6.4× faster)
Code 33t TTFT / decode (fib(n)) 7.85s / 16.75 tok/s 1.51s / 26.4 tok/s (MTP K=4)
Needle 2452t TTFT (ALPHA-7492-ZETA) 178s 57.8s (3.1× faster)
DFlash2 (incoai/Qwen3.8-27B-DFlash2, γ=8) Unsupported 29.4 tok/s (tok_step=6.29, 11/11 subgraphs)

Follow-up PR (PR 3) will enable cfg!(atlas_scale) for the now-shipped _f16a, w8a16_gemm_n_m128, and w4a16_gemv_dp4a kernels in spark-model (unlocking DP4A decode + eliminating the 26s transpose_fp8 boot step + further prefill speedup).

…151 parity

Switch the strix (SCALE) kernel tree from spilling CUDA prefill GEMMs to the
zero-spill AMD-WMMA gfx1151 kernels in strix-hip/common (via a 4-line
#if defined(__SCALE__) bitcast wrapper for clang-23's v16i16 WMMA builtin,
leaving hipcc macro-identical) and symlink the missing FLA, DFlash2, DP4A,
and W8A16 modules so strix/qwen3.8-27b boots strictly without
--dangerously-allow-unresolved-kernel-lookups.

Changes:
- kernels/strix-hip/: add __SCALE__ atlas_wmma_bf16_w32 wrapper in 5 WMMA
  files (hipcc path unchanged, verified via hipcc --genco --offload-arch=gfx1151).
- kernels/strix/common/ & qwen3.6-27b/nvfp4/: symlink AMD-WMMA w4a16/w8a16/FLA
  kernels plus DFlash2, DP4A, grammar_bitmask, and gb10 gated_delta_rule_wyn.
- kernels/strix/qwen3.8-27b/MODEL.toml: parity with strix-hip/qwen3.8-27b
  (default_num_drafts=3, default_kv_dtype="bf16", [dflash], [expected_absent]).
- serve-amd.sh: restore uniform ATLAS_FFN_SMALLM=0 default now that strix
  ships zero-spill AMD-WMMA m128 kernels.

Stacked on #436 (fix/strix-scale18-ootb).
@AzeezIsh

AzeezIsh commented Dec 1, 2026

Copy link
Copy Markdown
Contributor Author

Fresh-checkout receipt (e57bc689abdfdcd0e6b54ad7f0b7286652e37ebd, Framework Desktop gfx1151, SCALE 1.8.0)

Built via git archive e57bc689a with unset SCALE_HOME ATLAS_FAST_LOAD ATLAS_FFN_SMALLM KV_DTYPE DFLASH; ATLAS_TARGET_HW=strix ATLAS_TARGET_MODEL=qwen3.8-27b ./build-amd.sh and served with zero env overrides and no --dangerously-allow-unresolved-kernel-lookups:

  • Build: 123/123 kernels compiled in 2m 17s (clean fresh archive; vs 12m 37s on parent strix/scale: unblock SCALE 1.8.0 out-of-the-box build and boot #436).
  • Strict boot: PASS on both MTP K=4 (ready in 31.2s) and DFlash2 γ=8 (ready in 33.2s).
  • MTP K=4 (nvidia/Qwen3.8-27B-NVFP4):
    • math_28t: TTFT 1.96s, output 391
    • code_33t: TTFT 1.55s, 26.48 tok/s, exact fib(n)
    • Unchunked needle (--max-prefill-tokens 8192): 6/6 exact ALPHA-7492-ZETA at 452t / 1652t / 2452t (both FLA on and ATLAS_GDN_FLA_GFX=0).
  • DFlash2 (incoai/Qwen3.8-27B-DFlash2, γ=8):
    • math_28t: TTFT 1.58s, output 391
    • code_33t: TTFT 1.53s, 30.02 tok/s, exact fib(n)
  • Note on chunked prefill (--max-prefill-tokens 2048 on >2048t prompts) & 52s TTFT: Both are caused by the remaining gb10 cp.async/mma.sync kernels still active before strix: enable AMD-WMMA prefill attention, _f16a, w8a16_n, and DP4A dispatch on SCALE #438 (fp8_gemm_t_blockscaled at 809 ms/layer and gb10/common/prefill_paged_compute.cuh). Both are resolved in stacked PR strix: enable AMD-WMMA prefill attention, _f16a, w8a16_n, and DP4A dispatch on SCALE #438 (which cuts 2,452t TTFT from 57.8s → 5.49s, boot from 32s → 5.0s, and brings chunked needle to 8/8 exact).
  • CI: All 18 workspace + kernel + release-matrix jobs green (cargo test, clippy, fmt, Kernel compile/nvcc -> PTX, 500 LoC, kernel shadow, release matrix / build × 2).

@AzeezIsh
AzeezIsh changed the base branch from fix/strix-scale18-ootb to main December 4, 2026 19:32
@AzeezIsh

AzeezIsh commented Dec 4, 2026

Copy link
Copy Markdown
Contributor Author

Stack verification: see #436.

@AzeezIsh
AzeezIsh merged commit 0fd2002 into main Dec 4, 2026
19 of 22 checks passed
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