Skip to content

perf(hipblaslt): Correct gfx1201 HHS NN tile selection for large-M prefill GEMMs - #10222

Merged
fjankovi merged 1 commit into
developfrom
users/amd-maradosa/gfx1201-hhs-nn-logic-fix
Sep 1, 2026
Merged

fjankovi merged 1 commit into
developfrom
users/amd-maradosa/gfx1201-hhs-nn-logic-fix

Conversation

@amd-maradosa

@amd-maradosa amd-maradosa commented Jul 31, 2026 •

Copy link
Copy Markdown
Contributor

Motivation

Jira issue
JIRA ID: ROCM-21133

Several ExactLogic entries in the gfx1201 HHS NN (Ailk_Bljk) Bias+SAV logic file select MT16x16x32 / MT16x32x32 for M=4096 prefill shapes, while every neighbouring entry selects MT128x128x32. Because GridBasedMatching rounds up rather than picking the nearest neighbour (PropertyMatching.hpp: entryM >= queryM && entryN >= queryN), one bad entry becomes the mandatory target for a whole query range. The file also had no entries at K=14336, so Llama-3-8B down_proj shapes fell through to unrelated neighbours

Effect: these GEMMs ran at ~5% of peak on gfx1201.

Technical Details

Data-only change to one logic file: 6 entries repointed, 11 added. All reference solutions already present in the file — no kernel codegen changes, solution count unchanged (517), no entries removed.

Test Plan

  • hipblaslt-test --gtest_filter='*quick*:*smoke*' against the rebuilt gfx1201 device library, to confirm no existing kernel selection is broken.
  • hipblaslt-bench on gfx1201, HHS NN + bias + scaleAlphaVec, --rotating 1024, with --print_kernel_info to verify the selected tile.
  • End-to-end: vLLM 0.21 Llama-3-8B-Instruct-GPTQ latency (tp1, fp16, out=32, mp executor).

Test Result

hipblaslt-test: 21698 tests, 21698 passed, 0 failed.

hipblaslt-bench:

M=4096 N=2048 K=4096 MT16x16x32 11.8 TFLOP/s -> MT128x128x32 140.3 TFLOP/s
M=4096 N=2048 K=14336 MT16x16x32 7.6 TFLOP/s -> MT128x128x32 122.6 TFLOP/s

vLLM latency:

  • bs1 in2048 1.934 s -> 0.783 s
  • bs2 in2048 3.475 s -> 1.152 s
  • bs4 in2048 3.032 s -> 1.836 s

@therock-pr-bot

therock-pr-bot Bot commented Jul 31, 2026 •

Copy link
Copy Markdown

✅ All Checks Passed — Ready for Review

Check Status Details
📝 PR Description ✅ Pass —
⛔ Forbidden Files ✅ Pass —
🧪 Unit Test ✅ Pass PR does not contain code files — Unit Test auto-passed
🔎 pre-commit ✅ Pass —
🚫 Draft PR 🔜 To Be Enabled —
🚩 Feature Flag 🔜 To Be Enabled —
📊 Code Coverage 🔜 To Be Enabled —
🤖 therock-pr-bot ✅ Pass —

🎉 All checks passed! This PR is ready for review.

📖 Need help? See the Policy FAQ for details on every check and how to fix failures.

🙋 Wish to Override Policy?

@therock-pr-bot

therock-pr-bot Bot commented Jul 31, 2026 •

Copy link
Copy Markdown

🎉 All checks passed! This PR is ready for review.

@amd-maradosa
amd-maradosa marked this pull request as ready for review July 31, 2026 14:10
@amd-maradosa
amd-maradosa requested a review from a team as a code owner July 31, 2026 14:10
@codecov

codecov Bot commented Jul 31, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop   #10222   +/-   ##
========================================
  Coverage    69.77%   69.77%           
========================================
  Files         2810     2810           
  Lines       463930   463930           
  Branches     68433    68433           
========================================
  Hits        323682   323682           
  Misses      116804   116804           
  Partials     23444    23444           
