mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #2016] [CLOSED] qsa top-k: the register kernel's radix digit by a cooperative scan (same ids); gfx1151 takes it from 16K cells #3809
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#3809
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/2016
Author: @libratechw
Created: 10/12/2026
Status: ❌ Closed
Base:
main← Head:pr/qsa-topk-scan📝 Commits (2)
5125ed0qsa top-k: the register kernel's radix digit by a cooperative scan (same ids)11e3fc9qsa top-k: the register kernel from 16K cells of context on gfx1151 (STRATA_TOPK_REG_MIN_BLOCKS, gfx1151's table sets 4096)📊 Changes
4 files changed (+34 additions, -8 deletions)
View changed files
📝
CMakeLists.txt(+3 -0)📝
docs/STRIX_HALO.md(+1 -0)📝
src/core/arch_defaults.cpp(+1 -0)📝
src/kernels/cuda/qsa_select.cu(+29 -8)📄 Description
Title
Issue: none
Summary
block_topk_reg_kernel, the QSA block top-k on CUDA and HIP, picked each radix digit with thread 0 walking up to 255 binswhile the other threads waited. Threads 0-255 now prefix-sum the bins; the digit and the count above it are the same, so the
selected ids are the same. With the faster kernel, gfx1151 gains from it on shorter prompt batches too, so the HIP line below
which a batch takes the original kernel becomes
STRATA_TOPK_REG_MIN_BLOCKS(default 7168, as before) and gfx1151's tablesets 4096.
What changed
src/kernels/cuda/qsa_select.cu: the cooperative digit scan (first commit, CUDA and HIP); the HIP dispatch readsSTRATA_TOPK_REG_MIN_BLOCKS(second commit).src/core/arch_defaults.cpp: gfx1151 setsSTRATA_TOPK_REG_MIN_BLOCKS=4096.docs/STRIX_HALO.md: its row.CMakeLists.txt: ctestqsa_topk_parity_reg_always, the self-test with the line at 0.Ryzen AI Max+ 395 (gfx1151, ROCm 7.14.1), on
296b59d2,qsa_topk_parity <cells> 2048 10 131072 1(a prompt batch), ms percall, median of 3. The tool does not apply the architecture table, so the last column sets the variable:
296b59d2STRATA_TOPK_REG_MIN_BLOCKS=4096At 16K and 24K the first two columns are the original kernel, which this branch does not change. 4K and 8K stay at 0.37 and
0.41. The ids match the reference in every run (continuous, 64 levels, equal scores), with and without the variable.
Builds and tests on this branch:
qsa_topk_parity_reg_alwaysamong them), 5 skip, and the same three fail as on296b59d2(ple_parity,expert_parity,pool_test).strata_kernels,strata_prefillandstrata_mmqcompile for gfx1012, gfx1030, gfx1100, gfx1103, gfx1150, gfx1151,gfx1200 and gfx1201.
ple_parityfails as on296b59d2.(
pool_affinity_test, a CPU-only test, fails now and then on this machine: 1 of 10 runs alone here, 3 of 20 on296b59d2.)Not run: the kernel on other AMD cards (their line stays at 7,168 blocks), CUDA timings, and end to end.
🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.