Skip to content

fix(hipblaslt): compact MX scale stride and exact rocRoller kernel-name matching - #14043

Merged
jaopaulolc merged 7 commits into
developfrom
users/jolabega/kfa-rr-mx-1-fixes
Nov 4, 2026
Merged

jaopaulolc merged 7 commits into
developfrom
users/jolabega/kfa-rr-mx-1-fixes

Conversation

@jaopaulolc

@jaopaulolc jaopaulolc commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

JIRA ID : AIHPBLAS-5261

Motivation

Two independent defects on gfx950 MX return wrong numbers: the row pitch hipBLASLt reports for the scale tensor does not match the layout the kernel was compiled against, and the test that picks a kernel by inspecting its name accepts kernels that do not fit the problem. Measured over 108 gfx950 MX problem and type combinations, 36 produced numerically wrong results, some containing inf.

Technical Details

This pull request is stacked on #14086.

The first fix concerns the scale row pitch. ContractionProblemGemm::setMXScaleA/B rounds the scale tensor's K-block dimension up with RoundUpToMultiple(CeilDivide(K, mxBlock), 8) on gfx950. generateCustomCall passed that padded value as the kernel arguments StrideScaleA0 and StrideScaleB0, but the rocRoller kernels are built against the unpadded ceil(K/32). The two values are equal only when K % 256 == 0. Otherwise every scale row after the first resolves to the wrong bytes, and the kernel reads past the end of the caller's scale buffer. generateCustomCall now takes both strides from the buffer the caller passed. customKernelMXScaleAIsPacked() and customKernelMXScaleBIsPacked() name that caller, one operand at a time, because hipBLASLt takes the A and B scale formats independently. When an operand's flag is set, its row stride is the unpadded ceil(K/mxBlock). When it is not, the descriptor stride is already the one the kernel must use.

The padding is deliberately not removed globally. The gfx950 MX kernels that TensileLite generates overwrite this pitch in their own prologue from the problem's SizesSum field, so the kernel argument is dead for them and the padded descriptor must stay for the rest of the library. The change is confined to generateCustomCall, which runs only for externally captured custom kernels. The batch stride StrideScale{A,B}1 follows the same caller buffer: a packed caller gets the product of the unpadded scale sizes, and an unpacked caller keeps the descriptor stride. No shipped rocRoller kernel reads that batch stride, and those kernels run a single batch. This also repairs the FP6 custom kernels added by #12964 and #12965, which reach the same code path.

hipBLASLt declares each operand packed unless its format is Block_32_UE8M0_32_8_EXT: that caller pre-swizzled its scales into the padded gfx950 layout, which the descriptor already describes. The TensileLite benchmark client leaves both flags false, because it allocates from the padded descriptor.

The second fix concerns matchesRocRollerSelectedKernel, the predicate that decides whether a kernel's name describes the problem at hand. It has three defects, all reachable on the HIPBLASLT_ENABLE_ROCROLLER=OFF build:

  • The tile test was the bare substring WGT_<m>x<n>x<k>_UR_, which occurs inside both _WGT_..._UR_ and _SK_WGT_..._UR_. A plain tile therefore matched a StreamK kernel — StreamK is a work-partitioning scheme that splits the summation axis across workgroups — and a StreamK tile matched a plain kernel. The test is now anchored as _WGT_... with an explicit _SK discriminator.
  • The prefix match stopped at _Float_ while the tile match began at WGT_, so the scale-layout tokens between the two were never inspected. A pre-swizzled kernel, named with PSTA_, PTA_, PSTB_, or PTB_, could match a problem whose scales are not pre-swizzled. Those tokens are now rejected.
  • A StreamK kernel name never carries _WGM_, because parameter_selection.cpp forces workgroupMappingDim = -1 for StreamK. The workgroup-mapping comparison now runs only when workgroupMapping && !streamK, and StreamK tiles are no longer rejected outright.

getRocRollerSelectedSolutions also gains the workspace rejection that the rocRoller-enabled path already applies at gemm.cpp:703-706. Without it an OFF build hands back a StreamK kernel that an ON build would have skipped, because _convertToHeuristicResultArray reports requiredWorkspaceSize but never filters on it.

Name matching is not enough on its own

