Skip to content

Ship libtensilelite-host.so in its own tensilelite-host package - #12372

Open
talumbau wants to merge 3 commits into
developfrom
tja/tlh-r2-tensilelite-pkg
Open

talumbau wants to merge 3 commits into
developfrom
tja/tlh-r2-tensilelite-pkg

Conversation

@talumbau

Copy link
Copy Markdown
Collaborator

Why

hipSPARSELt needs exactly one thing out of the hipBLASLt build at run time: the ~6.5 MB shared library libtensilelite-host.so. Today that library is installed into hipBLASLt's runtime component, so the only way to depend on it is to depend on the whole hipblaslt package.

Measured on a gfx942 drop build:

hipblaslt package 1141 MB
of which Tensile kernel data hipSPARSELt never loads 466 MB
libtensilelite-host.so 6.5 MB

That is the cost AIHPBLAS-4434 was filed to avoid.

What

Two commits.

1. Ship the library in its own package. The LIBRARY/RUNTIME artefacts of tensilelite-host move into a new tensilelite CPack component, named tensilelite-host via LIBRARY_NAME + PACKAGE_NAME. The static archive and public headers stay in devel — they are build-time only, and hipsparselt-devel already depends on hipblaslt-devel.

The component is declared only when tensilelite-host is actually a shared library. The check reads the target TYPE property rather than BUILD_SHARED_LIBS, because that variable is assigned later in the same file (~line 805) and is not reliable at packaging scope.

This also widens the install-pkg glob in tasks.py: hipBLASLt no longer produces only hipblaslt-* packages, and installing just that glob leaves the .so on the floor — a downstream find_package(hipblaslt) then fails on the imported roc::tensilelite-host target pointing at a file that was never installed.

2. Declare hipBLASLt's dependency on it. Three things that must land together:

  • Publish the soname. rocm-cmake's defaults set CPACK_RPM_PACKAGE_AUTOREQPROV to Off for every ROCm library, so rpmbuild's ELF scan never runs and nothing Provides/Requires a soname. AIHPBLAS-4434 assumed re-enabling it would be a repo-wide change; CPack in fact supports per-component overrides (CPackRPM.cmake:1098-1106), so it is scoped to the new component alone. tensilelite-host then Provides libtensilelite-host.so.1()(64bit), derived from the binary rather than hand-written, so the capability tracks SOVERSION automatically.
  • Pin the version. hipblaslt, hipsparselt and tensilelite-host are intended to move together within a ROCm release, so this is an exact pin rather than the >= floor used for hipblas-common.
  • Preserve the global dependency list. CPack uses CPACK_RPM_<COMPONENT>_PACKAGE_REQUIRES instead of the global CPACK_RPM_PACKAGE_REQUIRES once the component variable exists. Without this, adding any runtime-scoped dependency silently drops roctracer >= 1.0.0 and rocm-core from the hipblaslt package.

Result

tensilelite-host  Provides:  libtensilelite-host.so.1()(64bit)
                             tensilelite-host = 1.5.0.70002-<release>
hipblaslt         Requires:  libtensilelite-host.so.1()(64bit)
                             tensilelite-host = 1.5.0.70002
                             rocm-core
                             roctracer >= 1.0.0

tensilelite-host is 1.2 MB.

TheRock impact: none

CPack/RPM-only. TheRock claims artifacts by path glob from a cmake --install tree (math-libs/BLAS/artifact-blas.toml), not by CPack component. A plain cmake --install emits all components and the installed path of the .so is unchanged.

Known limitation

The pin is on VERSION, not VERSION-RELEASE. Two builds from different commits share a VERSION and differ only in RELEASE, so this gives release lockstep, not ABI safety. Only SOVERSION discipline (AIHPBLAS-3522 decision D7) gives the latter.

Testing

gfx942, ROCm 7.0.2, RHEL 9.5. hipblaslt-test --gtest_filter=*smoke*: 3,118 passed. ldd reports no missing libraries. Full install-scenario matrix in the linked plan.

Refs AIHPBLAS-4434, AIHPBLAS-3522.

@therock-pr-bot

therock-pr-bot Bot commented Sep 21, 2026 •

Copy link
Copy Markdown

❌ PR Check — Action Required

