Skip to content

test(hipblaslt): write tuning cache test files to the temp directory - #13354

Merged
jinchen62 merged 1 commit into
developfrom
users/jinchen62/ROCM-32394-tuning-cache-temp-dir
Oct 9, 2026
Merged

jinchen62 merged 1 commit into
developfrom
users/jinchen62/ROCM-32394-tuning-cache-temp-dir

Conversation

@jinchen62

Copy link
Copy Markdown
Contributor

JIRA ID : ROCM-32394

Motivation

hipBLASLt multiplies matrices on AMD GPUs. A tuning file can tell it which kernel, or GPU function, to run for a given problem. The TuningCache_pre_checkin tests, added in #12585, write such a file and check which kernel the library picks. They wrote the file into the current directory and never checked that the write worked.

The 10.2.0-20261007 nightly validation runs the installed hipblaslt-test from /opt/rocm-10.2.0/bin, which the test user cannot write, so no file was created. The seven tests that expect the recorded kernel got the default one and failed on all six reported systems. The seven tests that expect the file to be ignored passed without a file to ignore. The 10.2.0-20261006 nightly passed because it was built from a rocm-libraries commit that predates #12585.

Technical Details

  • tempTuningPath now puts hipblaslt_<test name>_<process id>.tuning in GoogleTest's temporary directory, ::testing::TempDir(), as tuning_store_test.cpp already does. On Linux that is normally /tmp/.
  • writeRawTuningFile and writeTuningFile return a GoogleTest assertion result. The result is a failure that names the path when the file cannot be opened, or when writing or closing it fails.
  • All 14 tests check that result with ASSERT_TRUE, so a failed write stops the test at the write instead of at a later check on the selected kernel.
  • Only clients/tests/src/tuning_cache_test.cpp changes. The library is unchanged.

Not addressed here: tuning_tune_test.cpp, added by #12588, also names its tuning files relative to the current directory and needs the same change.

Test Plan

On one AMD Instinct MI355X (gfx950), build hipblaslt-test from develop (faea76a5cde) with and without this change. Run --gtest_filter='TuningCache_pre_checkin.*' from /tmp and from /opt/rocm/bin, which the test user cannot write. To check the new error message, make the write fail by placing a non-empty directory at the tuning file's path.

Test Result

Test file From /tmp From /opt/rocm/bin
develop 14 pass 7 pass, 7 fail at lines 512, 547, 562, 579, 661, 724 and 745
This change 14 pass 14 pass

The seven failures on develop are the same cases, at the same lines, as the nightly report. When the write is forced to fail, NamedEntryReplays and UnnamedEntryFromAnotherBuildIsIgnored now fail at the write with could not open tuning file <path>. On develop, the second test passes when no file is written.

The automated checks run these tests from a writable directory, which is why they passed on #12585. They cannot reproduce the nightly failure, and they are pending for this change.

Submission Checklist

Risk level

Low (1/5): test-only change. The library and the kernel it selects for applications are unchanged. The tests now need a writable temporary directory instead of a writable current directory.

The TuningCache_pre_checkin tests wrote each tuning file into the current
directory and never checked the write. The nightly job runs the installed
hipblaslt-test from /opt/rocm-10.2.0/bin, which the test user cannot
write, so no file was created. The seven cases that expect the recorded
solution got the default one and failed, and the seven that expect the
file to be ignored passed without reading a file.

The files now go under ::testing::TempDir(), as tuning_store_test.cpp's
already do, and every case fails with the file's path when the file
cannot be opened or written.

Co-authored-by: Cursor <cursoragent@cursor.com>
@jinchen62
jinchen62 requested a review from a team as a code owner October 8, 2026 20:30
@therock-pr-bot

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

Copy link
Copy Markdown

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

@jinchen62
jinchen62 enabled auto-merge (squash) October 9, 2026 01:49
@codecov

codecov Bot commented Oct 9, 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 (41.96%) 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   #13354      +/-   ##
===========================================
- Coverage    72.16%   72.16%   -0.00%     
===========================================
  Files         2874     2874              
  Lines       474873   474873              
  Branches     70141    70141              
===========================================
- Hits        342674   342673       -1     
  Misses      108398   108398              
- Partials     23801    23802       +1     
Flag Coverage Δ *Carryforward flag
TensileLite-CPP 49.33% <ø> (ø) Carriedforward from faea76a
TensileLite-Unit 83.33% <ø> (ø) Carriedforward from faea76a
hipBLAS 90.62% <ø> (ø) Carriedforward from faea76a
hipBLASLt 41.96% <ø> (-<0.01%) ⬇️
hipCUB 82.68% <ø> (ø) Carriedforward from faea76a
hipDNN 86.66% <ø> (ø) Carriedforward from faea76a
hipFFT 42.52% <ø> (ø) Carriedforward from faea76a
hipRAND 76.12% <ø> (ø) Carriedforward from faea76a
hipSOLVER 68.96% <ø> (ø) Carriedforward from faea76a
hipSPARSE 86.99% <ø> (ø) Carriedforward from faea76a
rocBLAS 48.17% <ø> (ø) Carriedforward from faea76a
rocFFT 51.45% <ø> (ø) Carriedforward from faea76a
rocRAND 57.45% <ø> (ø) Carriedforward from faea76a
rocSOLVER 76.83% <ø> (ø) Carriedforward from faea76a
rocSPARSE 74.07% <ø> (ø) Carriedforward from faea76a
rocThrust 93.15% <ø> (ø) Carriedforward from faea76a

*This pull request uses carry forward flags. Click here to find out more.
see 1 file 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.

@jinchen62
jinchen62 merged commit acc3cd6 into develop Oct 9, 2026
166 of 176 checks passed
@jinchen62
jinchen62 deleted the users/jinchen62/ROCM-32394-tuning-cache-temp-dir branch October 9, 2026 01:59
@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.

2 participants