A kernel's name carries its tile shape and its operand types, and nothing else. Every other condition the kernel was captured under — which scale layout it reads, the size multiples and size windows it requires, how many batches it handles, how large a tensor it can address — lives in the kernel's selection predicates. An ordinary library lookup evaluates those; this hand-rolled search skipped them. A problem that block-scales only one of its two operands therefore matched a kernel built to read two scale tensors, and that kernel read a scale buffer the caller had never allocated.

getRocRollerSelectedSolutions now requires a candidate's hardwarePredicate and problemPredicate to accept the problem before it takes a name match, and keeps searching when they do not. It tests hardware and problem only, as the grouped-gemm path in the same file does: taskPredicate needs a Task, which needs the workspace size that is tested immediately afterwards.

This narrows what the OFF path selects. Where the kernel it used to match declares a size window that excludes the problem, it now picks a different one. That is the intended behaviour, but it has a cost, measured below: the only candidates on this path are other rocRoller kernels, so when the best-fitting tile is correctly rejected there may be nothing comparable left in the pool.

The predicate moves to rocroller_kernel_match.hpp, whose only dependency is <string>, so it can be tested without a problem descriptor or a GPU.

No longer rejecting StreamK outright changes which kernel an OFF build selects. That is intended — it is what lets an OFF build reach the StreamK kernels at all — but this pull request tests it only at the name-matching level. The selection-identity sweep that compares an OFF build against an ON build lands with the logic that makes these kernels selectable, later in this stack.

Test Plan

  • CustomKernelTest.ScaleStrideIsCompactNotPadded, CustomKernelTest.ScaleStrideIsCompactForEitherBoundDimension, CustomKernelTest.ScaleBatchStrideFollowsTheCallerBuffer, CustomKernelTest.ScaleStrideFollowsDescriptorWhenCallerDoesNotPack, CustomKernelTest.ScaleStridesIncludeTheInitialStrideForDataParallelArgs, and CustomKernelTest.ScaleStrideRoundsUpPartialBlocks: assert that generateCustomCall emits the caller's scale stride. A packed caller with a K that is not a multiple of 256 gets ceil(K/mxBlock), for both bound dimensions and for the batch stride. An unpacked caller gets the descriptor stride.
  • HostUnitRocRollerKernelMatch.*: five host-only tests covering the StreamK and plain tile discrimination, the pre-swizzle token rejection, and the workgroup-mapping comparison. Mutation-check them by running them against the pre-patch predicate; a test that passes against the old code does not discriminate.
  • CustomKernelTest.ScaleStrideFollowsEachOperandsBuffer: a packed A with a padded B, and the reverse, each get their own buffer's row and batch strides.
  • HostUnitMXScaleSetup.smoke_PreSwizzledDeclarationIsPerOperand: a pre-swizzled operand is declared unpacked, and declaring one operand does not change the other.
  • Numerical parity sweep on gfx950 over 108 MX problem and type combinations against a 1e-6 tolerance, comparing each result with and without this change.
  • A problem that block-scales one operand only — scaleA 3, scaleB 0, bf8 inputs, 1024x1024x1024 — on an HIPBLASLT_ENABLE_ROCROLLER=OFF build. It must report no solution rather than launching a kernel.
  • A selection sweep on the same build over 8 shapes that do block-scale both operands, recording which kernel each build picks and whether it verifies, to show the predicates narrow selection without rejecting problems the kernels do serve. Numerical checks must be requested in the test record itself, because a --verify flag on the command line does not reach a record supplied by --yaml.

Test Result

Completed evidence:

  • Both CustomKernelTest cases are new and pass.
  • All five HostUnitRocRollerKernelMatch tests are new and pass. Against the pre-patch predicate, 4 of the 5 fail, so they discriminate the change.
  • Parity sweep: 36 of the 108 combinations were numerically wrong before the change, with a normalized error as large as 6508 and inf in some cases. After the change 0 are wrong and none regressed; the 63 combinations that were already clean are bit-identical.