Check Status Details
📝 PR Description ❌ Fail 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
• JIRA ID (on separate line)
ROCM-25757
• ISSUE ID : TESTUTO-3334
• ISSUE ID #3334
• ISSUE ID - TESTAUTO-3433
• ISSUE ID (on separate line)
AIRUNTIME-2352
• 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 ⚠️ Warning 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/tasks.py; no test file found
🔎 pre-commit ✅ Pass —
🚫 Draft PR 🔜 To Be Enabled —
🚩 Feature Flag 🔜 To Be Enabled —
📊 Code Coverage 🔜 To Be Enabled —

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

🚫 Please fix the failed policies

  • ❌ PR Description

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.

🙋 Wish to Override Policy?

@therock-pr-bot

Copy link
Copy Markdown

🚫 Please fix the failed policies before requesting reviews.

The following policy checks failed:

  • ❌ PR Description

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

@codecov

codecov Bot commented Sep 21, 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 (48.80%) 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   #12372      +/-   ##
===========================================
+ Coverage    70.24%   70.99%   +0.74%     
===========================================
  Files         2933     2935       +2     
  Lines       482160   483201    +1041     
  Branches     69508    69696     +188     
===========================================
+ Hits        338677   343008    +4331     
+ Misses      119197   116278    -2919     
+ Partials     24286    23915     -371     
Flag Coverage Δ *Carryforward flag
TensileLite-CPP 48.80% <ø> (-0.01%) ⬇️
TensileLite-Unit 82.58% <ø> (+5.09%) ⬆️
hipBLAS 90.62% <ø> (ø) Carriedforward from 91ba6b0
hipBLASLt 35.28% <ø> (ø) Carriedforward from 91ba6b0
hipCUB 82.68% <ø> (ø) Carriedforward from 91ba6b0
hipDNN 86.96% <ø> (ø) Carriedforward from 91ba6b0
hipFFT 54.32% <ø> (ø) Carriedforward from 91ba6b0
hipRAND 76.12% <ø> (ø) Carriedforward from 91ba6b0
hipSOLVER 68.96% <ø> (ø) Carriedforward from 91ba6b0
hipSPARSE 86.99% <ø> (ø) Carriedforward from 91ba6b0
rocBLAS 48.31% <ø> (ø) Carriedforward from 91ba6b0
rocFFT 52.36% <ø> (ø) Carriedforward from 91ba6b0
rocRAND 57.42% <ø> (ø) Carriedforward from 91ba6b0
rocSOLVER 76.83% <ø> (ø) Carriedforward from 91ba6b0
rocSPARSE 74.76% <ø> (ø) Carriedforward from 91ba6b0
rocThrust 78.34% <ø> (ø) Carriedforward from 91ba6b0

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

@newling

newling commented Sep 23, 2026

Copy link
Copy Markdown
Contributor

@talumbau just to confirm that you would like a review of this PR? Asking as it is currently Draft

@talumbau
talumbau marked this pull request as ready for review September 23, 2026 23:12
@talumbau
talumbau requested review from a team as code owners September 23, 2026 23:12
talumbau and others added 2 commits September 23, 2026 23:21
libtensilelite-host.so was installed into hipblaslt's runtime component, so
the only way for hipSPARSELt to obtain it at run time is to depend on the
whole hipblaslt package. Measured on a 7.0.2 drop build that package is
1600.6 MB, of which 466.5 MB is Tensile kernel data hipSPARSELt never uses,
to supply one 6.5 MB shared library.

Move the LIBRARY/RUNTIME artefacts of tensilelite-host into a new
"tensilelite" CPack component, named tensilelite-host via LIBRARY_NAME +
PACKAGE_NAME. The static archive and the public headers stay in devel:
they are build-time only and hipsparselt-devel already depends on
hipblaslt-devel.

The component is declared only when tensilelite-host is actually a shared
library. The check reads the target TYPE property rather than
BUILD_SHARED_LIBS, because that variable is assigned later in this file
(~line 805) and is therefore not reliable at the packaging scope.

Refs AIHPBLAS-4434, AIHPBLAS-3522.

Co-Authored-By: Claude <noreply@anthropic.com>
libhipblaslt.so carries DT_NEEDED on libtensilelite-host.so.1, so the
hipblaslt runtime package must say so now that the library ships separately.
Three things are needed together; splitting them leaves the package in a
state that is worse than before.

