[PR #1743] [CLOSED] Gfx906 qsa fit17 #3643

Closed
opened 2026-11-07 15:29:45 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/1743
Author: @0FL01
Created: 10/9/2026
Status: ❌ Closed

Base: main ← Head: gfx906-qsa-fit17


📝 Commits (3)

  • fc23f47 perf(gfx906): guard decode register top-k by live context
  • ca35331 test: record isolated gfx906 guarded top-k qualification
  • 6868ebd gfx906: specialize guarded QSA top-k for 17-key windows

📊 Changes

10 files changed (+1908 additions, -11 deletions)

View changed files

📝 CMakeLists.txt (+5 -0)
➕ bench/results/2026-10-08-gfx906-guarded-topk/README.md (+84 -0)
➕ bench/results/2026-10-08-gfx906-guarded-topk/component-checks.json (+1070 -0)
➕ bench/results/2026-10-08-gfx906-guarded-topk/model-analysis.json (+318 -0)
➕ bench/results/2026-10-09-gfx906-fit17/README.md (+45 -0)
➕ bench/results/2026-10-09-gfx906-fit17/check_guard.py (+23 -0)
➕ bench/results/2026-10-09-gfx906-fit17/isa-resource-proof.json (+61 -0)
➕ bench/results/2026-10-09-gfx906-fit17/results.json (+160 -0)
📝 src/kernels/cuda/qsa_select.cu (+74 -4)
📝 src/kernels/qsa_topk_parity.cpp (+68 -7)

📄 Description

Implementation: 6868ebdfbd13daf3c5fcd6106c15feccc1419d22.

Review the incremental diff against ca353315. This is a stacked follow-up to PR #1535; its dependency remains part of the upstream-main comparison until integrated. This file is the prepared PR description, not a newly created upstream PR.

Title: gfx906: right-size guarded QSA top-k to 17 keys near 64K

Depends on #1535 (currently unmerged); this branch starts at its ca353315 head. The incremental change can be reviewed against that branch. It does not depend on query-swizzle or reduce12.

Summary

Add default-off STRATA_GFX906_TOPK_FIT17=1 to the guarded STRATA_GFX906_TOPK_REG=2 route. The exact existing selector uses 17 slots per thread when all current device rows fit 17,408 blocks; larger windows keep register66. The reference short-context guard and all existing fallbacks remain. No selection arithmetic or output ordering changes.

The scalar bound includes 69,631 cells; 69,632 needs another slot even with an empty tail. Device-side max across at most eight rows supports unsorted batches and graph growth/restores. Optional trace reports enabled topology only.

Validation

Public selector TU/header build, directly linked without a private support archive: 46 correctness and 8 component ABBA processes passed on both gfx906 cards. Public default-off kernels match the public base; actual device instructions and resources match the separately qualified integration selector. Component latency decreased 25.73%/26.06%. The original 30% engineering screen remains negative.

Separate integration-binary model ABBA: +1.41% TG with suffix disabled and exact IDs/counters; +1.30% on the ordinary adaptive profile with exact IDs/topology, while second-pair draft/cache counters differed and are disclosed. These are not full-public-engine measurements or constant-workload attribution for the adaptive result.

Scalar scratch falls from 1,048 to 56 bytes/lane. The wide fallback still has 1,048 bytes scratch and +12/+1 SGPR/VGPR spills versus the original route, plus extra guard/launch work. CUDA/non-gfx906 runtime and broad model coverage are not claimed.

See implementation report for exact bounds, raw component medians, model scope, provenance and limitations.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/1743 **Author:** [@0FL01](https://github.com/0FL01) **Created:** 10/9/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `gfx906-qsa-fit17` --- ### 📝 Commits (3) - [`fc23f47`](https://github.com/Niko1221/Strata/commit/fc23f47512191df7b5f380d7896ecccf1b0619ab) perf(gfx906): guard decode register top-k by live context - [`ca35331`](https://github.com/Niko1221/Strata/commit/ca3533157d066a13b128f3daa61f56411dcf3155) test: record isolated gfx906 guarded top-k qualification - [`6868ebd`](https://github.com/Niko1221/Strata/commit/6868ebdfbd13daf3c5fcd6106c15feccc1419d22) gfx906: specialize guarded QSA top-k for 17-key windows ### 📊 Changes **10 files changed** (+1908 additions, -11 deletions) <details> <summary>View changed files</summary> 📝 `CMakeLists.txt` (+5 -0) ➕ `bench/results/2026-10-08-gfx906-guarded-topk/README.md` (+84 -0) ➕ `bench/results/2026-10-08-gfx906-guarded-topk/component-checks.json` (+1070 -0) ➕ `bench/results/2026-10-08-gfx906-guarded-topk/model-analysis.json` (+318 -0) ➕ `bench/results/2026-10-09-gfx906-fit17/README.md` (+45 -0) ➕ `bench/results/2026-10-09-gfx906-fit17/check_guard.py` (+23 -0) ➕ `bench/results/2026-10-09-gfx906-fit17/isa-resource-proof.json` (+61 -0) ➕ `bench/results/2026-10-09-gfx906-fit17/results.json` (+160 -0) 📝 `src/kernels/cuda/qsa_select.cu` (+74 -4) 📝 `src/kernels/qsa_topk_parity.cpp` (+68 -7) </details> ### 📄 Description Implementation: [6868ebdfbd13daf3c5fcd6106c15feccc1419d22](https://github.com/0FL01/Strata/commit/6868ebdfbd13daf3c5fcd6106c15feccc1419d22). Review the [incremental diff against ca353315](https://github.com/0FL01/Strata/compare/ca3533157d066a13b128f3daa61f56411dcf3155...6868ebdfbd13daf3c5fcd6106c15feccc1419d22). This is a stacked follow-up to [PR #1535](https://github.com/Niko1221/Strata/pull/1535); its dependency remains part of the upstream-main comparison until integrated. This file is the prepared PR description, not a newly created upstream PR. Title: gfx906: right-size guarded QSA top-k to 17 keys near 64K Depends on #1535 (currently unmerged); this branch starts at its ca353315 head. The incremental change can be reviewed against that branch. It does not depend on query-swizzle or reduce12. ## Summary Add default-off STRATA_GFX906_TOPK_FIT17=1 to the guarded STRATA_GFX906_TOPK_REG=2 route. The exact existing selector uses 17 slots per thread when all current device rows fit 17,408 blocks; larger windows keep register66. The reference short-context guard and all existing fallbacks remain. No selection arithmetic or output ordering changes. The scalar bound includes 69,631 cells; 69,632 needs another slot even with an empty tail. Device-side max across at most eight rows supports unsorted batches and graph growth/restores. Optional trace reports enabled topology only. ## Validation Public selector TU/header build, directly linked without a private support archive: 46 correctness and 8 component ABBA processes passed on both gfx906 cards. Public default-off kernels match the public base; actual device instructions and resources match the separately qualified integration selector. Component latency decreased 25.73%/26.06%. The original 30% engineering screen remains negative. Separate integration-binary model ABBA: +1.41% TG with suffix disabled and exact IDs/counters; +1.30% on the ordinary adaptive profile with exact IDs/topology, while second-pair draft/cache counters differed and are disclosed. These are not full-public-engine measurements or constant-workload attribution for the adaptive result. Scalar scratch falls from 1,048 to 56 bytes/lane. The wide fallback still has 1,048 bytes scratch and +12/+1 SGPR/VGPR spills versus the original route, plus extra guard/launch work. CUDA/non-gfx906 runtime and broad model coverage are not claimed. See [implementation report](https://github.com/0FL01/Strata/blob/6868ebdfbd13daf3c5fcd6106c15feccc1419d22/bench/results/2026-10-09-gfx906-fit17/README.md) for exact bounds, raw component medians, model scope, provenance and limitations. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 15:29:45 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#3643
No description provided.