mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #4119] [CLOSED] [Engine] Opt-in two-pass QSA prompt selection: 3xTF32 only near the top-k cut-off, the same cells (256K prompt read +5.2%) #4907
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#4907
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/4119
Author: @bitaccesscomau
Created: 10/25/2026
Status: ❌ Closed
Base:
main← Head:pr/qsa-two-pass📝 Commits (3)
b6b01f0qsa select: STRATA_SELECT_TWO_PASS scores prompt blocks in single-pass TF32 with a proven bound0e23327qsa select: a set STRATA_SELECT_TWO_PASS says once where the two-pass scorer cannot run; testa90d33cMerge branch 'main' into pr/qsa-two-pass📊 Changes
11 files changed (+1861 additions, -2 deletions)
View changed files
📝
CMakeLists.txt(+18 -0)📝
docs/DETAILS.md(+12 -0)📝
include/strata/kernels/qsa_select.hpp(+29 -0)➕
include/strata/kernels/qsa_two_pass.hpp(+141 -0)➕
include/strata/kernels/qsa_two_pass_status.hpp(+41 -0)📝
src/kernels/cuda/qsa_select.cu(+762 -0)➕
src/kernels/qsa_two_pass_parity.cpp(+224 -0)📝
src/prefill/prefill.cpp(+109 -2)📝
sycl/src/prefill/prefill.cpp(+3 -0)➕
tests/prefill/qsa_two_pass_status_test.cpp(+80 -0)➕
tests/prefill/qsa_two_pass_test.cpp(+442 -0)📄 Description
Problem and result
In an earlier profile a cold 256K prompt on an RTX 3090 spent about 13% of its read in the QSA selection
(
STRATA_PREFILL_TIMING=1, v0.2.4.1 with other settings:qsa select17.4 s of a 136.3 s GPU timeline), about 10 s ofit in the block scores. The prompt path's tensor-core scorer
qsa_block_scores_tc(sm_80+) computes every block score ofevery query in 3xTF32, 48 m16n8k8 MMAs per indexer head and block (a 256-query call at 256K takes 1.90 ms), although
only the blocks near each query's top-k cut-off need that precision.
With
STRATA_SELECT_TWO_PASS=1(off by default, read once), a prompt call scores every block once in single-pass TF32(16 MMAs per head), bounds per block how far that score can be from today's 3xTF32 score, and scores again, with
today's 3xTF32 arithmetic and bit for bit, only the blocks whose bound reaches the cut-off (on average 50 to 107 blocks
per query at 32K to 256K, 0.2% to 1.4% of the blocks).
qsa_block_topkthen returns exactly today's cells in today'sorder, ties included, so the answer does not change. With the variable unset the selection makes today's calls in
today's order.
Measured on v0.2.6 (
4b9e05a2,mainat the time) on one RTX 3090 at the release defaults, the same binary with theswitch off and on, 2 pairs of 2 runs: the 256K prompt read goes from 1,887 to 1,984 tokens/s (+5.2%; the four run ratios
are 1.047 to 1.055), 128K +2.2%, 32K +0.2% (0.994 to 1.009); decode stays within the spread of the runs (tier means
-1.0% to +0.4%). Output is byte-identical to that base at 1K, 32K, 128K and 256K with the switch off and on, and the
switch's own check finds 0 queries with other cells out of 1,523,556 at 128K and 3,046,896 at 256K. An earlier 4-pair
run on v0.2.4.1 with other settings gave +4.7% at 256K.
Rebased onto v0.2.8 (
870aedd9). Where the two-pass scorer cannot run (HIP, Metal and SYCL builds, a card below sm_80or
STRATA_QSA_WARP, the layer-major prompt path), a set switch now prints one line saying it is not used there,instead of nothing. On the rebased tree the replies are byte-identical to v0.2.8 at 1K to 128K with the switch unset and
set, and the switch's check finds 0 queries with other cells out of 1,330,020 at 128K; the timing above was not
repeated.
Related discussion
Scope proposal: #4118. Issues and pull requests, open and closed, were searched again for duplicates on 2026-10-25 and,
for the items filed since, on 2026-10-31,
including those filed since 2026-10-24 (
3xTF32,tf32,two-pass,rescore,re-score,block scores,qsa_block_scores,qsa select,single-pass,error bound,TWO_PASS,scorer,precision): none bounds thesingle-pass scores and scores again only near the cut-off.
qsa selectwas a third of a 565K read there; more key tiles per CTA (TC_ITER) and thequery tile's TF32 hi and lo parts in shared memory are among what did not help. This keeps the 3xTF32 kernel and
skips most of its work instead.
MMAs from the QSA scorer rather than running them faster.
qsa_select_bench): the 3xTF32 scorer's error against FP64. Every block that can reachthe cut-off is still scored in 3xTF32, bit for bit, so that floor does not change.
qsa_block_scores_tcruns.STRATA_SELECT_SPLIT2: the WMMA scorer without its lo pieces): a rounding-level change (253/256selections at 262K); this keeps the selection bitwise. HIP only.
STRATA_SELECT_LONG, onmainsince v0.2.7): decode windows, not the promptpath. Both append at the end of
qsa_select.hppandqsa_select.cu; the rebase keeps both blocks, #3820's first.mainsince v0.2.7 and on by default for a layer split): its walk callsqsa_block_scores_tcbut not the two-pass scorer, so the switch does nothing there; a set switch says so once.Running the two-pass scorer there is not part of this PR.
Merge-tested against all 474 open pull requests on 2026-10-31, on this revision: 473 tested (#4178's head could not be
fetched). The only conflict this branch adds is with #4283 (mine): its test target in
CMakeLists.txtand its paragraphin
docs/DETAILS.mdsit at the same place as this PR's; keep both.Approach
The bound. Per indexer head, with
qh = tf32(q),ql = tf32(q - qh),kh = tf32(k)andkl = tf32(k - kh)exactly as today's kernel splits them, the single-pass score misses the cross terms
qh.kl + ql.kh(bounded byCauchy-Schwarz), and both chains carry FP32 accumulation error: each MMA is taken to be within 16 FP32 ulps of the
absolute sum of its addends (a truncating alignment without guard bits gives at most 9). relu is 1-Lipschitz. Over the
four heads,
eps_b = |kl_b| P + |kh_b| Q + 2^-100, withPandQper query from the head norms. Norms andepsare rounded up and
[S1 - eps, S1 + eps]outwards. The derivation and the constants are ininclude/strata/kernels/qsa_two_pass.hpp.The cut-off rule (one CTA per query). Today's threshold
T, the width-th largest cell key, lies in[max(T1 - E, F), T1 + E], withT1the width-th largest single-pass key over the candidates,Ethe largestcandidate bound and
Fa sampled lower bound proven to be at mostT. Every block whose interval reaches that windowis scored again with
block_scores_tc_kernel's own arithmetic (the same splits, MMA order and tile position), so theblocks at
Thold today's bits and every other block lies strictly on the same side ofTas today: the threshold,the cells above it and the tied cells are today's. A query the rule cannot settle (no bound for some block, a full
list, too few cells above
F) has its 16-query tile scored again in full with today's kernel.Scope. Only
qsa_block_topkreadsm.sel_scores(kept blocks hold the single-pass score, so the row itself is nottoday's;
STRATA_IDX_FP16_CHECKoverwrites it with its own selection). Prompt path only (Prefill::run); decode andverify windows are untouched. CUDA sm_80+ under
qsa_block_scores_tc's dispatch rule (not withSTRATA_QSA_WARPorSTRATA_SELECT_OLD), for calls whose last query hasSTRATA_SELECT_TWO_PASS_MINblocks or more (default 4096, 16Kcells). The scratch (key norms, lists, flags: about 1.6 MB at 256K) is the start of
m.attn, which the attention writesafter the selection: nothing is allocated, and too little room means today's path. Both HIP builds
(
STRATA_ENABLE_HIP,STRATA_HIP_GFX906) compileqsa_select.cuas HIP: the new code is under#if !defined(__HIPCC__)and HIP gets stubs that return false (there is no TF32mma.sync). The Metal build compilesprefill.cpp, where the calls are under#if !defined(STRATA_GPU_METAL). SYCL builds its ownprefill.cppandqsa_select.dp.cppand sees only the new declarations inqsa_select.hpp.Diagnostics and tests. With the switch on the engine prints
qsa select: two-pass scores on ...once and one lineper prompt segment (
strata prefill: two-pass QSA select: ...). Where the scorer cannot run, a set switch prints oncestrata: STRATA_SELECT_TWO_PASS=1 is not used on <path>: ...; the selection is unchanged, naming HIP, Metal or SYCLbuilds,
this CUDA card or with STRATA_QSA_WARP(below sm_80, orSTRATA_QSA_WARP=1|select) or the layer-major promptpath; unset, nothing new is printed.
STRATA_SELECT_TWO_PASS_CHECK=1(slow) runs today's scorer and top-k beside it andprints the queries whose ids differ, the scored-again blocks that are not today's bits and the kept blocks outside their
bound.
tests/prefill/qsa_two_pass_test.cpp(no GPU) checks the TF32 split, the bound under a rounding and a truncatingMMA model, and the cut-off rule on 1,008 rows with ties and plateaus, with a negative control.
src/kernels/qsa_two_pass_parity.cpp(GPU, CUDA sm_80+; skipped elsewhere and on HIP) compares the ids with the 3xTF32scorer's at 2K to 256K.
tests/prefill/qsa_two_pass_status_test.cpp(no GPU) checks the request's parse (exactly1),that unset or supported paths print nothing, that each unsupported path prints its line once, and that on a layer split
over mixed cards a supported card neither uses up the line nor is turned off.
Validation
Revision
0e233278: this branch, two commits onupstream/main870aedd9(v0.2.8, engine 0.1.54). The first,b6b01f0c, is the change as reviewed (47b09c8d), rebased: its added and removed lines are identical, and the onlyconflict was the placement one with #3820. Between
4b9e05a2and870aedd9upstream changedqsa_select.cuandqsa_select.hpponly by #3820's appended block: the tensor-core scorer, its dispatch rule and the call site inprefill.cppare as measured. The second commit (0e233278) adds the "is not used" line and its test. Everything under"On v0.2.8" below was built and run on this revision; the timing was not repeated.
The earlier evidence: revision
47b09c8d, one commit on4b9e05a2(0.2.6). Everything under "On v0.2.6 and earlier"except its first item was measured and built on the branch's previous revision,
7f97e6fa, one commit on7dd5cf18(v0.2.4.2 and 6 commits that touch no engine, server or CMake file; base
7dd5cf18, built the same way). Between thetwo bases upstream changed none of the files this PR adds or edits except
CMakeLists.txt(merged without a conflict)and
docs/DETAILS.md(reorganised; the paragraph moved with it):qsa_select.cu,qsa_select.hpp,qsa_two_pass.hpp,prefill.cpp, both tests and the 13 lines added toCMakeLists.txtare byte-identical in the two revisions. The GPUruns used the change's first version
f6398ade;7f97e6fadiffers from it only indocs/DETAILS.md(these numbers)and in
qsa_two_pass_parity.cpp'smain(a HIP skip and_putenv_son Windows, both behind#if). With7f97e6fachecked out ninja finds no work in the engine, the test's CUDA preprocessor output is identical to the measured
version's, and the rebuilt test binary has the measured binary's SHA-256.
System (one machine; no claim for others):
11.8 to 11.9 GB/s host to device), driver 580.178.04, CUDA 13.0 (nvcc 13.0.88).
pinned to 16 physical cores and the GPU passed through; host RAM DDR4-2133 in four channels.
free -g), no swap, Ubuntu 24.04.5 LTS, kernel 6.8.0-146-generic, gcc 13.3.0, CMake 4.4.3,Ninja 1.13.2; model files on a virtual (QEMU) disk.
-DSTRATA_ENABLE_CUDA=ON -DSTRATA_BUILD_TESTS=OFF -DSTRATA_Q6K_EXPERTS=ON -DSTRATA_MMQ_KQUANTS=ON -DCMAKE_CUDA_ARCHITECTURES=86 -DCMAKE_CUDA_COMPILER=<cuda-13.0>/bin/nvcc -DCUDAToolkit_ROOT=<cuda-13.0> -DSTRATA_GGML_DIR=<llama.cpp 3cf03257>(setup's line for this card; the CMake cache equals the installed engine'sapart from the
STRATA_PLE_FIXTURE_DIRpath).serve/server.py --engine strata(unchanged by this PR) withstrata --serve --pack <pack> --native <gguf> --ple-gguf <gguf> --expert-profile data/expert-profile.bin --expert-cache auto --prefill auto --spec 4 --spec-min-p 0.5 --mtp <mtp dir> --max-context 262144 --kv int8 --kv-resident 32768; in the benchmark noSTRATA_*variable butthe switch. 10,320 expert slots and 23,738 MiB of VRAM in use at ready in every benchmark arm, switch on or off.
Passed:
On v0.2.8 (
0e233278, base870aedd9):870aedd9and at this head:cmake --build <build> --target strata strata_kqrc 0 (169 steps each), the same 256 warning lines, both
strata 0.1.54; the switch's name and the new line's text arein the head binary only. The test build (
-DSTRATA_BUILD_TESTS=ON): the 14 GPU-free tests of the first test blockplus
copy_events_testpass 15 of 15 on base, and withqsa_two_pass_testandqsa_two_pass_status_test17 of 17 onthe head.
qsa_two_pass_parity(withSTRATA_SELECT_TWO_PASS=1, as itsctest entry) passes (0 queries with other ids, 0 scored-again blocks off by a bit, 0 kept blocks outside the bound),
and
qsa_scores_parityandqsa_topk_active_paritypass.server and engine per arm (v0.2.8's
serve/server.py, unchanged by this PR), the deterministic lane(
STRATA_PREFILL_CPU_SHARE=0,--pcie-frac 0.32,--adapt-every 0) on top of this machine's settings(
STRATA_TOPK_SPLIT=1,STRATA_CKPT_POOL=1), temperature 0, thinking off, 64 tokens; 10,149 expert slots and 23,488MiB of VRAM in use at ready in every arm. Ten requests per arm: three tiny chats, prompts of 992, 1,720, 3,850, 31,473
and 126,970 tokens, and a 15,998-token read followed by a turn that reads 2,025 new tokens after 16,061 reused. The
reply's SHA-256 and the engine's
prompt N tokens = R reused + K readcounts are the same at every step for v0.2.8,the head with the switch unset, the head with
STRATA_SELECT_TWO_PASS=1, and v0.2.8 again (the control). The switchprinted
qsa select: two-pass scores on ...once and its per-segment line on the three reads with 4,096 blocks ormore (the follow-up turn, 32K and 128K: 84, 720 and 5,196 calls); the other arms printed neither.
STRATA_SELECT_TWO_PASS=1 STRATA_SELECT_TWO_PASS_CHECK=1, same lane: 0 queries with other ids outof 184,056 at 32K and 1,330,020 at 128K; 0 of 9,365,707 and 80,178,966 scored-again blocks not bitwise; 0 kept blocks
outside the bound; the largest
|S1 - S3|/ bound 0.17 and 0.19; replies equal to the switch-on arm.STRATA_SELECT_TWO_PASS=1 STRATA_QSA_WARP=1the engine printedstrata: STRATA_SELECT_TWO_PASS=1 is not used on this CUDA card or with STRATA_QSA_WARP: ...; the selection is unchangedonce,and no two-pass line, over a tiny chat and the 31,473-token read.
qsa_two_pass_status_teston macOS with Apple clang17 (
-Wall -Wextra): passes with no warning; with the once-only rule removed it fails (the line is printed once),and with the line removed it fails (
one line naming the path).Metal buildworkflow: base and headrc 0, the same 81 object files and the same 10 warnings.
out in the same tree and rebuilt (
ninja -k 0, every target).docs/AMD_HIP.md's line plus-DSTRATA_BUILD_TESTS=ON, inrocm/dev-ubuntu-24.04:7.14.1-full(HIP7.14.60850, AMD clang 23.0.0git): base rc 0 (469 steps), head rc 0 (100 steps rebuilt).
ctest -R qsa_two_pass:qsa_two_pass_testandqsa_two_pass_status_testpass.docs/AMD_HIP.md's line plus-DSTRATA_BUILD_TESTS=ON, same image: the same two tests pass andqsa_two_pass_parityis skipped (77). One target fails on base and head alike,src/core/dflash2.cpp, as on v0.2.6below.
strata-sycl-devrecipe (oneAPI DPC++ 2026.1.0, no AOT): base and headBUILD EXIT 0, 0 errors; the headrecompiles
qsa_select.dp.cpp,layer.cpp,verify.cppandsycl/src/prefill/prefill.cpp.hipError_tnodiscard warnings in
prefill.cppas on v0.2.6 (below), and on gfx906 the same 3 inqsa_two_pass_parity.cpp. Thereview follow-up adds none.
On v0.2.6 and earlier, as described above:
On revision
47b09c8d(base4b9e05a2, engine 0.1.51), the build line under System:strata strata_kqrc 0(166 steps; the switch's name is in the binary), and the test build with
-DSTRATA_BUILD_TESTS=ON(the 12 GPU-free unittests,
qsa_two_pass_testand the four GPU tests) rc 0, with the 13 GPU-free tests passing 13 of 13. Metal, theworkflow's steps as below: base
4b9e05a2and head rc 0, the same 75 object files and the same warnings.Builds. CUDA on the line above, targets
strata strata_kq: base and head rc 0, the same warnings (two existing onesin
qsa_select.cumove down one line).qsa_select.cufor the cuda13 package's architectures(
75-real;86-real;89-real;120-real;120-virtual, object only): rc 0. Metal on macOS 15.7.7 (Apple M3, Apple clang17.0.0), the steps of the
Metal buildworkflow (metal-cpp 26 at its pinned SHA-256, llama.cpp3cf03257,cmake -S metal -B build-metal -G Ninja -DCMAKE_BUILD_TYPE=Release ...thencmake --build build-metal --target strata): base and head rc 0, the same 75 object files and the same warnings.HIP and SYCL builds, compile only (x86-64 Linux containers, no AMD or Intel GPU): base
7dd5cf18built in full,then this commit checked out in the same tree and rebuilt (
ninja -k 0, every target; tests on for HIP).docs/AMD_HIP.md's line (-DSTRATA_ENABLE_HIP=ON -DSTRATA_ENABLE_CUDA=OFF -DCMAKE_HIP_ARCHITECTURES=gfx1100) plus-DSTRATA_BUILD_TESTS=ON, inrocm/dev-ubuntu-24.04:7.14.1-full(HIP7.14.60850, AMD clang 23.0.0git, gcc 13.3.0, CMake 3.28.3): base rc 0 (424 steps), head rc 0 (95 steps rebuilt,
among them
qsa_select.cu,prefill.cpp,layer.cpp,verify.cppand the QSA tools).ctest -R qsa_two_pass:qsa_two_pass_testpasses (this build does not register the GPU parity test).docs/AMD_HIP.md's line (-DSTRATA_HIP_GFX906=ON -DCMAKE_HIP_ARCHITECTURES=gfx906, ROCm clang as theC and C++ compiler) plus
-DSTRATA_BUILD_TESTS=ON, same image:qsa_select.cu,prefill.cppandqsa_two_pass_paritycompile and link, andqsa_two_pass_testpasses. One target fails on base and head alike:src/core/dflash2.cpp(cudaDeviceGetStreamPriorityRangeandcudaStreamCreateWithPriorityhave no mapping inthe gfx906 compat headers), so
stratadoes not link in this configuration onmaineither.strata-sycl-devrecipe (docker build --pull -t strata-sycl-dev sycl/tools, thensycl/tools/build.shwithout AOT; oneAPI DPC++ 2026.1.0, CMake 4.2.3), configured with
STRATA_GGML_DIRat the pinned llama.cpp: thefour engine sources that include the changed
qsa_select.hpp(qsa_select.dp.cpp,layer.cpp,verify.cpp,prefill.cpp) compile. One target fails on base and head alike:src/kernels/cpu/iq_avx512.cpp(_pdep_u64requires the
bmi2target feature under this icpx), sostratadoes not link in this image onmaineither.hipError_tnodiscard warnings inprefill.cpp, at lines 3447 to 3449 (an uncheckedcudaStreamSynchronizeand twocudaFreeafterSTRATA_SELECT_TWO_PASS_CHECK's comparison, written like the file's other runtime calls: base already reports235 (wave32) and 227 (gfx906) of these in
prefill.cpp); on gfx906 also 3 inqsa_two_pass_parity.cpp(unchecked
cudaEventDestroy). No other new warning.GPU-free tests:
ctest -Rover the 12 GPU-free unit tests ofCMakeLists.txtplusqsa_two_pass_testin the testbuild of the same line with
-DSTRATA_BUILD_TESTS=ON: head 13 of 13, base 12 of 12.c++ -std=c++20 -O2 -Wall -Wextra -Iinclude tests/prefill/qsa_two_pass_test.cpp && ./a.outwith Apple clang 17:PASS, no warnings.
GPU tests on the RTX 3090 (
ctest -R <name> -V, each with its ownENVIRONMENT):qsa_two_pass_parity(30 runs: 15synthetic cases at 2K to 256K, two score-row strides; 0 queries with other ids, 0 scored-again blocks off by a bit,
0 kept blocks outside the bound, the largest
|S1 - S3| / eps0.41; one 256K call 1.898 ms with the 3xTF32 scorer,0.975 ms two-pass, the per-chunk key norms not included),
qsa_scores_parity,qsa_select_bench,qsa_select_bench_fp32_tiledandqsa_topk_active_parity: all pass.Default path byte-identical, and the switch output-preserving. Deterministic lane in every arm
(
STRATA_PREFILL_CPU_SHARE=0,--pcie-frac 0.32,--adapt-every 0), a fresh engine per arm, temperature 0, thinkingoff, 64 tokens, prompts of 992, 31,473, 126,970 and 253,915 tokens (slices of the repository's docs at v0.2.4.1, each
with a question at the end). The SHA-256 of each reply is the same for the base, the head with the switch unset and
the head with
STRATA_SELECT_TWO_PASS=1on all four prompts, and a second base arm (the control) matches on thefirst three. Of these arms only the switch-on one printed the two-pass line (720, 5,196 and 11,148 calls at 32K, 128K
and 256K; none at 1K, which is below the minimum).
Selection equality,
STRATA_SELECT_TWO_PASS=1 STRATA_SELECT_TWO_PASS_CHECK=1 STRATA_SELECT_TWO_PASS_MIN=0(everyprompt call two-pass), same lane, 8 tokens:
|S1 - S3|/ boundSpeed on
main, release defaults (above), the head binary with the switch off and on, one batch in the orderOFF ON ON OFF (pairs: arms 1 and 2, arms 4 and 3), a fresh engine per arm. Tiers: tiny (6 chats of 17 to 19 prompt
tokens, 64 tokens each) and filler prompts of 3,948, 32,091, 128,404 and 255,571 tokens with a unique nonce in every
repetition (2 runs each, 256 tokens, temperature 0, thinking off, 0 tokens reused). Engine-side numbers: prompt
tokens over the engine's prompt ms, the engine's decode tok/s.
The switch's code runs only in the prompt reads of 32K and longer (each switch-on arm printed its per-prompt line
for the two 32K, two 128K and two 256K prompts and nothing for the others; about 82, 98 and 106 blocks scored again
per query, 0 queries flagged). Decode and the tiny tier stay within the spread of the runs.
Every run of this batch
Tiny tier, engine prompt ms of the 6 chats (17 to 19 prompt tokens, 64 generated) and decode tok/s:
Unpaired prompt times from the identity arms above (deterministic lane, one run each, not a benchmark): 253,915 tokens
in 136,498 ms (base), 137,368 ms (switch unset) and 130,354 ms (switch on); 126,970 tokens in 62,982, 63,931 and
62,667 ms.
The earlier run: v0.2.4.1, 4 pairs, other settings
The same commit before the rebase, on v0.2.4.1 (
c33fa7ba, whose Qwen engine sources differ from7dd5cf18only inthe version number), measured on the same machine on 2026-10-24 with settings that are not the release defaults:
STRATA_TOPK_SPLIT=1,STRATA_CKPT_POOL=1,--conversation-cache-min-tokens 2048and--conversation-cache-mib 8192in both arms, the v0.2.4.1 server, two batches (OFF ON ON OFF, then ON OFF OFF ON), also a 1K tier and a sampled tier
(4K prompt, thinking on, temperature 1.0, 2 runs). Absolute numbers are not comparable with the table above (other
settings and server); compare the ratios. Per pair, ON / OFF (tiny TTFT: OFF / ON):
The switch does not run on the sampled prompt (it is below the minimum), and the two sampled runs inside one arm
differed by up to 30 tok/s there. 32K was 0.5% slower in that run and +0.2% in the run above.
Failed:
Not run:
qsa_two_pass_status_testand by compiling those builds, not by running an engine there; the layer-major line needs a layer split (two cards)
and was not run. On HIP the two-pass kernels are not compiled (the stubs return false), so
Prefill::runmakestoday's calls;
qsa_two_pass_parityreturns 77 underSTRATA_HIP_GFX906before any runtimecall (from reading the code: in the build container it could not start, because the image does not put the ROCm
runtime on the loader path).
_putenv_sthere, asqsa_topk_active_paritydoes);execution on any card but sm_86 (sm_75, sm_89 and sm_120 were compiled only; sm_75 has no two-pass path); a second
machine.
Task-quality or long-context recall checks (the check above shows the same selected cells, and the replies were
byte-identical).
Limits
the real prompts the largest
|S1 - S3|used 0.21 of the bound, on the synthetic GPU cases 0.41; the GPU-free test'sworst constructed case (q = k at the worst rounding) reaches 0.84 under a rounding MMA model.
against the spread of the scores) fall back to a full 3xTF32 re-score of their 16-query tile: exact, but slower than
today. No query was flagged on the real prompts here.
STRATA_SELECT_TWO_PASS_MIN(4096 blocks) nothing changes, and 32K is abouteven. The default minimum is not tuned. The top-k still reads the full row, so the select phase does not shrink by
the whole scoring cost.
a set switch says so once.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.