Skip to content

fix(tensilelite): fix TDM pointer-array batch handling - #11334

Merged
ThanHenderson merged 10 commits into
developfrom
users/nhenders/fix-tdm-general-batched
Sep 4, 2026
Merged

ThanHenderson merged 10 commits into
developfrom
users/nhenders/fix-tdm-general-batched

Conversation

@ThanHenderson

@ThanHenderson ThanHenderson commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

JIRA ID : AIHPBLAS-4515, AIHPBLAS-4770
AIHPBLAS-4770

Motivation

ArgType 3 supplies A and B as pointer arrays. TDM loads the selected batch matrix, then applies tile offsets to that matrix base. A/B strided-batch WG2 offsets are suppressed after the pointer-array load.

Technical Details

  • Dereference the selected A and B batch pointers before applying TDM tile offsets on classic and subtile paths.
  • Suppress strided-batch offsets after selecting a pointer-array matrix base, and only for A/B.
  • Wait after the conventional A/B pointer-array SRD load before reusing that temp for batchOffset (gfx1250 XNACK replay).
  • Route pointer tables into output-conversion C/D.
  • Initialize non-wave-separated TDM descriptors before applying their global offsets.
  • Add standalone-client BatchMode plumbing for the pointer-array ABI.
  • Add gfx1250 runtime regressions for GSU1/GSU2, static SK3/SK5, and subtile TDM, sweeping SIA 0 and 4.

Test Plan

  • Characterization: r3 datamover, StreamK TDM SGPR-budget, ClientConfigIni.
  • tdm_general_batched_gfx1250.yaml: non-StreamK pointer-array TDM, SIA 0 and 4.
  • sk_tdm_general_batched.yaml: SK {3,4,5} x SIA {0,4} x hybrid {0,1}, BatchMode 1.
  • sk_tdm_subtile_general_batched.yaml: subtile SK3, SIA 0 and 4.
  • Rebuild gfx1250 device lib / hipBLASLt gtest; nightly general-batched BF16.
  • tox on gfx1250

Test Results

  • Characterization tests listed above passed.
  • Non-StreamK pointer-array TDM passed GSU1/GSU2, SIA 0 and 4.
  • SK3, SK4, and SK5 pointer-array TDM passed SIA 0 and 4.
  • Subtile pointer-array TDM (SK3, SIA 0 and 4) passed.
  • gfx1250 device-library and hipBLASLt gtest builds passed.
  • The original nightly general-batched BF16 regression passed.

@jaopaulolc jaopaulolc added the rocm:gemm algos Label to identify PRs of the GEMM Algorithms team. label Aug 26, 2026
@codecov

codecov Bot commented Aug 26, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 56.66667% with 52 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
.../hipblaslt/tensilelite/src/ContractionSolution.cpp 0.00% 32 Missing ⚠️
...lt/tensilelite/client/src/ClientProblemFactory.cpp 0.00% 17 Missing ⚠️
...lelite/Tensile/Components/Subtile/SubtileGREmit.py 85.71% 0 Missing and 1 partial ⚠️
.../tensilelite/Tensile/Components/TensorDataMover.py 91.67% 0 Missing and 1 partial ⚠️
...ects/hipblaslt/tensilelite/Tensile/KernelWriter.py 83.33% 1 Missing ⚠️

❌ Your project check has failed because the head coverage (38.52%) is below the target coverage (80.00%). You can increase the head coverage or adjust the target coverage.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #11334      +/-   ##
===========================================
+ Coverage    69.64%   69.65%   +0.02%     
===========================================
  Files         2826     2815      -11     
  Lines       469878   466858    -3020     
  Branches     69394    68907     -487     
