Repository navigation
strix: enable AMD-WMMA prefill attention, _f16a, w8a16_n, and DP4A dispatch on SCALE - #438
Merged
Merged
Conversation
…spatch on SCALE Unlock the gfx1151 kernels now shipped in kernels/strix/ (via #437) and port the AMD-WMMA prefill attention kernels from strix-hip so ATLAS_TARGET_HW=strix (SCALE 1.8.0) reaches full gfx1151 parity on prefill, decode, boot time, and chunked-prefill correctness: 1. AMD-WMMA prefill attention (eliminates gb10 cp.async paged-attention bug): - Add the #if defined(__SCALE__) WMMA bitcast wrappers (bf16 + f16) to kernels/strix-hip/common/{prefill_paged_compute.cuh,inferspark_prefill.cu, inferspark_prefill_h128.cu} (hipcc path unchanged; all verified via hipcc). - Symlink kernels/strix/common/{prefill_paged_compute.cuh, inferspark_prefill_paged.cu,inferspark_prefill.cu, inferspark_prefill_h128.cu} to strix-hip/common/. - Update prefill_attn_main_b.rs to use BR64=64 uniformly now that both strix-hip and strix run the 8-warp AMD-WMMA prefill_paged_compute.cuh. 2. Enable cfg!(atlas_scale) dispatch for gfx1151 kernels & UMA reclaim: - strix-hip/qwen3.6-35b-a3b/nvfp4/w4a16_gemm.cu: add __SCALE__ WMMA wrapper and symlink into strix/qwen3.6-35b-a3b so all strix targets ship _f16a/s64. - strix_f16.rs & strix_s64.rs: enable w4a16_gemm_t_m128_f16a (+ m32 twins) and w4a16_gemm_s64 on cfg!(atlas_scale) (keeping moe_w4a16 on atlas_hip). - dense_ffn.rs, dense_ffn_dp4a.rs, qwen3_ssm/init.rs, qwen3_ssm/tests.rs, qwen3_attention/init.rs, model/impl_a1.rs: enable w4a16_gemv_dp4a* and w8a16_gemv_batch8* on cfg!(atlas_scale). - qwen3_ssm/init.rs, qwen3_attention/init.rs, moe/init_optional.rs, nemotron_mamba2.rs, ops.rs, ops/gemm_quant.rs: enable w8a16_gemm_n_m128 (+ m32/m64 small-M twins) on cfg!(atlas_scale) and gate NVIDIA w8a16_gemm_pipelined / fp8_gemm_t_blockscaled off on cfg!(atlas_scale) (skipping the 26s FP8 transpose at boot and the 809ms/layer FP8 prefill). - weight_loader/qwen35_dense.rs: reclaim dead in_proj_qkv/in_proj_z buffers after concat on cfg!(atlas_scale) (~4 GB UMA VRAM reclaimed). Stacked on #437 (feat/strix-scale18-parity).
Contributor
Author
Fresh-checkout receipt (
|
Mode (nvidia/Qwen3.8-27B-NVFP4) |
math_28t (391) |
code_33t (fib(n)) |
needle_2452t #1 (ALPHA-7492-ZETA) |
needle_2452t #2 (ALPHA-7492-ZETA) |
|---|---|---|---|---|
| MTP K=4 (BF16 KV) | 0.210s TTFT, exact | 0.304s TTFT, 32.25 tok/s, exact | 5.87s TTFT, 29.88 tok/s, exact | 5.70s TTFT, 29.49 tok/s, exact |
| DFlash2 γ=8 (BF16 KV) | 0.195s TTFT, exact | 0.290s TTFT, 42.74 tok/s, exact | 5.69s TTFT, exact | 5.58s TTFT, exact |
| MTP K=4 (NVFP4 KV) | 0.218s TTFT, exact | 0.306s TTFT, 32.06 tok/s, exact | 5.88s TTFT, 29.13 tok/s, exact | 5.75s TTFT, 29.32 tok/s, exact |
Combined with the pre-push run on identical source (4/4 MTP4 + 4/4 DFlash2), chunked needle is 14/14 exact (ALPHA-7492-ZETA) across BF16 KV, NVFP4 KV, MTP K=4, and DFlash2. All 4 modified kernels/strix-hip/ files also pass hipcc --genco --offload-arch=gfx1151.
Contributor
Author
|
Stack verification: see #436. |
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.
Stacked on #437 (
feat/strix-scale18-parity).Summary
Unlocks the gfx1151 kernels now shipped in
kernels/strix/(from #437) and replaces the remaining NVIDIAcp.async+mma.syncprefill kernels (inferspark_prefill_paged.cu/prefill_paged_compute.cuh,w8a16_gemm_pipelined,fp8_gemm_t_blockscaled) with the validated AMD-WMMA / DP4A gfx1151 kernels underATLAS_TARGET_HW=strix(SCALE 1.8.0):#if defined(__SCALE__)WMMA bitcast wrappers (bf16+f16) tokernels/strix-hip/common/{prefill_paged_compute.cuh,inferspark_prefill.cu,inferspark_prefill_h128.cu}(hipcc path macro-identical; verified withhipcc --genco --offload-arch=gfx1151).kernels/strix/common/{prefill_paged_compute.cuh,inferspark_prefill_paged.cu,inferspark_prefill.cu,inferspark_prefill_h128.cu}tostrix-hip/common/.crates/spark-model/src/layers/ops/prefill_attn_main_b.rsto uniformBR64=64now that bothstrix-hipandstrixrun the 8-warp AMD-WMMAprefill_paged_compute.cuh.cfg!(atlas_scale)dispatch for gfx1151 WMMA/DP4A kernels & UMA reclaim:__SCALE__WMMA wrapper tokernels/strix-hip/qwen3.6-35b-a3b/nvfp4/w4a16_gemm.cuand symlinks it intokernels/strix/qwen3.6-35b-a3b/nvfp4/so allstrixtargets ship_f16aand_s64.strix_f16.rs,strix_s64.rs: enablew4a16_gemm_t_m128_f16a(+m32_f16a_{n128,n64}twins) andw4a16_gemm_s64oncfg!(atlas_scale)(keepingmoe_w4a16oncfg!(atlas_hip)).dense_ffn.rs,dense_ffn_dp4a.rs,qwen3_ssm/{init,tests}.rs,qwen3_attention/init.rs,model/impl_a1.rs: enablew4a16_gemv_dp4a*(including M=5..8 split dual) andw8a16_gemv_batch8*oncfg!(atlas_scale).qwen3_ssm/init.rs,qwen3_attention/init.rs,moe/init_optional.rs,nemotron_mamba2.rs,ops.rs,ops/gemm_quant.rs: enablew8a16_gemm_n_m128(+m32/m64small-M twins) oncfg!(atlas_scale)and gatew8a16_gemm_pipelined&fp8_gemm_t_blockscaledoff oncfg!(atlas_scale)(eliminating the 26stranspose_fp8_for_prefillboot step and the 809ms/layer FP8 prefill GEMM).weight_loader/qwen35_dense.rs: reclaim deadin_proj_qkv/in_proj_zbuffers after concat oncfg!(atlas_scale)(~4 GB UMA VRAM saved).Measured Impact (vs parent #437
e57bc689aon Framework Desktopgfx1151, SCALE 1.8.0)Fresh-checkout receipt for pushed SHA
59d815c03will be posted below once its clean rebuild completes.nvidia/Qwen3.8-27B-NVFP4, zero env overrides)b283c8e44)e57bc689a)59d815c03)strix/qwen3.8-27b)--dangerously-allow-...)391)fib(n))ALPHA-7492-ZETA)cp.asyncpaged attn)