Skip to content

fix(tensilelite): fail validation on mismatches when print-max <= 0 - #13478

Merged
DDEle merged 1 commit into
developfrom
users/yiding12/tlclient-validation-fail-without-print
Oct 27, 2026
Merged

DDEle merged 1 commit into
developfrom
users/yiding12/tlclient-validation-fail-without-print

Conversation

@DDEle

@DDEle DDEle commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Motivation

The TensileLite client runs matrix-multiplication (GEMM) kernels, functions that run on the GPU, and, when validation is on, compares each kernel's output matrix D with a CPU reference. A mismatch should mark that kernel configuration (a "solution") FAILED. When --print-max, the limit on how many mismatched values the client prints, was 0 or negative, mismatches were counted but never marked as a failure, so the solution was reported as PASSED. --print-max defaults to -1, so a run that turned on validation with --num-elements-to-validate but left --print-max unset passed regardless of the result.

JIRA ID : AIHPBLAS-4534

Technical Details

ReferenceValidator checks D with FastPointwiseComparison and constructs it with printReport = (print-max > 0). Its report(), and the same method in PointwiseComparison, set the failure flag only inside the printReport branch. Both now set the flag whenever the mismatch count is nonzero; printReport only decides whether the "Found N incorrect values" line is printed. The bounds check for writes outside D (InvalidComparison) already reported errors regardless of print-max and is unchanged.

Ini files written by ClientWriter take print-max from ValidationMaxToPrint, which defaults to 4 and is positive in all 247 YAML files in this repository that set it, so those runs report the same results as before. A hand-written ini file or command line with print-max <= 0 now reports FAILED when D has a mismatch.

The new PrintMaxZero_MismatchStillFails case in tests/ResultComparison_test.cpp builds both comparators with a print limit of 0, feeds them one mismatched element, and checks that error() returns true. It runs for each of the 12 element types the validator supports.

#12472 rejects --print-max <= 0 in the multi-GPU path it adds to the client, to avoid this bug; that check can be removed once this change lands.

Test Plan

Build tensilelite-tests for gfx950 on a host without a GPU, first with only the new test added, then with the fix. In both builds, run the *ResultComparison* cases and the full binary.

Test Result

  • Without the fix: PrintMaxZero_MismatchStillFails fails for all 12 types, with both error() calls returning false. The other 48 ResultComparison cases pass.
  • With the fix: 60 of 60 ResultComparison cases pass.
  • Full tensilelite-tests with the fix: 641 passed, 9 skipped, 8 failed. The same 8 fail without the fix. Seven stop at a HIP device query with error 100 (hipErrorNoDevice); IndexedLibraryParityTest.ResolveByIndexWorksWithoutAnyPriorQuery finds no solution while the other tests in its suite skip.
  • The client was not run on a GPU. Automated GitHub checks are pending.

Submission Checklist

@therock-pr-bot

therock-pr-bot Bot commented Oct 12, 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

Copy link
Copy Markdown

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

Copilot AI 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.

🔵 Needs a closer look

The implementation appears correct, but required shared automated checks are still pending.

0 open findings

What changed in this PR

This PR ensures TensileLite validation reports mismatched GPU results as failed even when mismatch printing is disabled.

Changes:

  • Decouples failure detection from diagnostic printing in both comparators.
  • Adds regression coverage across all 12 supported element types.

Quality assessment: Defect fix, risk 3/5 while required shared automated checks remain pending. The focused C++ unit test directly detects regression; no feature flag is needed.

Suggested description addition:

Risk level

Moderate (3/5): The change is narrowly scoped and has direct regression coverage, but shared automated checks are pending. It changes default validation behavior so mismatches produce FAILED when print-max is non-positive.

File Description
projects/​hipblaslt/​tensilelite/​client/​include/​ResultComparison.hpp Marks mismatches as failures independently of report printing.
projects/​hipblaslt/​tensilelite/​tests/​ResultComparison_test.cpp Verifies disabled printing cannot suppress comparator failures.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

FastPointwiseComparison::report() and PointwiseComparison::report() set
m_failed only when printReport was true. ReferenceValidator passes
printReport = (print-max > 0), and the client defaults print-max to -1,
so with print-max <= 0 a mismatch in D was reported as PASSED.

Set m_failed whenever there are errors; printReport now only controls
the "Found N incorrect values" line. Ini files written by ClientWriter
take print-max from ValidationMaxToPrint, which defaults to 4 and is
positive in every YAML in this repository, so this only changes results
for hand-written ini files and command-line runs.

Add PrintMaxZero_MismatchStillFails to ResultComparison_test.
@DDEle
DDEle force-pushed the users/yiding12/tlclient-validation-fail-without-print branch from 9c6d398 to da2a81a Compare October 13, 2026 02:20
@codecov

codecov Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

❌ Your project check has failed because the head coverage (49.67%) 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   #13478   +/-   ##
========================================
  Coverage    71.99%   71.99%           
========================================
  Files         2879     2879           
  Lines       478104   478104           
  Branches     70852    70852           
========================================
  Hits        344166   344166           
  Misses      109972   109972           
  Partials     23966    23966           
Flag Coverage Δ *Carryforward flag
TensileLite-CPP 49.67% <ø> (ø)
TensileLite-Unit 83.55% <ø> (ø)
hipBLAS 90.62% <ø> (ø) Carriedforward from 214ad34
hipBLASLt 42.73% <ø> (ø)
hipCUB 82.68% <ø> (ø) Carriedforward from 214ad34
hipDNN 86.80% <ø> (ø) Carriedforward from 214ad34
hipFFT 42.35% <ø> (ø) Carriedforward from 214ad34
hipRAND 76.12% <ø> (ø) Carriedforward from 214ad34
hipSOLVER 68.96% <ø> (ø) Carriedforward from 214ad34
hipSPARSE 86.99% <ø> (ø) Carriedforward from 214ad34
rocBLAS 48.21% <ø> (ø) Carriedforward from 214ad34
rocFFT 47.25% <ø> (ø) Carriedforward from 214ad34
rocRAND 57.59% <ø> (ø) Carriedforward from 214ad34
rocSOLVER 76.83% <ø> (ø) Carriedforward from 214ad34
rocSPARSE 74.31% <ø> (ø) Carriedforward from 214ad34
rocThrust 93.15% <ø> (ø) Carriedforward from 214ad34

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

@DDEle
DDEle requested a review from newling October 26, 2026 02:08
@DDEle
DDEle merged commit c09f9dd into develop Oct 27, 2026
167 of 172 checks passed
@DDEle
DDEle deleted the users/yiding12/tlclient-validation-fail-without-print branch October 27, 2026 01:49
@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