Flag Coverage Δ *Carryforward flag
TensileLite-CPP 38.33% <ø> (ø)
TensileLite-Unit 76.24% <ø> (ø)
hipBLAS 90.62% <ø> (ø) Carriedforward from 99180e7
hipBLASLt 35.22% <ø> (ø)
hipCUB 82.68% <ø> (ø) Carriedforward from 99180e7
hipDNN 86.84% <ø> (ø) Carriedforward from 99180e7
hipFFT 43.77% <ø> (ø) Carriedforward from 99180e7
hipRAND 76.12% <ø> (ø) Carriedforward from 99180e7
hipSOLVER 69.03% <ø> (ø) Carriedforward from 99180e7
hipSPARSE 86.99% <ø> (ø) Carriedforward from 99180e7
rocBLAS 48.26% <ø> (ø) Carriedforward from 99180e7
rocFFT 52.11% <ø> (ø) Carriedforward from 99180e7
rocRAND 56.91% <ø> (ø) Carriedforward from 99180e7
rocSOLVER 77.32% <ø> (ø) Carriedforward from 99180e7
rocSPARSE 74.60% <ø> (ø) Carriedforward from 99180e7
rocThrust 91.60% <ø> (ø) Carriedforward from 99180e7

*This pull request uses carry forward flags. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

Copy link
Copy Markdown
Contributor

This pull request has been inactive for 25 days and will be marked as stale.

If you would like to keep this PR open, please:

  • Add new commits
  • Add a comment explaining why it should remain open

This PR will be automatically closed in 5 days if no further activity occurs.

@github-actions github-actions Bot added the Stale PR has no activity for 25+ days label Aug 26, 2026
@fjankovi
fjankovi requested a review from vuksan314 August 27, 2026 12:01
@amd-maradosa amd-maradosa changed the title Correct gfx1201 HHS NN tile selection for large-M prefill GEMMs perf(hipblaslt): Correct gfx1201 HHS NN tile selection for large-M prefill GEMMs Aug 27, 2026
@amd-maradosa
amd-maradosa force-pushed the users/amd-maradosa/gfx1201-hhs-nn-logic-fix branch from 2e86444 to a167300 Compare August 27, 2026 12:02
@github-actions github-actions Bot removed the Stale PR has no activity for 25+ days label Aug 28, 2026
@fjankovi
fjankovi merged commit a46aec8 into develop Sep 1, 2026
133 of 141 checks passed
@fjankovi
fjankovi deleted the users/amd-maradosa/gfx1201-hhs-nn-logic-fix branch September 1, 2026 06:42
assistant-librarian Bot pushed a commit to ROCm/hipBLASLt that referenced this pull request Sep 1, 2026
perf(hipblaslt): Correct gfx1201 HHS NN tile selection for
 large-M prefill GEMMs (#10222)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

## Motivation
[Jira issue](https://amd-hub.atlassian.net/browse/ROCM-21133)
JIRA ID: ROCM-21133

Several ExactLogic entries in the gfx1201 HHS NN (`Ailk_Bljk`) Bias+SAV
logic file select `MT16x16x32` / `MT16x32x32` for M=4096 prefill shapes,
while every neighbouring entry selects `MT128x128x32`. Because
`GridBasedMatching` rounds *up* rather than picking the nearest
neighbour (`PropertyMatching.hpp`: `entryM >= queryM && entryN >=
queryN`), one bad entry becomes the mandatory target for a whole query
range. The file also had no entries at K=14336, so Llama-3-8B
`down_proj` shapes fell through to unrelated neighbours

Effect: these GEMMs ran at ~5% of peak on gfx1201.

## Technical Details

Data-only change to one logic file: 6 entries repointed, 11 added. All
reference solutions already present in the file — no kernel codegen
changes, solution count unchanged (517), no entries removed.

## Test Plan

- `hipblaslt-test --gtest_filter='*quick*:*smoke*'` against the rebuilt
gfx1201 device library, to confirm no existing kernel selection is
broken.
- `hipblaslt-bench` on gfx1201, HHS NN + bias + scaleAlphaVec,
`--rotating 1024`, with `--print_kernel_info` to verify the selected
tile.
- End-to-end: vLLM 0.21 Llama-3-8B-Instruct-GPTQ latency (tp1, fp16,
out=32, mp executor).

## Test Result

hipblaslt-test: **21698 tests, 21698 passed, 0 failed.**

hipblaslt-bench:

M=4096 N=2048 K=4096 MT16x16x32 11.8 TFLOP/s -> MT128x128x32 140.3
TFLOP/s
M=4096 N=2048 K=14336 MT16x16x32 7.6 TFLOP/s -> MT128x128x32 122.6
TFLOP/s

vLLM latency:

- bs1 in2048   1.934 s -> 0.783 s
- bs2 in2048   3.475 s -> 1.152 s
- bs4 in2048   3.032 s -> 1.836 s

Co-authored-by: Marko Radosavljevic <276607479+amd-maradosa@users.noreply.github.com>
@assistant-librarian

Copy link
Copy Markdown
Contributor

TheRock Submodule Bump Activity

Newest first

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants