Skip to content

[tensilelite] Fix YAML parameter type mismatches and promote to hard error - #8623

Closed
jaopaulolc wants to merge 1 commit into
developfrom
users/jolabega/fix-parameter-type-mismatch
Closed

jaopaulolc wants to merge 1 commit into
developfrom
users/jolabega/fix-parameter-type-mismatch

Conversation

@jaopaulolc

@jaopaulolc jaopaulolc commented Jun 18, 2026 •

Copy link
Copy Markdown
Contributor

Motivation

TensileLite YAML solution files and CustomKernel assembly files contained parameter type mismatches (e.g., int where bool is expected, int where float is expected). Because msgpack serializes bool and int as different wire types, these mismatches cause std::bad_cast at runtime.

The existing build-time check only emitted a warning, allowing broken files to ship silently.

Changes

Fix all existing type mismatches

Corrected types across hipblaslt library YAML, hipblaslt test YAML, hipblaslt CustomKernels (.s), and hipsparselt library YAML:

Conversion Parameters
int → bool BufferStore, ExpandPointerSwap, LDSTrInst, MIArchVgpr, NoReject, PreloadKernArgs, SourceSwap, StorePriorityOpt, TailloopInNll, Use64bShadowLimit
bool → int DirectToLds, DirectToLdsMetadata, SwapGlobalReadOrder, TransposeLDSMetadata, UsePLRPack
int → float GlobalReadPerMfma
float → int StaggerUStride

Promote type mismatch warning to hard error

printTypeMismatchSummary() in TensileCreateLibrary/Run.py now raises RuntimeError when mismatches are detected, failing the build immediately instead of continuing with a warning.

Fix GlobalReadPerMfma default type

Changed the default value in GlobalParameters.py from [1] (int) to [1.0] (float) so inherited defaults don't trigger the type check.

Test Plan

  • Verified zero remaining type mismatches via device library build for gfx942 (2456 YAML logic files checked clean)
  • Updated test_validateParameterTypes.py to assert RuntimeError is raised on mismatch detection
  • Existing unit tests pass with all fixes applied

Risk level

Low — the YAML/assembly fixes are purely data corrections (values semantically unchanged, just typed correctly), and the hard error only triggers on genuinely broken files that would already fail at runtime.

Submission Checklist

@codecov-commenter

codecov-commenter commented Jun 19, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

❌ Your project status has failed because the head coverage (77.90%) 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    #8623   +/-   ##
========================================
  Coverage    64.81%   64.81%           
========================================
  Files         2613     2613           
  Lines       407102   407083   -19     
  Branches     60785    60790    +5     
========================================
- Hits        263840   263835    -5     
+ Misses      123272   123254   -18     
- Partials     19990    19994    +4     
Flag Coverage Δ *Carryforward flag
TensileLite 31.22% <ø> (+0.01%) ⬆️
hipBLAS 90.81% <ø> (ø) Carriedforward from ce1d0d7
hipBLASLt 41.36% <ø> (-0.02%) ⬇️
hipCUB 82.68% <ø> (ø) Carriedforward from ce1d0d7
hipDNN 86.71% <ø> (ø) Carriedforward from ce1d0d7
hipFFT 50.79% <ø> (ø) Carriedforward from ce1d0d7
hipRAND 76.12% <ø> (ø) Carriedforward from ce1d0d7
hipSOLVER 69.18% <ø> (ø) Carriedforward from ce1d0d7
hipSPARSE 86.55% <ø> (ø) Carriedforward from ce1d0d7
rocBLAS 48.08% <ø> (ø) Carriedforward from ce1d0d7
rocFFT 45.90% <ø> (ø) Carriedforward from ce1d0d7
rocRAND 57.07% <ø> (ø) Carriedforward from ce1d0d7
rocSOLVER 77.90% <ø> (ø) Carriedforward from ce1d0d7
rocSPARSE 72.37% <ø> (ø) Carriedforward from ce1d0d7
rocThrust 91.34% <ø> (ø) Carriedforward from ce1d0d7

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

Files with missing lines Coverage Δ
...slt/tensilelite/Tensile/Common/GlobalParameters.py 86.82% <ø> (ø)
...lt/tensilelite/Tensile/SolutionStructs/Solution.py 26.31% <ø> (+0.01%) ⬆️
...lt/tensilelite/Tensile/TensileCreateLibrary/Run.py 34.01% <ø> (-0.13%) ⬇️

... and 7 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 requested a review from a team as a code owner June 19, 2026 22:42
…error

Fix parameter type mismatches across hipblaslt and hipsparselt that cause
std::bad_cast at runtime due to msgpack wire type differences for int vs bool.

Type corrections applied:
- int -> bool: Activation, BufferStore, ExpandPointerSwap, LDSTrInst,
  MIArchVgpr, NoReject, PreloadKernArgs, SourceSwap, StorePriorityOpt,
  TailloopInNll, TransposeA, TransposeB, Use64bShadowLimit
- bool -> int: DirectToLds, DirectToLdsMetadata, SwapGlobalReadOrder,
  TransposeLDSMetadata, UsePLRPack
- int -> float: GlobalReadPerMfma
- float -> int: StaggerUStride

Promote the type mismatch diagnostic from warning to hard error in
TensileCreateLibrary so future mismatches fail the build immediately.

Fix GlobalReadPerMfma default in GlobalParameters.py from [1] to [1.0].
@jaopaulolc
jaopaulolc force-pushed the users/jolabega/fix-parameter-type-mismatch branch from d16e615 to 6956cdf Compare June 22, 2026 17:30
@jaopaulolc

Copy link
Copy Markdown
Contributor Author

Splitting into 3 smaller PRs for GitHub rendering: parts 1/3, 2/3, and 3/3 (error promotion last).

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.

2 participants