1. Publish the soname. rocm-cmake's packaging defaults set
   CPACK_RPM_PACKAGE_AUTOREQPROV to Off for every ROCm library, so rpmbuild's
   ELF scanning never runs and nothing Provides or Requires a soname today.
   AIHPBLAS-4434 assumed re-enabling it would be a repo-wide change; CPack in
   fact supports per-component overrides (CPackRPM.cmake:1098-1106 falls back
   from CPACK_RPM_<COMPONENT>_PACKAGE_<TAG> to the global tag), so it can be
   scoped to the tensilelite component alone. tensilelite-host then Provides
   libtensilelite-host.so.1()(64bit), derived from the binary rather than
   hand-written, so the capability tracks SOVERSION automatically.

2. Pin the version. hipblaslt, hipsparselt and tensilelite-host are intended
   to move together within one ROCm release, so the dependency is an exact
   version rather than the >= floor used for hipblas-common.
   CPACK_PACKAGE_VERSION is computed inside rocm_create_package
   (ROCMCreatePackage.cmake:281,296) from PROJECT_VERSION_* plus
   ROCM_LIBPATCH_VERSION, and rocm_package_add_*_dependencies must be called
   before rocm_create_package, so the same value is recomputed here.

3. Preserve the global dependency list. CPack uses
   CPACK_RPM_<COMPONENT>_PACKAGE_REQUIRES *instead of* the global
   CPACK_RPM_PACKAGE_REQUIRES once the component variable exists, so adding
   any runtime-scoped dependency silently drops the global ones. Without this
   the hipblaslt package loses "roctracer >= 1.0.0" and "rocm-core"; measured
   on a gfx942 build its runtime Requires became just /bin/sh plus the soname.
   rocm-core is added explicitly because rocm_package_add_rocm_core_dependency
   appends it from inside rocm_create_package, after this point.

Resulting hipblaslt runtime Requires:

    libtensilelite-host.so.1()(64bit)
    rocm-core
    roctracer >= 1.0.0
    tensilelite-host = 1.5.0.70002

The pin is on VERSION, not VERSION-RELEASE: two builds from different commits
share a VERSION and differ only in RELEASE, so this gives release lockstep,
not ABI safety. Only SOVERSION discipline (AIHPBLAS-3522 decision D7) gives
the latter.

Refs AIHPBLAS-4434.

Co-Authored-By: Claude <noreply@anthropic.com>
@talumbau
talumbau force-pushed the tja/tlh-r2-tensilelite-pkg branch from 94d7eae to 91ba6b0 Compare September 23, 2026 23:22
Comment on lines +195 to +201
# The shared library ships in its own "tensilelite" component (package
# tensilelite-host) rather than hipblaslt's runtime component. hipSPARSELt
# needs this one ~6.5 MB .so; bundling it in hipblaslt's runtime package
# would force every hipSPARSELt install to pull ~1.6 GB of Tensile kernel
# binaries it does not use. See AIHPBLAS-4434.
# The static archive and headers stay in devel: they are build-time only,
# and hipsparselt-devel already depends on hipblaslt-devel.

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.

Please remove all of the generated comments unless they are essential. We aren't doing anything here that is atypical for cmake.

# Guard on the target TYPE rather than BUILD_SHARED_LIBS: that variable is not
# reliably set at this scope (it is assigned further down, near line 805), so
# testing it here would silently skip the component in a shared build.
if(TARGET tensilelite-host)

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 is fragile and non-deterministic. Prefer to gate on a config option.

rocm_package_add_rpm_dependencies(COMPONENT runtime
DEPENDS "${CPACK_RPM_PACKAGE_REQUIRES}")
endif()
if(ROCM_DEP_ROCMCORE)

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.

Where is ROCM_DEP_ROCMCORE introduced?

Comment on lines +954 to +955
rocm_package_add_rpm_dependencies(COMPONENT runtime
DEPENDS "libtensilelite-host.so.1()(64bit)")

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.

Are we hardcoding a .1 here?

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

The "Why" makes sense to me. One thing we might consider in the future reconsidering the directory structure around hipblaslt and tensilelite, as tensilelite is a standalone thing.

For the "What", with my blurry vision this looks fine to me too. To get into more into the debian/cmake details that I don't have a good intuition for, I got an agent review (see here). It references David's preceding review. It has an accompanying branch with commits corresponding to each suggestion. Feel free to cherry-pick / ignore.

Drop the tensilelite-host version pin; mark devel placement as interim

hipblaslt's runtime package pinned tensilelite-host to hipBLASLt's exact
package version. That records "tensilelite version equals hipBLASLt
version" in package metadata, which a standalone tensilelite package
would have to undo. It also rebuilt CPACK_PACKAGE_VERSION by hand
because the real value is computed later inside rocm_create_package, so
a change to rocm-cmake's formula would break the pin silently.

