mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #3102] [CLOSED] [Engine] perf(hip): enable wave32 QSA decode attention and MMVQ row reuse on gfx12 #4454
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#4454
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/3102
Author: @bsorensen110
Created: 10/18/2026
Status: ❌ Closed
Base:
main← Head:perf/rdna4-d5-qsa-decode-mmvq📝 Commits (3)
47fb8afperf(hip): enable exact wave32 QSA decode kernels on gfx121068c5fperf(hip): reuse MMVQ fragments across rows on gfx12f0a5d81fix(hip): call __syncthreads() in mmvq_sync_lds() fallback📊 Changes
5 files changed (+231 additions, -85 deletions)
View changed files
📝
CMakeLists.txt(+23 -27)📝
include/strata/kernels/native_mmvq.hpp(+4 -4)📝
src/kernels/b6_mmvq_bench.cpp(+5 -3)📝
src/kernels/cuda/native_mmvq.cu(+157 -34)📝
src/kernels/cuda/qsa_decode_attn.cu(+42 -17)📄 Description
Problem and result
This PR combines two bitwise-exact RDNA4 (gfx12, wave32) decode/speculative-verification optimizations and enables their parity/benchmark harnesses under
STRATA_ENABLE_HIP:__syncthreads()withqda_sync_lds()to avoid stalling on global KV VMEM loads, enables wave32attn_chunk_kernel_pre75<M,8,true>by default on gfx12, enables boundedattn_merge_v2_kernel<16>by default on gfx12.mmvq_sync_lds()on gfx12/gfx103x, enablesv_perm_b32IQ4 lookup path across HIP targets, extendsb6_mmvq_rows_kernelto SmallTraits (Q8_0, IQ4_NL) with preload of activation fragments, addsb6_default_rows_gfx12for auto row count on gfx12.Related discussion
none
Approach
On gfx12, the prior implementation suffered from shared-memory barriers draining in-flight global KV VMEM loads due to
__syncthreads()emitting full system scope barriers. The workgroup-scopedqda_sync_lds()andmmvq_sync_lds()avoid L0 vector cache invalidation and global-load drain while preserving synchronization. For MMVQ, activation fragments and reusable weight-code transforms are preloaded once across output rows, reducing redundant global loads. The auto row count table (b6_default_rows_gfx12) selects measured optimal rows per shape on gfx12, falling back to off elsewhere.Validation
Passed:
qsa_scores_parity: revisione88ee39d, GPU AMD Radeon AI PRO R9700 (gfx1201), observed PASS (zero bitwise differences)qsa_topk_active_parity: revisione88ee39d, GPU AMD Radeon AI PRO R9700 (gfx1201), observed PASS (selected IDs bitwise identical)mmvq_multi_parity: revisione88ee39d, GPU AMD Radeon AI PRO R9700 (gfx1201), observed PASS (0 bit-different with multi_exact on)b6_mmvq_bench 80 0 -1: revisione88ee39d, GPU AMD Radeon AI PRO R9700 (gfx1201), observed PASS (0 failed comparisons)qsa_merge_daily_parity: revisione88ee39d, GPU AMD Radeon AI PRO R9700 (gfx1201), observed PASS (0 bitwise differences)arch_defaults_test: revisione88ee39d, GPU AMD Radeon AI PRO R9700 (gfx1201), observed PASSFailed:
Not run:
Limits
ncols == 1) is unchanged:b6_launchis only invoked fromlaunch_multi_nwhenncols > 1andmulti_exact()is true. EvaluatedSTRATA_Q6_PACKED=1for one-columnQ6_Kheads on gfx1201, but at the default 640-block grid it regressed the 106,299-row MTP head (339.9 → 408.8 us) and 248,320-row output head (794.1 → 960.4 us) while requiring ~213–497 MiB of additional persistent VRAM; bothSTRATA_Q8_PACKEDandSTRATA_Q6_PACKEDremain off by default.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.