Predicate evaluation, measured on MI355X (gfx950, PCI 0x75a3) against an HIPBLASLT_ENABLE_ROCROLLER=OFF build, with the numerical check set in the test record:

  • One-sided MX, bf8 x bf8 -> f32 at 1024x1024x1024 with scaleA 3 and scaleB 0: before the change the run ends in an illegal memory access was encountered (700); after it, the problem reports no solution, on 2 of 2 runs.
  • Selection sweep, f8 x f8 -> f32 with both operands block-scaled, over 8 shapes: every shape still receives a solution and every shape verifies, on both builds, so no problem the kernels serve is rejected. Five of the eight change kernel. For instance RR_GEMM_..._WGT_32x32x64_UR_2 declares M and N between 64 and 128 and K exactly 128, and was being selected at 512x512x512.
  • The narrowing costs performance where the rejected tile was the only large one available. At 4096x4096x1024 the selection moves from RR_GEMM_..._WGT_256x128x128_UR_2, whose declared window ends at M = 2560, to RR_GEMM_..._WGT_16x16x128_UR_2, and the kernel time rises by a factor of about 3.6 over three repeats. That fallback, routing a problem the rocRoller path declines to ordinary Tensile selection, is feat(hipblaslt): ship rocRoller MX kernels and packed client scales #14497, later in this stack. It is not in this pull request.

Pending: automated GitHub checks have not reported on this branch. The parity sweep was run locally on gfx950 hardware and does not run in a shared CI lane today.

Submission Checklist

Risk level

Medium. Two pieces of device-visible behavior change. The scale stride passed to custom MX kernels on gfx950 changes value whenever K % 256 != 0, which is the defect being fixed; kernels generated by TensileLite are unaffected because they overwrite that argument. Separately, an HIPBLASLT_ENABLE_ROCROLLER=OFF build can now select StreamK kernels it previously rejected, so kernel choice on that path changes; the numerical consequence of that selection change is measured later in this stack rather than here.

Evaluating the predicates narrows that path further, and the measured blast radius is kernel choice rather than correctness: across the 8 shapes swept, no problem lost a solution and none failed verification, while 5 changed kernel. The cost is performance, not accuracy, and it falls on shapes that no checked-in rocRoller kernel was captured for — previously served by a kernel used outside its declared window. The largest measured case is about 3.6x slower. That cliff is removed by the fallback in #14497, later in this stack, not by this pull request.

@therock-pr-bot

therock-pr-bot Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

✅ All Checks Passed — Ready for Review

Check Status Details
📝 PR Description ✅ Pass —
⛔ Forbidden Files ✅ Pass —
🧪 Unit Test ✅ Pass —
🔎 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 Oct 20, 2026 •

Copy link
Copy Markdown

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

@jaopaulolc jaopaulolc changed the title fix(hipblaslt): correct MX scale stride and kernel-name matching fix(hipblaslt): compact MX scale stride and exact rocRoller kernel-name matching Oct 20, 2026
@codecov

codecov Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 60.95890% with 57 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...rary/src/amd_detail/rocblaslt/src/tensile_host.cpp 53.28% 57 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #14043      +/-   ##
===========================================
+ Coverage    77.42%   77.46%   +0.04%     
===========================================
  Files         2903     2906       +3     
  Lines       490638   490550      -88     
  Branches     74225    74253      +28     
===========================================
+ Hits        379863   379993     +130     
+ Misses       85771    85539     -232     
- Partials     25004    25018      +14     
Flag Coverage Δ *Carryforward flag
TensileLite-CPP 51.04% <ø> (ø)
TensileLite-Unit 84.35% <ø> (ø)
hipBLAS 90.62% <ø> (ø) Carriedforward from e36c7a1
hipBLASLt 68.91% <60.96%> (+0.14%) ⬆️
hipCUB 82.68% <ø> (ø) Carriedforward from e36c7a1
hipDNN 87.25% <ø> (ø) Carriedforward from e36c7a1
hipFFT 42.57% <ø> (ø) Carriedforward from e36c7a1
hipRAND 76.12% <ø> (ø) Carriedforward from e36c7a1
hipSOLVER 69.67% <ø> (ø) Carriedforward from e36c7a1
hipSPARSE 87.03% <ø> (ø) Carriedforward from e36c7a1
rocBLAS 69.20% <ø> (ø) Carriedforward from e36c7a1
rocFFT 46.49% <ø> (ø) Carriedforward from e36c7a1
rocRAND 57.32% <ø> (ø) Carriedforward from e36c7a1
rocSOLVER 76.74% <ø> (ø) Carriedforward from e36c7a1
rocSPARSE 83.54% <ø> (ø) Carriedforward from e36c7a1
rocSPARSE-integration ?
rocSPARSE-unit ?
rocThrust 93.15% <ø> (ø) Carriedforward from e36c7a1

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

