mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #3164] [CLOSED] [Engine] hip: STRATA_SELECT_GRID=2 - the selection scorer's CTA order swaps for L2 (bitwise identical) #4487
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#4487
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/3164
Author: @vlupilin
Created: 10/19/2026
Status: ❌ Closed
Base:
main← Head:pr-grid-swap📝 Commits (1)
5b2de23hip: STRATA_SELECT_GRID=2 - the selection scorer's CTA order swaps for L2 (bitwise identical)📊 Changes
1 file changed (+26 additions, -4 deletions)
View changed files
📝
src/kernels/cuda/qsa_select.cu(+26 -4)📄 Description
Problem and result
The WMMA scorer CTA order puts all key tiles of query-tile 0 first: each of 16 query-tiles re-reads the pooled key array from DRAM because L2 (8 MiB) cannot hold it. With
STRATA_SELECT_GRID=2the grid dimensions swap so CTAs sharing a key tile run together and L2 holds it for all of them. Output is bitwise identical (only the scheduling order of independent CTAs moves).Approach
Template parameter
bool XQmapping blockIdx to query/block tiles; opt-in envSTRATA_SELECT_GRID=0|1|2with adaptive thresholdSTRATA_SELECT_GRID_MIN(default 8192 blocks). Default 0 = unchanged. One file:src/kernels/cuda/qsa_select.cu(+26/-4).Validation
Passed:
Kernel benchmark (both arms same session, 5 reps, v0.2.0-beta @
4caf857c, gfx1151 Radeon 8060S Strix Halo, ROCm 10.1, Linux 7.0.0-38-generic):Engine (interleaved 2 rounds, grid measured alone):
Bitwise identical ids: verified 256/256 at all depths (qsa_select_bench gate).
Failed: none.
Not run: CUDA (kernel is HIP-only); gfx12 (maintainer R9700 can verify); shallow-context regression check below 8192 blocks (the adaptive threshold prevents the swap there).
Limits
HIP only; requires
STRATA_SELECT_WMMA=1; the engine effect is depth-dependent (bigger at 512K+ where the selection cost is highest).🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.