mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #228] [CLOSED] QSA select on tensor cores (rocWMMA, opt-in, gfx1100) + AMD RX 7900 XTX rates row + verify profiler columns fix #2515
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#2515
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/228
Author: @xyzzing
Created: 9/30/2026
Status: ❌ Closed
Base:
main← Head:feature/rocwmma-qsa-select-upstream📝 Commits (10+)
8b575c4Add experimental gfx1100 HIP backend and native mmap supportea2a87bAdd tuned gfx1100 prefill and resident expert serving support3a1dca6Load supported native Orca PLE keys and verify real-matrix replayb90591eBound HIP expert uploads with reusable pinned staging014d9fcRecord fresh gfx1100 throughput and validation results9568e78Account for clean reclaimable cache in cgroup resident budgetsd797787docs: record final guarded HIP runtime measurements49d0a4bdocs: keep throughput evidence distinct from task correctness8361a25Merge PR #121: gfx1100 HIP support with tuned prefill and bounded expert uploads (supersedes #94)20ea74dHIP build of the #121 merge: gate the sm_80 CUDA kernels, extend the compat layer📊 Changes
25 files changed (+1700 additions, -119 deletions)
View changed files
➕
.agentic/checks.json(+1 -0)➕
.agentic/install-state.json(+9 -0)➕
.agentic/verify.py(+37 -0)➕
.agentic/workflow.md(+39 -0)➕
.github/workflows/ci.yml(+128 -0)➕
.github/workflows/release.yml(+87 -0)➕
AGENTS.md(+8 -0)➕
CLAUDE.md(+8 -0)📝
CMakeLists.txt(+40 -2)📝
docs/AMD_HIP.md(+3 -1)📝
include/strata/core/verify.hpp(+2 -1)➕
include/strata/hip_compat/math_constants.h(+9 -0)📝
include/strata/kernels/native_qsa_indexer.hpp(+6 -0)📝
include/strata/kernels/qsa_select.hpp(+9 -0)📝
include/strata/platform/direct_file.hpp(+3 -2)📝
serve/server.py(+9 -2)📝
serve/telemetry.py(+256 -8)➕
serve/test_telemetry.py(+152 -0)📝
src/core/verify.cpp(+21 -8)📝
src/kernels/cuda/native_qsa_indexer.cu(+102 -0)...and 5 more files
📄 Description
Three independent parts; each is separately reviewable. Built on PR #187's multi-query
block scorer (cherry-picked as
ed70478in this branch — if you'd rather merge #187first, the branch rebases onto it cleanly;
git merge-treeshows no other overlap).1.
qsa_block_scores_wmma: the prompt scorer arm on tensor coresThe prompt path's QSA block scores (
score(qi,b) = sum_h relu(sum_i k_b[i] · q_qi,h[i]))now have a rocWMMA 16×16×16 FP16→FP32 implementation beside the warp kernel. gfx11 has no
mma.sync, and this is the tensor-core path that actually runs there — verified at theinstruction level: the gfx1100 code object executes 8
v_wmma_f32_16x16x16_f16(the 8K-slices of the mma loop) with
block_scores_tail_kernelandf32_to_f16_poison_kernelalongside.
Opt-in, with an honest fallback.
STRATA_SELECT_WMMA=1tries the arm first; the hostentry refuses (wrong geometry, not gfx1100, no rocWMMA) and the warp kernel keeps the
work. The arm that actually ran prints once (
strata select: prompt scorer arm = ...) soa fallback cannot masquerade as the fast path. No other device changes behavior;
every non-gfx1100 device keeps the warp kernel by construction.
The arithmetic contract was derived before the kernel (PORTING.md §18 in our rollout
repo, excerpt below): FP16 operands and an unspecified accumulation order put every
score within
of the float64 reference — and the tail block is bitwise the warp kernel's (the shared
tail kernel runs unchanged). No tolerance was moved at any point.
Parity suite (
src/kernels/qsa_select_wmma_parity.cpp, in the test suite): tworeferences (a float64 oracle and a warp-order host model pinned to the observed FMA
contraction), five cases — ragged query/block tiles, whole tiles, ×8 magnitude headroom
(near FP16 overflow), degenerate
n_kv=0, and one-hot/coordinate-coded adversarialfixtures that expose lane-duplication/transpose/store errors at zero tolerance. Plus: the
write set is exactly the warp kernel's (canary-asserted), selection IDs agree, and a
negative control (+2.5·B perturbation) fails the same checker. Measured bound
utilisation 0.0–11.0% worst case.
Bench (
qsa_select_bench, nq=256, median of 9 after 3 warmups) — scores only:Selection cells differing vs the warp arm: 0–0.009%.
To keep the numbers honest at both levels: the bench table is the scores kernel; the
whole
qsa selectphase (scores + selection/topk + the fp16 conversion + the batch loop)speeds up less — at 128K it drops 13,592 ms → 5,945 ms (~2.3×) on the measured e2e runs.
The kernel speedup is the arm; the phase speedup is what the prompt actually sees; the
end-to-end row below is what the request sees.
End-to-end, paired (frozen contract: 5 interleaved pairs × 2 slots per length,
order alternating per pair, the tuned AMD engine, prompt GPU timeline):
qsa select1 ms -> 1 ms - flat: the phase is a sliver of the timeline)Promotion gate: >=5% at 128K on the prompt GPU timeline, decode protected to 3%.
All three gates PASS -> PROMOTE (default flip earns its gates) on the complete contract
(10 pairs per length, exclusions declared in the record):
shared code between the arms, so the expectation is zero regression; the clean pairs read
wmma +2-3% faster, the interference-dipped pairs scatter both ways. The decision statistic is
the paired per-cell ratio median - the campaign's pre-declared drift-robust estimator, the one
gates 1 and 3 already use. For full transparency the record also carries the ratio-of-arm-medians
(0.937): on this bimodal decode distribution (5 clean / 5 interference-dipped cells) the arm
medians land in the distribution gap and flip with sampling order, so that variant is reported
but is not the decision statistic. The <=3% threshold itself never moved.
2. The AMD RX 7900 XTX (gfx1100) IQ3_S row in the rates tables
Prompt (tokens/s): collecting (the 1K-128K sweep record; 262K "-")
Output (tokens/s): collecting (the same runs)
(262K: "-", per the IQ3_S row's convention.)
Methodology follows
bench/results/2026-09-29-speed-0126: one-shotstrata generateruns, greedy, 256 generated tokens, the tuned AMD engine config. Every cell is a row in
artifacts/rocm/results/amd-rates-20260930.jsonwith its raw engine log kept.3.
verify: the profiler's stage columns stop lying (PORTING.md §19)Two integer-arithmetic defects made
STRATA_VERIFY_PROFILE's report print ~1e14ms/window for the "(gap)"/"head"/hc0 columns:
kProfPer = 32left the hc-read second half's up-stamp at slot 32 — the next layer'sstage-0 base stamp — corrupting the next layer's first delta.
kProfPeris now 33 and a delta counts only when both stamps are nonzero and monotonic.Metrics-only: no computed model value changes. The GPU-side attribution of the residual
(the no-doorbell verify-window floor for native packs) is recorded in our rollout repo.
What this is not
not promoted).
measured). Wider RDNA3/4 support is a per-SKU measurement, not a flag flip.
Evidence lives in the xyzzing/strata-amd rollout repo: PORTING.md 18/18.1/19,
record-qsa-select-wmma-parity-*.json,record-qsa-select-e2e-*.json,record-prepr-merge-audit-*.json,record-d8-stamp-fix-*.json,ab-qsa-select-20260930.json, and the D8 capture (baseline vs no-doorbell,STRATA_VERIFY_DEVICE_PLAN=1) that attributes the ~26 ms/window residual.Engine attribution (after the v0.1.29 merge)
The branch now includes
upstream/mainat v0.1.29 (merge0975f72); upstream's reviewedimplementation of the multi-query scorer (#187) supersedes the cherry-pick this PR was
originally stacked on. The two merge conflicts were comment-only in
qsa_select.cu(upstream's comments kept) and one informative comment in
CMakeLists.txt(ours kept);the merged tree builds 236/236.
The measurements above were produced by the pre-merge, engine-0.1.28-based build (the
campaign was mid-run on it); each record names its binary and engine. GPU parity
re-validation of the merged build is scheduled at the campaign's end and will be posted
here before this draft is marked ready.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.