Files with missing lines Coverage Δ
...md_detail/rocblaslt/src/include/mx_scale_setup.hpp 100.00% <100.00%> (ø)
...l/rocblaslt/src/include/rocroller_kernel_match.hpp 100.00% <100.00%> (ø)
...rary/src/amd_detail/rocblaslt/src/tensile_host.cpp 65.67% <53.28%> (+0.03%) ⬆️

... and 5 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.

@jaopaulolc
jaopaulolc added this pull request to stack #14055 October 20, 2026 20:20
@jaopaulolc
jaopaulolc removed this pull request from stack #14055 October 21, 2026 19:52
@jaopaulolc
jaopaulolc added this pull request to stack #14148 October 21, 2026 20:25
@jaopaulolc
jaopaulolc removed this pull request from stack #14148 October 21, 2026 20:27
@jaopaulolc
jaopaulolc changed the base branch from develop to users/jolabega/hipblaslt-own-enums October 21, 2026 20:29
@jaopaulolc
jaopaulolc added this pull request to stack #14149 October 21, 2026 20:31
@jaopaulolc
jaopaulolc marked this pull request as ready for review October 22, 2026 17:43
@jaopaulolc
jaopaulolc requested review from a team as code owners October 22, 2026 17:43
@jaopaulolc
jaopaulolc removed this pull request from stack #14149 October 23, 2026 17:20
@jaopaulolc
jaopaulolc added this pull request to stack #14297 October 23, 2026 17:20
@jaopaulolc
jaopaulolc removed this pull request from stack #14297 October 27, 2026 15:38
@jaopaulolc
jaopaulolc requested review from a team as code owners October 27, 2026 16:06
@jaopaulolc
jaopaulolc requested a review from caio96 October 27, 2026 21:40
@jaopaulolc
jaopaulolc force-pushed the users/jolabega/kfa-rr-mx-1-fixes branch from a7cedfa to c90b64d Compare October 28, 2026 15:00
@jaopaulolc
jaopaulolc force-pushed the users/jolabega/kfa-rr-mx-1-fixes branch from c90b64d to 052114a Compare October 28, 2026 16:16
@jaopaulolc
jaopaulolc requested review from caio96 and removed request for caio96 October 28, 2026 18:10

@newling newling left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR resolves an issue I was hitting; see closed #14370, which this supersedes. Some agent review comments here: https://github.com/newling/agent-public-reviews/blob/82b2dd62aca2c288c7ba8be7ca02ff9f7c274f9d/rocm-libraries/review_pr14043.md, with suggested changes linked. Feel free to take any of those, they’re nonblocking from my perspective. Approving in advance.

@jaopaulolc
jaopaulolc force-pushed the users/jolabega/kfa-rr-mx-1-fixes branch from 052114a to f9a41a5 Compare October 28, 2026 21:23
@jaopaulolc

Copy link
Copy Markdown
Contributor Author

Took the two nonblocking suggestions from the review of 052114ad.

71570514e80 extends the scale-stride probes to the data-parallel version-1 argument list, to initial strides, and to a K that is not a whole number of blocks. For M=N=60 and K=128 the packed batch stride is 240 and the descriptor batch stride is 512. The same commit shortens the comments so they state the caller-layout contract without the extraction history.

The description already matches this head: both the row stride and the batch stride follow customKernelMXScalesArePacked(), and the pull request is stacked on #14086. A selection fixture that drives a rejected predicate and an insufficient workspace is still the later comparison in the stack, as that review left it.

@Alex-Vasile Alex-Vasile left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. One minor thing.

Two independent library correctness fixes for externally-captured
custom kernels.

generateCustomCall passed StrideScaleA0/StrideScaleB0 the K-block
dimension that setMXScaleA/B pads with RoundUpToMultiple(CeilDivide(K,
mxBlock), 8); rocRoller builds its kernels against the compact K/32, so
the two agree only when K % 256 == 0. Pass the compact stride for
externally-captured custom kernels only -- Tensile's own generated
gfx950 MX kernels overwrite this pitch from SizesSum in their prologue,
so the padded kernarg is dead for them and must stay.