===========================================
- Hits        327211   325187    -2024     
+ Misses      118978   118101     -877     
+ Partials     23689    23570     -119     
Flag Coverage Δ *Carryforward flag
TensileLite-CPP 38.52% <0.00%> (-0.07%) ⬇️
TensileLite-Unit 75.93% <95.77%> (+0.38%) ⬆️
hipBLAS 90.62% <ø> (ø) Carriedforward from 721cf35
hipBLASLt 35.22% <ø> (ø)
hipCUB 82.68% <ø> (ø) Carriedforward from 721cf35
hipDNN 86.84% <ø> (-0.12%) ⬇️ Carriedforward from 721cf35
hipFFT 43.77% <ø> (+1.10%) ⬆️ Carriedforward from 721cf35
hipRAND 76.12% <ø> (ø) Carriedforward from 721cf35
hipSOLVER 69.03% <ø> (+0.11%) ⬆️ Carriedforward from 721cf35
hipSPARSE 86.99% <ø> (ø) Carriedforward from 721cf35
rocBLAS 48.31% <ø> (ø)
rocFFT 51.48% <ø> (-0.47%) ⬇️ Carriedforward from 721cf35
rocRAND 56.91% <ø> (-0.01%) ⬇️ Carriedforward from 721cf35
rocSOLVER 77.32% <ø> (+0.49%) ⬆️ Carriedforward from 721cf35
rocSPARSE 74.60% <ø> (-0.01%) ⬇️ Carriedforward from 721cf35
rocThrust 91.60% <ø> (ø) Carriedforward from 721cf35

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

Files with missing lines Coverage Δ
...ects/hipblaslt/tensilelite/Tensile/ClientWriter.py 71.07% <100.00%> (+0.11%) ⬆️
...slt/tensilelite/Tensile/Common/GlobalParameters.py 95.79% <100.00%> (+0.02%) ⬆️
...blaslt/tensilelite/Tensile/KernelWriterAssembly.py 70.24% <100.00%> (+0.17%) ⬆️
...lelite/Tensile/Components/Subtile/SubtileGREmit.py 86.10% <85.71%> (+15.44%) ⬆️
.../tensilelite/Tensile/Components/TensorDataMover.py 73.09% <91.67%> (+0.83%) ⬆️
...ects/hipblaslt/tensilelite/Tensile/KernelWriter.py 73.96% <83.33%> (+0.48%) ⬆️
...lt/tensilelite/client/src/ClientProblemFactory.cpp 0.00% <0.00%> (ø)
.../hipblaslt/tensilelite/src/ContractionSolution.cpp 14.00% <0.00%> (-0.11%) ⬇️

... and 148 files with indirect coverage changes

🚀 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.

Mailbox ds_store/ds_load carry memTokenLdsBuffer0 so the scheduler places a
publish fence between them and a release before the next LDS0 write. WG
barriers stay untokened.

SK5 extracts HybridMode from MagicShift bit 30, then clears that bit by XOR
with (HybridMode<<30). The magic add + 5-bit shift is masked into a temp so
the SKTiles overlay in MagicShiftItersPerTile is left intact.

sk_hybrid_quick includes a TDMInst=3 HGEMM group (SK5, SIA 0/4).
JIRA ID : N/A

ArgType 3 supplies A and B as pointer arrays. TDM loads the selected batch
matrix, then applies tile offsets to that matrix base. A/B strided-batch WG2
offsets are suppressed after the pointer-array load.

Motivation

- Dereference the selected A and B batch pointers before applying TDM tile offsets on classic and subtile paths.
- Suppress strided-batch offsets after selecting a pointer-array matrix base, and only for A/B.
- Wait after the conventional A/B pointer-array SRD load before reusing that temp for batchOffset (gfx1250 XNACK replay).
- Route pointer tables into output-conversion C/D, and reject sparse, grouped, MBSK, and non-MultipleBuffer GSU>1.
- Initialize non-wave-separated TDM descriptors before applying their global offsets.
- Add standalone-client BatchMode plumbing for the pointer-array ABI.
- Add gfx1250 runtime regressions for GSU1/GSU2, static SK3/SK5, and subtile TDM, sweeping SIA 0 and 4.

Test Plan
- Characterization: r3 datamover, StreamK TDM SGPR-budget, ClientConfigIni.
- `tdm_general_batched_gfx1250.yaml`: non-StreamK pointer-array TDM, SIA 0 and 4.
- `sk_tdm_general_batched.yaml`: SK {3,4,5} x SIA {0,4} x hybrid {0,1}, BatchMode 1.
- `sk_tdm_subtile_general_batched.yaml`: subtile SK3, SIA 0 and 4.
- Rebuild gfx1250 device lib / hipBLASLt gtest; nightly general-batched BF16.
- tox on gfx1250