Remove the pin and the version recomputation. RPM keeps the soname
dependency libtensilelite-host.so.1()(64bit). DEB gets no soname
dependency, so it now depends on tensilelite-host with no version.

Reword the install comment so the archive, headers and imported target
living in hipblaslt-devel read as interim, not as the intended layout.
Fix the TYPE-guard comment: BUILD_SHARED_LIBS at that point holds
HIPBLASLT_BUILD_SHARED_LIBS, which is independent of
TENSILELITE_BUILD_SHARED_LIBS.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
talumbau added a commit that referenced this pull request Oct 16, 2026
…12888)

JIRA ID : AIHPBLAS-4434

## Motivation

hipSPARSELt uses the TensileLite host library at run time but does not
need hipBLASLt's large kernel-data package. The existing split placed
TensileLite files in components owned by hipBLASLt, which also forced
those packages to use the hipBLASLt version. This change makes
TensileLite an independently versioned CMake and packaging project while
preserving hipBLASLt and hipSPARSELt consumption.

## Technical Details

- Define the TensileLite project version with
`TENSILELITE_PROJECT_VERSION`, initially `1.5.0`, and install
`tensilelite-config.cmake` with the `roc::tensilelite-host` export.
- Generate independent shared, static-development, and AddressSanitizer
packages through `rocm_create_package`. Nested package components use
distinct names so they cannot enter hipBLASLt packages.
- Keep the existing `make package` entry point by running the nested
TensileLite CPack configuration after hipBLASLt packaging.
- Make hipBLASLt depend on the matching TensileLite runtime and
development package versions. Keep hipSPARSELt's CMake dependency on
hipBLASLt while changing its runtime package dependency to
`tensilelite-host`.
- Preserve bundled Origami as a separate static development package and
retain upgrade metadata for files formerly owned by hipBLASLt packages.

## Related

- Work tracking: AIHPBLAS-4434
- Related PR: #12372

## Device / Architecture Coverage

This changes CMake exports and package construction without changing
kernels, dispatch, or device behavior. Host builds used `gfx942` as the
configured target; automated GitHub build and packaging checks are
pending.

## Test Plan

- Build and package hipBLASLt with shared and static TensileLite
configurations.
- Build and package TensileLite directly as a standalone project.
- Verify AddressSanitizer packaging contains the TensileLite shared
library and license.
- Configure and link consumers of the shared and static
`roc::tensilelite-host` exports and the `roc::hipblaslt` export.
- Exercise the TheRock dependency-provider flow through Origami,
hipBLASLt, and hipSPARSELt.
- Upgrade from the pre-split Debian packages and check package-manager
consistency.

## Test Result

- Shared hipBLASLt build passed; one CPack invocation produced
`hipblaslt`, `hipblaslt-dev`, `tensilelite-host`,
`tensilelite-host-dev`, and `origami-static-dev`.
- Static TensileLite build passed and produced
`tensilelite-host-static-dev` and `origami-static-dev` without empty
runtime or development packages.
- Standalone and AddressSanitizer builds and Debian packaging passed.
The AddressSanitizer package contains `libtensilelite-host.so` and
depends on `rocm-core-asan`.
- Shared and static package consumers configured and linked
successfully.
- TheRock Origami, hipBLASLt, and hipSPARSELt configure, build, install,
and artifact classification passed.
- Debian upgrade testing completed with `apt` status 0 and a clean `dpkg
--audit` result.
- The local full TensileLite Python suite was attempted: 7,845 passed
and 452 skipped; 50 failed and 22 errored because the host lacks
`/usr/bin/amdclang++` and gfx1250 support. The failures do not touch the
changed CMake packaging paths.
- Automated GitHub checks are pending.

## Submission Checklist

- [ ] Look over the contributing guidelines at
https://github.com/ROCm/TheRock/blob/main/GOVERNANCE.md#pull-requests.

## Risk level

Medium (3/5): this changes package ownership, dependency metadata, and
installed CMake exports across TensileLite, hipBLASLt, Origami, and
hipSPARSELt. It does not change runtime or device code.

---------

Co-authored-by: T.J. Alumbaugh <talumbau@amd.com>
Co-authored-by: Claude <noreply@anthropic.com>

This branch has not been deployed

No deployments
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