matchesRocRollerSelectedKernel tested the bare substring
"WGT_<m>x<n>x<k>_UR_", which occurs in both "_WGT_..._UR_" and
"_SK_WGT_..._UR_", so a plain tile matched a StreamK kernel and the
reverse; and the prefix match stopped at "_Float_" while the tile match
started at "WGT_", leaving the scale tokens between them uninspected, so
a pre-swizzled kernel matched a non-pre-swizzled problem. Anchor both
ends and compare the full name. Also apply the workspace reject that the
rocRoller-on path already performs.
generateCustomCall now hands an external custom kernel the compact
ceil(K/mxBlock) scale pitch unconditionally, but only hipBLASLt packs
that buffer. The TensileLite benchmark client allocates the MX scale
tensor straight from the padded descriptor and restrides the canonical
scales into it, zeroing the padding tail, then hands that same buffer to
the custom kernel. The compact pitch sent every odd scale row into the
zeroed tail -- an E8M0 0x00 is 2^-127 -- so every MX custom-kernel config
in tensilelite/Tests/custom (custom_rr_mx, custom_rr_f6, custom_rr_wgm,
custom_rr_mx_pure) failed validation on gfx950 with ~3/4 of the output
tensor off by 2^-127.

Record the layout on the problem instead of assuming it:
setCustomKernelMXScalesArePacked, set by tensile_host.cpp because the
user's plain Block_32_UE8M0 pointer really is packed, left false
everywhere else so the descriptor's own stride is used.
setCustomKernelMXScalesArePacked was a standalone statement next to, but
separable from, the setMXScaleA/B calls it describes. Dropping it would
not have failed anything: the TensileLite benchmark client leaves the
flag false on purpose and keeps passing, while hipBLASLt callers would go
back to receiving the padded pitch against a packed buffer -- the silent
corruption the previous commit fixed.

Pair the two in setHostMXScaleA/B (new include/mx_scale_setup.hpp), which
every MX scale attachment in tensile_host.cpp now goes through, so there
is no separate statement left to drop. clients/tests/unit/
mx_scale_setup_gtest.cpp pins the pairing: removing the declaration from
either helper fails HostUnitMXScaleSetup.

ConstructTensileProblem and updateTensileProblem cannot be driven from a
host-only test -- both are file-static, and both call hipGetDevice through
mxScaleTensorNeedsPaddingFreeDim, while these tests run with no GPU.
Dropping the setup at either call site is caught at compile time instead:
padMXScaleTensorFreeDim is its only consumer there, and -Wunused-variable
is promoted to an error around it, the tripwire idiom clients/tests/unit
already uses for -Wswitch.

hipblaslt-test-hostunit names roc::tensilelite-host, which it already
linked transitively, for the generated tensilelitehost/export.h that
Tensile/ContractionProblem.hpp includes.
getRocRollerSelectedSolutions matched a checked-in rocRoller kernel by
name alone. The name carries only the tile shape and the operand types,
so a one-sided-MX problem matched a two-sided kernel and faulted the
GPU, and size-window and scale-layout predicates never ran.

Require hardwarePredicate and problemPredicate to accept the problem
before a name match is taken, and keep searching when they do not.
StrideScaleA0/B0 is the row stride of the buffer the caller allocated.
The batch stride follows that same buffer, and the comment says so.
The batch-stride test only covered the legacy argument list. Data-parallel
version 1, initial strides, and a partial block use different slots.
setHostMXScaleA/B declared every hipBLASLt MX buffer packed, including a
Block_32_UE8M0_32_8_EXT one. That caller pre-swizzled its scales into the
padded gfx950 layout the descriptor already describes, so an external
custom kernel would have been handed the compact pitch for a padded
buffer. A single flag on the problem also could not describe an A and a
B that arrive in different formats: whichever helper ran last decided
the stride for both.

Record the layout per operand. The helpers take scalesArePacked, which
tensile_host.cpp derives from the operand's own format, and
generateCustomCall reads A's flag for StrideScaleA0/A1 and B's for
StrideScaleB0/B1. setCustomKernelMXScalesArePacked stays as the way to
declare both, for a caller that lays them out alike.

