Skip to content

Fix hipErrorNotFound for helper kernels under I-cache rotation.#9266

Open
geotseng-amd wants to merge 1 commit into
ROCm:developfrom
geotseng-amd:users/geotseng/fix-co-victor
Open

Fix hipErrorNotFound for helper kernels under I-cache rotation.#9266
geotseng-amd wants to merge 1 commit into
ROCm:developfrom
geotseng-amd:users/geotseng/fix-co-victor

Conversation

@geotseng-amd

@geotseng-amd geotseng-amd commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

This PR is credited to @Jinp800125

Motivation

Benchmarking with I-cache rotation enabled (--icache-rotate-copies) crashed at kernel launch with hipErrorNotFound ("named symbol not found"), e.g. for the helper kernel Cijk_SB_PostGSU2_VW4. I-cache rotation duplicates only the main --code-object (.co) modules into rotation slots; the helper kernel bundle (Kernels.so-000-<arch>.hsaco, containing PostGSU/betaOnly/reduction/conversion kernels) is loaded only once. When a launch landed on a rotation slot other than copy 0, the helper symbol could not be resolved and the run aborted.

Technical Details

  • HipSolutionAdapter::getKernel: added a fallback that searches the base m_modules list when a symbol is not found in the selected rotation copy's modules. This prevents launch failures for any module that isn't duplicated across rotation slots (safety net).
  • HipSolutionAdapter::loadHelperKernelExtraCopies(int extraCopies): new method (declared in HipSolutionAdapter.hpp) that mirrors the helper bundle (Kernels.so-000-<arch>.hsaco) into every rotation slot, analogous to how loadCodeObjectFileExtraCopies duplicates main .co files. It is idempotent (guarded by m_extraModuleCopies[0].size() >= m_modules.size()) and a safe no-op when no helper bundle is present.
  • client/main.cpp: wired loadHelperKernelExtraCopies into both extra-copy paths, each placed after the helper is present in m_modules:
    • Auto path (--icache-rotate-copies=-1): called right after the main-copy loop inside the per-solution setup.
    • Explicit path (--icache-rotate-copies=N, N>0): the main copies load before lazy-load init, so the helper is mirrored in a new block immediately after initializeLazyLoading.

Net effect: helper kernels now truly rotate across I-cache slots instead of resolving only from copy 0, with the getKernel fallback remaining as a defensive backstop.

Test Plan

  • Incrementally rebuilt tensilelite-host (adapter changes) and tensilelite-client (main.cpp changes).
  • Re-run the previously failing benchmark configuration that exercises GSU/PostGSU helper kernels with I-cache rotation enabled (both --icache-rotate-copies=-1 and an explicit --icache-rotate-copies=N) to confirm the launch no longer fails.

Test Result

  • Clean build: main.cpp recompiled and tensilelite-client linked successfully; no linter errors.

Submission Checklist

@therock-pr-bot

therock-pr-bot Bot commented Jul 10, 2026

Copy link
Copy Markdown

❌ PR Check — Action Required

Check Status Details
🌿 Branch Name ✅ Pass
📝 PR Title/Description ❌ Fail Error: Title does not follow Conventional Commits style.
Expected: start with a valid type (feat, fix, docs, …).
Desired format: type(optional-scope): short description
───
Error: PR description must reference a JIRA ID, ISSUE ID, or a GitHub closing keyword.
Expected: include a JIRA ID / ISSUE ID line (separator : or -, or omitted; value may be a JIRA key, a number with/without #, or a link), OR a closing keyword + issue reference. Accepted examples:
JIRA ID : TESTAUTO-6039
JIRA ID - #330
JIRA ID #330
ISSUE ID : TESTUTO-3334
ISSUE ID #3334
ISSUE ID - TESTAUTO-3433
ISSUE ID : https://github.com/<org_name>/<repo_name>/issues/1234
Closes #10
Fixes octo-org/octo-repo#100
Resolves: #123
#123
https://github.com/<org_name>/<repo_name>/issues/123
Current: no valid JIRA/ISSUE/closing-keyword reference found
Forbidden Files ✅ Pass
🧪 Unit Test ❌ Fail Error: Source/code files changed without an accompanying unit test.
Expected: add at least one test file named like test_<name>.py / test_<name>.cpp (or <name>_test.*).
Current: code file(s) changed: projects/hipblaslt/tensilelite/client/main.cpp, projects/hipblaslt/tensilelite/include/Tensile/hip/HipSolutionAdapter.hpp, projects/hipblaslt/tensilelite/src/hip/HipSolutionAdapter.cpp; no test file found
🔎 pre-commit ✅ Pass
🚫 Draft PR 🔜 To Be Enabled
🚩 Feature Flag 🔜 To Be Enabled
📊 Code Coverage 🔜 To Be Enabled

⚠️ 2 policy check(s) failed. Please address the issues above before this PR can be Reviewed.

🚫 Please fix the failed policies

  • ❌ PR Title/Description
  • ❌ Unit Test

The Not ready to Review label was added to this PR. Once all policies pass, the label is removed automatically.

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

@therock-pr-bot

Copy link
Copy Markdown

🚫 Please fix the failed policies before requesting reviews.

The following policy checks failed:

  • ❌ PR Title/Description
  • ❌ Unit Test

The Not ready to Review label has been added to this PR.
Once all policies pass, the label will be removed automatically.

@codecov-commenter

codecov-commenter commented Jul 10, 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 (76.92%) 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    #9266      +/-   ##
===========================================
- Coverage    64.74%   64.73%   -0.00%     
===========================================
  Files         2675     2675              
  Lines       420248   420303      +55     
  Branches     62446    62456      +10     
===========================================
+ Hits        272051   272080      +29     
- Misses      127699   127722      +23     
- Partials     20498    20501       +3     
Flag Coverage Δ *Carryforward flag
TensileLite 34.86% <ø> (+0.02%) ⬆️
hipBLAS 90.81% <ø> (ø) Carriedforward from 8465805
hipBLASLt 34.69% <ø> (-0.02%) ⬇️
hipCUB 82.68% <ø> (ø) Carriedforward from 8465805
hipDNN 86.00% <ø> (ø) Carriedforward from 8465805
hipFFT 50.10% <ø> (ø) Carriedforward from 8465805
hipRAND 76.12% <ø> (ø) Carriedforward from 8465805
hipSOLVER 69.18% <ø> (ø) Carriedforward from 8465805
hipSPARSE 86.10% <ø> (ø) Carriedforward from 8465805
rocBLAS 48.06% <ø> (ø) Carriedforward from 8465805
rocFFT 48.32% <ø> (ø) Carriedforward from 8465805
rocRAND 57.04% <ø> (ø) Carriedforward from 8465805
rocSOLVER 76.92% <ø> (ø) Carriedforward from 8465805
rocSPARSE 72.37% <ø> (ø) Carriedforward from 8465805
rocThrust 91.36% <ø> (ø) Carriedforward from 8465805

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

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