Test Results
- Characterization tests listed above passed.
- Non-StreamK pointer-array TDM passed GSU1/GSU2, SIA 0 and 4.
- SK3, SK4, and SK5 pointer-array TDM passed SIA 0 and 4.
- Subtile pointer-array TDM (SK3, SIA 0 and 4) passed.
- gfx1250 device-library and hipBLASLt gtest builds passed.
- The original nightly general-batched BF16 regression passed.
@ThanHenderson
ThanHenderson force-pushed the users/nhenders/fix-tdm-sk-hybrid-extract branch from 7ba08b2 to b2f7586 Compare August 27, 2026 20:51
@ThanHenderson
ThanHenderson force-pushed the users/nhenders/fix-tdm-general-batched branch from 76e3a0d to f9a04e6 Compare August 27, 2026 20:51
@nakajee

nakajee commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Thanks for your comments.
I do not have further comments for now.
Please make sure no CI test regression with this change.
I am not sure why dest repo of this PR is not develop.

Base automatically changed from users/nhenders/fix-tdm-sk-hybrid-extract to develop August 28, 2026 22:11
@therock-pr-bot

therock-pr-bot Bot commented Aug 28, 2026 •

Copy link
Copy Markdown

✅ All Policy Checks Passed

Check Status Details
📝 PR Description ✅ Pass —
⛔ Forbidden Files ✅ Pass —
🧪 Unit Test ✅ Pass —
🚫 Draft PR 🔜 To Be Enabled —
🚩 Feature Flag 🔜 To Be Enabled —
📊 Code Coverage 🔜 To Be Enabled —

🎉 All policy checks passed!

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

🙋 Wish to Override Policy?

@therock-pr-bot

Copy link
Copy Markdown

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

@ThanHenderson

Copy link
Copy Markdown
Contributor Author

Fixes items added to known_bugs.yaml in #11182; removes them here.

@aazz44ss
aazz44ss requested a review from mengzcai September 2, 2026 17:03
@aazz44ss

aazz44ss commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

@mengzcai Could you help to review this?

@mengzcai

mengzcai commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

This function should work for complex TDM as well (ROCM-30021: gfx1250 CGEMM via the pointer-array batched API).
Could you add batch_mode: [0, 1] to matmul_batch_medium_complex in the matmul_gtest.yaml to cover the complex path?

@ThanHenderson
ThanHenderson enabled auto-merge (squash) September 4, 2026 01:42
@ThanHenderson
ThanHenderson removed the request for review from mengzcai September 4, 2026 01:51
@ThanHenderson
ThanHenderson merged commit 6f0c83a into develop Sep 4, 2026
142 of 149 checks passed
@ThanHenderson
ThanHenderson deleted the users/nhenders/fix-tdm-general-batched branch September 4, 2026 01:51
@assistant-librarian

Copy link
Copy Markdown
Contributor

TheRock Submodule Bump Activity

Newest first

mengzcai added a commit that referenced this pull request Sep 8, 2026
JIRA ID : ROCM-30021