This is latent today: no PSTA/PTA kernel is checked in.
@peymanr

peymanr commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

PR Pundit review

(Testing PR Pundit Code Review agent. Not all comments may be relevant. This is a one-time automated pass: please address what is useful, no need to request a re-review. Please reply to each point, whether it applies or not: we harvest these replies, and both kinds are enormously helpful for tuning the agent. Reach out to @peymanr for suggestions.)

# Finding Where
1 🟠 Predicate and workspace eligibility filters added without any test projects/hipblaslt/library/src/amd_detail/rocblaslt/src/tensile_host.cpp:7470

1. 🟠 Should fix: Predicate and workspace eligibility filters added without any test

projects/hipblaslt/library/src/amd_detail/rocblaslt/src/tensile_host.cpp:7470

The eligibility filters this PR adds to getRocRollerSelectedSolutions have no test. These are the hardwarePredicate and problemPredicate checks and the requiredWorkspaceSize(...) > maxWorkSpaceBytes reject. The new gtests cover only rocRollerKernelNameMatchesTile (including the stream-K vs plain pairing that replaced the old tile.streamK reject) and the MX scale setup helpers. Nothing checks that a name-matched kernel is skipped when its predicate rejects the problem (e.g. one-sided MX) or its workspace exceeds the budget. Consider a test of the rocRoller-off path with a rejecting predicate or a small workspace.

Who is affected: Only builds with HIPBLASLT_ENABLE_ROCROLLER=OFF (default is ON) take this path; a future regression in its filtering would not be caught by CI.

Checked against the code by an independent pass.

Related past reviews: #1944 on projects/hipblaslt/library/src/amd_detail/rocblaslt/src/tensile_host.cpp

Shared from a pilot of PR Pundit, an agentic code reviewer that builds and tests the change and reads the project's past reviews. Reviewed at 9da6ca2f; findings checked and posted by @peymanr; points already raised on this PR are left out.

@peymanr

peymanr commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

PR Pundit review

(Testing PR Pundit Code Review agent. Not all comments may be relevant. This is a one-time automated pass: please address what is useful, no need to request a re-review. Please reply to each point, whether it applies or not: we harvest these replies, and both kinds are enormously helpful for tuning the agent. Reach out to @peymanr for suggestions.)

# Finding Where
1 🟠 Format-to-layout regression in hostMXScalesArePacked passes host unit tests unnoticed projects/hipblaslt/library/src/amd_detail/rocblaslt/src/tensile_host.cpp:2048

1. 🟠 Should fix: Format-to-layout regression in hostMXScalesArePacked passes host unit tests unnoticed

projects/hipblaslt/library/src/amd_detail/rocblaslt/src/tensile_host.cpp:2048

The format-to-layout mapping in hostMXScalesArePacked() (only Block_32_UE8M0_32_8_EXT is padded/not packed) lives in an anonymous namespace in tensile_host.cpp and no test exercises it. mx_scale_setup_gtest passes the packed flag explicitly, so dropping or inverting the format check would not fail any test. Consider moving the mapping into mx_scale_setup.hpp (or passing the ScalingFormat) and asserting _EXT -> false, other MX formats -> true. The gfx1250 concern does not apply today: the packed flag is only read in generateCustomCall, which serves hand-written custom kernels, and all gfx1250 kernels that read StrideScaleA0/B0 are Tensile-generated and take the legacy path.

Who is affected: Maintainers changing the MX format mapping later; no current user-visible configuration is affected.

Checked against the code by an independent pass.

Related past reviews: #4599 on projects/hipblaslt/library/src/amd_detail/rocblaslt/src/tensile_host.cpp, #5004 on projects/hipblaslt/library/src/amd_detail/rocblaslt/src/tensile_host.cpp, #10587 on projects/hipblaslt/tensilelite/include/Tensile/ContractionProblem.hpp

Shared from a pilot of PR Pundit, an agentic code reviewer that builds and tests the change and reads the project's past reviews. Reviewed at c5d3e288; findings checked and posted by @peymanr; points already raised on this PR are left out.

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

6 participants