[PR #1167] [CLOSED] hip: a rocBLAS solution table for the FP16 prompt GEMMs on gfx103x (the GDN projection 7x below 1,152 tokens; short prompts -10 to -14%) #3281

Closed
opened 2026-11-07 14:40:20 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/1167
Author: @Vop3p
Created: 10/6/2026
Status: ❌ Closed

Base: main ← Head: v140/hip-rocblas-tuning


📝 Commits (2)

  • 2278cce hip: a rocBLAS solution table for the FP16 prompt GEMMs on gfx103x (the GDN projection 7x below 1,152 tokens; short prompts -10 to -14%)
  • db64983 rocBLAS table docs: the shipped gfx1030 table was measured on an RX 6900 XT; other gfx1030 cards can make their own with tune_rocblas (reports welcome)

📊 Changes

14 files changed (+1309 additions, -6 deletions)

View changed files

📝 CMakeLists.txt (+20 -0)
➕ bench/results/2026-10-05-rdna2-rocblas-table/README.md (+80 -0)
➕ bench/results/2026-10-05-rdna2-rocblas-table/timing-off.txt (+9 -0)
➕ bench/results/2026-10-05-rdna2-rocblas-table/timing-on.txt (+9 -0)
➕ bench/results/2026-10-05-rdna2-rocblas-table/tune-summary.txt (+226 -0)
📝 cmake/hip_backend.cmake (+9 -0)
📝 docs/AMD_HIP.md (+53 -1)
📝 include/strata/prefill/gemm.hpp (+1 -0)
📝 setup.py (+9 -1)
📝 src/prefill/gemm.cu (+160 -4)
➕ src/prefill/rocblas_tuning.hpp (+129 -0)
➕ tests/hip/prefill_rocblas_gemm.cpp (+206 -0)
➕ tools/hip/gfx1030-rocblas-5.6.0.8d1ae90e.txt (+117 -0)
➕ tools/hip/tune_rocblas.cpp (+281 -0)

📄 Description

Re-filed from #981 (closed with the history rewrite) as the one commit on top of #835, which is in 0.1.40.1. The table serves the STRATA_HIP_PROMPT_F16=1 route; with it off nothing runs through it. In f16_inplace the table's kernel is tried first, cublasGemmEx otherwise, and the review's STRATA_DBG_NAN count follows either. The tool (tools/hip/tune_rocblas), the table format and the engine route are described in #981; the table file is the one measured there (tools/hip/gfx1030-rocblas-5.6.0.8d1ae90e.txt).

Measured on 0.1.40.1 (82f46a8 + this commit; RX 6900 XT, one card, ROCm 10.0.0 / rocBLAS 5.6.0.8d1ae90e; STRATA_HIP_PROMPT_F16=1 STRATA_SH_STREAM=1, --kv int8 --kv-resident 32768 --max-context 131072 --spec 4; the #884 GFXOFF workaround in place, which does not change speed):

  • hip_prefill_rocblas_gemm (ctest, STRATA_ROCBLAS_TUNING=tools/hip): PASS - rocBLAS tuning enabled (112 rows, 76 with a solution, gfx1030, rocBLAS 5.6.0.8d1ae90e), 4 cases within FP16 rounding of hipBLASEx, tuned_launches=4 fallbacks=0. On 0.1.40.1 the test needs STRATA_HIP_PROMPT_F16=1 as well, since the FP16 route is opt-in now; without it the test skips.
  • A/B: table on and off alternated, four cold server starts each (eight in all), each start reading three different text slices per length (no prompt-cache hits), max_tokens 8, temperature 0: 12 pairs per length, the same slice in each pair. Prompt read speed from the engine's own line:
prompt tokens pairs table off, median (range) table on, median (range) gain per pair, median (min..max)
435-540 12 60 tok/s (56-65) 60 (56-65) -0.2% (-0.5..+0.2) - below --short-read 640 the prompt is read token by token, no prompt GEMMs
833-1,084 12 261 (233-281) 292 (264-321) +13.3% (-1.9..+15.4; the -1.9 is the 1,084-token slice, next to the 1,152 bucket where rocBLAS's own choice is the fast kernel)
3,065-4,376 12 731 (670-752) 813 (743-839) +11.1% (+8.8..+12.7)
6,122-8,332 12 901 (770-928) 927 (797-956) +3.0% (+2.6..+3.8)

Decode is not touched (the table serves the prompt GEMMs only). The engine logs rocBLAS tuning enabled (...) when the table is read, so an arm's state is visible in its log.

Developed with an AI coding assistant; every number above was measured on 2x RX 6900 XT (gfx1030, PCIe 4.0 x8 each) / Ryzen 5 5600X, ROCm 10.0.


🔄 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/1167 **Author:** [@Vop3p](https://github.com/Vop3p) **Created:** 10/6/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `v140/hip-rocblas-tuning` --- ### 📝 Commits (2) - [`2278cce`](https://github.com/Niko1221/Strata/commit/2278cce41aa2fbb0ac21a1a03ff7f152de5a47ed) hip: a rocBLAS solution table for the FP16 prompt GEMMs on gfx103x (the GDN projection 7x below 1,152 tokens; short prompts -10 to -14%) - [`db64983`](https://github.com/Niko1221/Strata/commit/db649832497b3845ec0566d34456db8815cf4103) rocBLAS table docs: the shipped gfx1030 table was measured on an RX 6900 XT; other gfx1030 cards can make their own with tune_rocblas (reports welcome) ### 📊 Changes **14 files changed** (+1309 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `CMakeLists.txt` (+20 -0) ➕ `bench/results/2026-10-05-rdna2-rocblas-table/README.md` (+80 -0) ➕ `bench/results/2026-10-05-rdna2-rocblas-table/timing-off.txt` (+9 -0) ➕ `bench/results/2026-10-05-rdna2-rocblas-table/timing-on.txt` (+9 -0) ➕ `bench/results/2026-10-05-rdna2-rocblas-table/tune-summary.txt` (+226 -0) 📝 `cmake/hip_backend.cmake` (+9 -0) 📝 `docs/AMD_HIP.md` (+53 -1) 📝 `include/strata/prefill/gemm.hpp` (+1 -0) 📝 `setup.py` (+9 -1) 📝 `src/prefill/gemm.cu` (+160 -4) ➕ `src/prefill/rocblas_tuning.hpp` (+129 -0) ➕ `tests/hip/prefill_rocblas_gemm.cpp` (+206 -0) ➕ `tools/hip/gfx1030-rocblas-5.6.0.8d1ae90e.txt` (+117 -0) ➕ `tools/hip/tune_rocblas.cpp` (+281 -0) </details> ### 📄 Description Re-filed from #981 (closed with the history rewrite) as the one commit on top of #835, which is in 0.1.40.1. The table serves the `STRATA_HIP_PROMPT_F16=1` route; with it off nothing runs through it. In `f16_inplace` the table's kernel is tried first, `cublasGemmEx` otherwise, and the review's `STRATA_DBG_NAN` count follows either. The tool (`tools/hip/tune_rocblas`), the table format and the engine route are described in #981; the table file is the one measured there (`tools/hip/gfx1030-rocblas-5.6.0.8d1ae90e.txt`). **Measured on 0.1.40.1** (`82f46a8` + this commit; RX 6900 XT, one card, ROCm 10.0.0 / rocBLAS 5.6.0.8d1ae90e; `STRATA_HIP_PROMPT_F16=1 STRATA_SH_STREAM=1`, `--kv int8 --kv-resident 32768 --max-context 131072 --spec 4`; the #884 GFXOFF workaround in place, which does not change speed): - `hip_prefill_rocblas_gemm` (ctest, `STRATA_ROCBLAS_TUNING=tools/hip`): PASS - `rocBLAS tuning enabled (112 rows, 76 with a solution, gfx1030, rocBLAS 5.6.0.8d1ae90e)`, 4 cases within FP16 rounding of hipBLASEx, `tuned_launches=4 fallbacks=0`. On 0.1.40.1 the test needs `STRATA_HIP_PROMPT_F16=1` as well, since the FP16 route is opt-in now; without it the test skips. - A/B: table on and off alternated, four cold server starts each (eight in all), each start reading three different text slices per length (no prompt-cache hits), `max_tokens` 8, temperature 0: 12 pairs per length, the same slice in each pair. Prompt read speed from the engine's own line: | prompt tokens | pairs | table off, median (range) | table on, median (range) | gain per pair, median (min..max) | | --- | ---: | ---: | ---: | ---: | | 435-540 | 12 | 60 tok/s (56-65) | 60 (56-65) | -0.2% (-0.5..+0.2) - below `--short-read 640` the prompt is read token by token, no prompt GEMMs | | 833-1,084 | 12 | 261 (233-281) | **292 (264-321)** | **+13.3%** (-1.9..+15.4; the -1.9 is the 1,084-token slice, next to the 1,152 bucket where rocBLAS's own choice is the fast kernel) | | 3,065-4,376 | 12 | 731 (670-752) | **813 (743-839)** | **+11.1%** (+8.8..+12.7) | | 6,122-8,332 | 12 | 901 (770-928) | 927 (797-956) | +3.0% (+2.6..+3.8) | Decode is not touched (the table serves the prompt GEMMs only). The engine logs `rocBLAS tuning enabled (...)` when the table is read, so an arm's state is visible in its log. Developed with an AI coding assistant; every number above was measured on 2x RX 6900 XT (gfx1030, PCIe 4.0 x8 each) / Ryzen 5 5600X, ROCm 10.0. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 14:40:20 +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#3281
No description provided.