## Motivation
Add a complex general-batch edge case covering the pointer-array
(batch_mode=1) path over degenerate/boundary sizes and conjugate
transposes, and toggle batch_mode [0, 1] on matmul_batch_medium_complex,
to guard [ROCM-30021](https://amd-hub.atlassian.net/browse/ROCM-30021).
<!-- Explain the purpose of this PR and the goals it aims to achieve.
-->

## Technical Details
Add batch_mode: [0, 1] to matmul_batch_medium_complex and one gtest case
`matmul_batch_complex_general_batch_edge` reusing existing
anchors (`one_matrix_size_range` + `complex_transA_transB_range`),
covering
batch_mode [0, 1]. No source changes.
<!-- Explain the changes along with any relevant GitHub links. -->

## Test Plan
`hipblaslt-test --gtest_filter=*matmul*complex*` on gfx1250.
<!-- Explain any relevant testing done to verify this PR. -->

## Test Result
8684 complex tests pass, 0 failures (verified on develop branch that
includes #11334).
<!-- Briefly summarize test outcomes. -->

## Submission Checklist

- [x] Look over the contributing guidelines at
https://github.com/ROCm/ROCm/blob/develop/CONTRIBUTING.md#pull-requests.


[ROCM-30021]:
https://amd-hub.atlassian.net/browse/ROCM-30021?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

Co-authored-by: mengzcai <mengzcai@amd.com>
marbre pushed a commit that referenced this pull request Sep 15, 2026
…12074)

#11653
Source commit: `a873b5eb2ab4cd7d58b4e2f3e3a42e64640e14fa`

JIRA ID : ROCM-30021

## Motivation
Add a complex general-batch edge case covering the pointer-array
(batch_mode=1) path over degenerate/boundary sizes and conjugate
transposes, and toggle batch_mode [0, 1] on matmul_batch_medium_complex,
to guard [ROCM-30021](https://amd-hub.atlassian.net/browse/ROCM-30021).
<!-- Explain the purpose of this PR and the goals it aims to achieve.
-->

## Technical Details
Add batch_mode: [0, 1] to matmul_batch_medium_complex and one gtest case
`matmul_batch_complex_general_batch_edge` reusing existing
anchors (`one_matrix_size_range` + `complex_transA_transB_range`),
covering
batch_mode [0, 1]. No source changes.
<!-- Explain the changes along with any relevant GitHub links. -->

## Test Plan
`hipblaslt-test --gtest_filter=*matmul*complex*` on gfx1250.
<!-- Explain any relevant testing done to verify this PR. -->

## Test Result
8684 complex tests pass, 0 failures (verified on develop branch that
includes #11334).
<!-- Briefly summarize test outcomes. -->

## Submission Checklist

- [x] Look over the contributing guidelines at
https://github.com/ROCm/ROCm/blob/develop/CONTRIBUTING.md#pull-requests.


[ROCM-30021]:
https://amd-hub.atlassian.net/browse/ROCM-30021?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

Co-authored-by: mengzcai <152131106+mengzcai@users.noreply.github.com>
Co-authored-by: mengzcai <mengzcai@amd.com>
marbre pushed a commit that referenced this pull request Sep 15, 2026
…#12072)

#11334
Source commit: `6f0c83a90f7b00f873c1b51e82f54dd4e0e136bb`

JIRA ID : AIHPBLAS-4515

## Motivation
ArgType 3 supplies A and B as pointer arrays. TDM loads the selected
batch matrix, then applies tile offsets to that matrix base. A/B
strided-batch WG2 offsets are suppressed after the pointer-array load.

## Technical Details

- Dereference the selected A and B batch pointers before applying TDM
tile offsets on classic and subtile paths.
- Suppress strided-batch offsets after selecting a pointer-array matrix
base, and only for A/B.
- Wait after the conventional A/B pointer-array SRD load before reusing
that temp for batchOffset (gfx1250 XNACK replay).
- Route pointer tables into output-conversion C/D.
- Initialize non-wave-separated TDM descriptors before applying their
global offsets.
- Add standalone-client BatchMode plumbing for the pointer-array ABI.
- Add gfx1250 runtime regressions for GSU1/GSU2, static SK3/SK5, and
subtile TDM, sweeping SIA 0 and 4.

## Test Plan

- Characterization: r3 datamover, StreamK TDM SGPR-budget,
ClientConfigIni.
- `tdm_general_batched_gfx1250.yaml`: non-StreamK pointer-array TDM, SIA
0 and 4.
- `sk_tdm_general_batched.yaml`: SK {3,4,5} x SIA {0,4} x hybrid {0,1},
BatchMode 1.
- `sk_tdm_subtile_general_batched.yaml`: subtile SK3, SIA 0 and 4.
- Rebuild gfx1250 device lib / hipBLASLt gtest; nightly general-batched
BF16.
- tox on gfx1250

## Test Results

- Characterization tests listed above passed.
- Non-StreamK pointer-array TDM passed GSU1/GSU2, SIA 0 and 4.
- SK3, SK4, and SK5 pointer-array TDM passed SIA 0 and 4.
- Subtile pointer-array TDM (SK3, SIA 0 and 4) passed.
- gfx1250 device-library and hipBLASLt gtest builds passed.
- The original nightly general-batched BF16 regression passed.

Co-authored-by: Nathan Henderson <nathan.henderson@amd.com>
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.

7 participants