Skip to content

build(hipblaslt): package TensileLite independently (AIHPBLAS-4434) - #12888

Merged
talumbau merged 12 commits into
ROCm:developfrom
davidd-amd:users/davidd-amd/tensilelite-standalone-package
Oct 16, 2026
Merged

talumbau merged 12 commits into
ROCm:developfrom
davidd-amd:users/davidd-amd/tensilelite-standalone-package

Conversation

@davidd-amd

Copy link
Copy Markdown
Contributor

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

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

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.

@therock-pr-bot

therock-pr-bot Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

✅ All Checks Passed — Ready for Review

Check Status Details
📝 PR Description ✅ Pass —
⛔ 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, projects/hipblaslt/tensilelite/include/Tensile/KernelLanguageTypes.hpp, projects/hipblaslt/tensilelite/include/Tensile/MLFeatures.hpp, projects/hipblaslt/tensilelite/include/Tensile/MLPClassification.hpp, projects/hipblaslt/tensilelite/include/Tensile/ScalarValueTypes.hpp; no test file found
🔎 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 1, 2026

Copy link
Copy Markdown

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

@codecov

codecov Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #12888      +/-   ##
===========================================
- Coverage    76.02%   73.59%   -2.44%     
===========================================
  Files         2867     2862       -5     
  Lines       474745   473437    -1308     
  Branches     71078    70670     -408     
===========================================
- Hits        360919   348383   -12536     
- Misses       89313   100856   +11543     
+ Partials     24513    24198     -315     
Flag Coverage Δ *Carryforward flag
TensileLite-CPP 49.70% <ø> (ø)
TensileLite-Unit 83.60% <ø> (ø)
hipBLAS 90.62% <ø> (ø) Carriedforward from 0bd420e
hipBLASLt 66.03% <ø> (ø)
hipCUB 82.68% <ø> (ø) Carriedforward from 0bd420e
hipDNN 86.80% <ø> (-0.08%) ⬇️ Carriedforward from 0bd420e
hipFFT 42.13% <ø> (+0.12%) ⬆️ Carriedforward from 0bd420e
hipRAND 76.12% <ø> (ø) Carriedforward from 0bd420e
hipSOLVER 68.96% <ø> (-0.71%) ⬇️ Carriedforward from 0bd420e
hipSPARSE 86.99% <ø> (ø) Carriedforward from 0bd420e
rocBLAS 48.21% <ø> (-20.52%) ⬇️ Carriedforward from 0bd420e
rocFFT 47.25% <ø> (-0.85%) ⬇️ Carriedforward from 0bd420e
rocRAND 57.59% <ø> (+0.29%) ⬆️ Carriedforward from 0bd420e
rocSOLVER 76.83% <ø> (+0.09%) ⬆️ Carriedforward from 0bd420e
rocSPARSE 76.63% <ø> (-0.29%) ⬇️ Carriedforward from 0bd420e
rocThrust 93.15% <ø> (ø) Carriedforward from 0bd420e

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

@davidd-amd
davidd-amd marked this pull request as ready for review October 2, 2026 15:04
@davidd-amd
davidd-amd requested review from a team as code owners October 2, 2026 15:04

@talumbau talumbau left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for splitting this out. I found two problems that I think would break installs (automatic RPM Requires, and the invoke build -n package globs) and three smaller packaging gaps. Details are in the inline comments.

Comment thread projects/hipblaslt/tasks.py Resolved
Comment thread projects/hipblaslt/CMakeLists.txt Resolved
Comment thread projects/hipblaslt/CMakeLists.txt Resolved
Comment thread projects/hipblaslt/CMakeLists.txt Resolved
Comment thread projects/hipblaslt/CMakeLists.txt Resolved

@talumbau talumbau left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-reviewed the current head (db73c93fdcd) — my earlier comments were against 0cfd444eea5 and GitHub has marked them all outdated, so please ignore those. I built this branch for gfx942 and inspected the resulting RPMs rather than reading the diff alone.

Confirmed fixed since that revision: the origami-static install globs, tensilelite_standalone.cmake is gone, the ASAN Replaces/Breaks now resolve to hipblaslt-asan, and the global dependency carry-over works on the hipBLASLt side. The package split itself looks good:

tensilelite-host-1.5.0.70002          1.3 MB   <- owns libtensilelite-host.so*
tensilelite-host-devel-1.5.0.70002    2.0 MB
origami-static-devel-1.5.0.70002      0.2 MB
hipblaslt-1.5.0.70002              1247.4 MB

hipblaslt Requires:        rocm-core, roctracer >= 1.0.0, tensilelite-host
tensilelite-host Requires: rocm-core

Three things I'd raise.


1. The RPM dependency on tensilelite-host is unversioned, but the DEB one isn't. (projects/hipblaslt/CMakeLists.txt:948 vs :963)

# line 948 (RPM)
    DEPENDS "${_tensilelite_runtime_package}")
# line 963 (DEB)
    DEPENDS "${_tensilelite_runtime_package} >= ${_tensilelite_package_version}")

Confirmed on the built package — rpm -qpR hipblaslt-1.5.0.70002-*.rpm gives a bare tensilelite-host with no version constraint. So on RPM any tensilelite-host satisfies any hipblaslt, which drops the version coupling the ticket asks for. The asymmetry with the DEB line looks unintentional.

2. Nothing Provides or Requires the soname.

$ rpm -qp --provides tensilelite-host-1.5.0.70002-*.rpm
tensilelite-host = 1.5.0.70002-.el9
tensilelite-host(x86-64) = 1.5.0.70002-.el9

No libtensilelite-host.so.1()(64bit). With AUTOREQPROV removed, the dependency is by package name only and nothing binds it to the ABI actually shipped — a SOVERSION bump wouldn't propagate to consumers. If the concern was the auto-Requires side-effects, CPACK_RPM_<COMPONENT>_PACKAGE_AUTOPROV ON gives the Provides without them. Happy to be told this is deliberate.

3. hipSPARSELt didn't get the same carry-over fix hipBLASLt got. (projects/hipsparselt/CMakeLists.txt:261-265)

rocm_package_add_dependencies(
    COMPONENT runtime
    DEPENDS tensilelite-host
)

CPack uses CPACK_RPM_<COMPONENT>_PACKAGE_REQUIRES instead of the global CPACK_RPM_PACKAGE_REQUIRES once the component variable exists, so this drops rocm-core from the hipsparselt package — the same issue the new code at hipblaslt/CMakeLists.txt:934-945 handles correctly. Given hipBLASLt got the fix, this looks like an oversight rather than a decision. It also inherits finding 1 (unversioned).


Minor: HEADER_ONLY on rocm_create_package for a package that ships a real .so (tensilelite_packaging.cmake:117) reads oddly. Its effects appear gated on ROCM_USE_DEV_COMPONENT, which is set OFF eleven lines above, so I think it's inert rather than wrong — but what is it there for?

Caveat on my testing: I cloned with --shared, so git describe returned empty in the build container and the release fields came out blank (1.5.0.70002-.el9). That doesn't affect package names, Requires, Provides or file placement, but I have not verified release-string behaviour.

Not blocking on any of this — finding 1 is the one I'd want resolved before merge. Note the branch is currently conflicting with develop and ASAN is red, so there's a rebase coming anyway.

@davidd-amd
davidd-amd force-pushed the users/davidd-amd/tensilelite-standalone-package branch from db73c93 to ec576f9 Compare October 13, 2026 15:55
talumbau and others added 10 commits October 13, 2026 15:58
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>
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>
@davidd-amd
davidd-amd force-pushed the users/davidd-amd/tensilelite-standalone-package branch 2 times, most recently from ec576f9 to c61b576 Compare October 13, 2026 15:59
@davidd-amd

Copy link
Copy Markdown
Contributor Author

Thanks for rebuilding and checking the generated RPMs.

I rebased the branch onto the current develop head and addressed findings 1 and 3:

  • The hipBLASLt RPM now requires tensilelite-host >= 1.5.0, matching the DEB dependency.
  • The shared TheRock hipSPARSELt package now preserves the global rocm-core requirement and adds the same versioned TensileLite dependency.
  • I also removed the inert HEADER_ONLY argument.

I regenerated the packages and checked the actual RPM metadata. Both hipblaslt and hipsparselt now require:

rocm-core
tensilelite-host >= 1.5.0

I left soname auto-provides disabled. That was deliberate in the earlier packaging review, and enabling AUTOPROV alone would only advertise the soname; it would not make hipBLASLt require that capability. If we want RPM-level binary-interface binding in addition to the package version floor, we should choose explicitly between a soname requirement and targeted automatic Requires/Provides rather than adding only the Provides side.

@davidd-amd
davidd-amd requested a review from talumbau October 13, 2026 17:48

@talumbau talumbau left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-reviewed and built the current head (c61b57624b6) for gfx942. Findings 1 and 3 from my previous review are resolved — RPM and DEB now both carry tensilelite-host >= ${_tensilelite_package_version}, and hipSPARSELt has the full globals + rocm-core carry-over. Thanks.

One new issue, which I'd like fixed before merge.

The TensileLite packages ship with an empty RPM Release / Debian revision.

hipblaslt              VERSION=1.5.0.70002  RELEASE=c61b57624b6.el9
tensilelite-host       VERSION=1.5.0.70002  RELEASE=.el9
tensilelite-host-devel VERSION=1.5.0.70002  RELEASE=.el9
origami-static-devel   VERSION=1.5.0.70002  RELEASE=.el9

producing filenames like tensilelite-host-1.5.0.70002-.el9.x86_64.rpm. git describe resolved fine in that build — hipBLASLt picked up c61b57624b6 from the same tree — so this is specific to the nested packages.

Cause. rocm-cmake derives the release from PROJECT_VERSION_TWEAK:

# ROCMCreatePackage.cmake
elseif(PROJECT_VERSION_TWEAK)
    string(REPLACE "-" "_" RPM_RELEASE ${PROJECT_VERSION_TWEAK})
endif()

hipBLASLt sets that at CMakeLists.txt:43 via rocm_get_git_commit_tag(PROJECT_VERSION_TWEAK). But tensilelite/CMakeLists.txt:14 then calls

project(tensilelite VERSION "${TENSILELITE_PROJECT_VERSION}" LANGUAGES CXX)

and TENSILELITE_PROJECT_VERSION is "1.5.0" — three components, so CMake sets PROJECT_VERSION_TWEAK to empty for that scope. Minimal repro:

OUTER tweak                 = 'abc123def'
SUB before project()  tweak = 'abc123def'
SUB after  project()  tweak = ''
SUB inside block()    tweak = ''

By the time tensilelite_packaging.cmake runs at line 259 — inside or outside the block() — the tweak is gone, so RPM_RELEASE is never set.

Suggested fix. Re-derive it after project(), the same way hipBLASLt does. In tensilelite/CMakeLists.txt, after the fetch_rocm_cmake include at line 21 so rocm_get_git_commit_tag is available:

# project() above resets PROJECT_VERSION_TWEAK from the VERSION argument, which
# has no fourth component. rocm-cmake builds the RPM Release and Debian revision
# from PROJECT_VERSION_TWEAK, so re-derive it here or the TensileLite packages
# ship with an empty release field.
rocm_get_git_commit_tag(PROJECT_VERSION_TWEAK)

That covers both the nested and TENSILELITE_STANDALONE paths, since both call rocm_create_package from this scope. Setting CPACK_RPM_PACKAGE_RELEASE / CPACK_DEBIAN_PACKAGE_RELEASE in the environment would also work, but pushes the burden onto every caller.

Worth deciding explicitly whether TensileLite's release should track the same commit as hipBLASLt's, or be independent now that the project is independently versioned — the above gives the former.

I have not tested the fix, only the diagnosis. The mechanism is proven, but whether rocm_get_git_commit_tag is callable at that point depends on what fetch_rocm_cmake has pulled in by then — worth confirming rather than taking my word.

For completeness, I also missed this in my previous review: that build used a --shared clone, git describe failed inside the container, and every release came out blank, so I wrote it off as my own harness. It wasn't.

Still open from before, not blocking: nothing Provides or Requires the soname (libtensilelite-host.so.1()(64bit)), so the coupling is by package name only and a SOVERSION bump wouldn't propagate. CPACK_RPM_<COMPONENT>_PACKAGE_AUTOPROV ON would give the Provides without the auto-Requires side effects, if that was the concern.

@talumbau

Copy link
Copy Markdown
Collaborator

Two things I'd like settled rather than defaulted, both about what the tensilelite-host dependency is meant to guarantee.

1. soname coupling. Nothing currently Provides or Requires libtensilelite-host.so.1()(64bit), so the dependency is by package name only. That means a future SOVERSION bump isn't caught: if TensileLite ships .so.2 with a version bump, tensilelite-host >= 1.5.0.70002 is still satisfied, dnf upgrades cleanly, and hipBLASLt then fails at load with cannot open shared object file: libtensilelite-host.so.1. The package manager had enough information to refuse and wasn't told to.

I'd like the safe option here. Provider side is one line in tensilelite_packaging.cmake:

set(CPACK_RPM_TENSILELITE_PACKAGE_AUTOPROV "ON")

AUTOPROV rather than AUTOREQPROV, so it adds the Provides without the auto-Requires that were the earlier concern. Then the matching Requires on each consumer, in hipblaslt/CMakeLists.txt and hipsparselt/CMakeLists.txt:

rocm_package_add_rpm_dependencies(COMPONENT runtime
    DEPENDS "libtensilelite-host.so.1()(64bit)")

The soname is derived from the binary by rpmbuild, so it tracks SOVERSION automatically and nobody has to remember to update it.

2. >= vs exact pin. The current constraint is a floor. The intent for this series was that hipblaslt, hipsparselt and tensilelite-host move together within a ROCm release, which argues for = rather than >=. If independent versioning is meant to relax that deliberately, that's a reasonable position — I'd just like it to be a decision rather than a default.

Worth stating plainly either way: neither of these catches ABI drift within soname 1. That remains AIHPBLAS-3522's D7 and is a SOVERSION-discipline commitment, not something packaging can enforce.

@davidd-amd

Copy link
Copy Markdown
Contributor Author

Local package validation: minimum TensileLite version and package release

This reports local validation of the uncommitted candidate based on c61b57624b6. The candidate has not been pushed. The source was intentionally dirty, so generated package releases contain c61b57624b6_dirty; a committed build will use the new clean commit hash.

The candidate makes three packaging corrections:

  • Express the runtime relationship through the normal rocm-cmake package dependency: tensilelite-host >= 1.5.0.
  • Keep ROCM_LIBPATCH_VERSION=1001 in the built package version without requiring consumers to match that patch build.
  • Restore the Git commit as the RPM Release and Debian revision after project(tensilelite VERSION 1.5.0) clears PROJECT_VERSION_TWEAK.

It does not add AUTOPROV, automatic soname scanning, or a libtensilelite-host.so.1()(64bit) dependency.

Configuration and build matrix

All tests used the offline pr12888-gfx950-rpmbuild:local image, CMake 3.27.9, GPU_TARGETS=gfx950, and ROCM_LIBPATCH_VERSION=1001.

Path Configure Compile Package
Integrated hipBLASLt + shared TensileLite Passed Passed RPM/TGZ/ZIP passed
Integrated hipBLASLt + static TensileLite Passed Not run in this focused check Metadata generated
Standalone shared TensileLite Passed Passed RPM/TGZ/ZIP passed
Standalone static TensileLite Passed Not run in this focused check Metadata generated
Shared TheRock-mode hipSPARSELt consuming the extracted integrated RPM set Passed Passed RPM/TGZ/ZIP passed

The downstream test extracted the generated integrated RPMs into a clean prefix, verified that libtensilelite-host.so.1.0.1001 existed, configured hipSPARSELt against that prefix, linked libhipsparselt.so, and generated the hipSPARSELt packages.

Representative commands:

ROCM_LIBPATCH_VERSION=1001 cmake -S projects/hipblaslt -B <integrated-shared> \
  -DGPU_TARGETS=gfx950 \
  -DHIPBLASLT_ENABLE_DEVICE=OFF \
  -DHIPBLASLT_ENABLE_CLIENT=OFF \
  -DHIPBLASLT_ENABLE_ROCROLLER=OFF
cmake --build <integrated-shared> --target package --parallel 8

ROCM_LIBPATCH_VERSION=1001 cmake -S projects/hipblaslt/tensilelite -B <standalone-shared> \
  -DGPU_TARGETS=gfx950 \
  -DTENSILELITE_ENABLE_CLIENT=OFF \
  -DTENSILELITE_BUILD_TESTING=OFF
cmake --build <standalone-shared> --target package --parallel 8

Generated dependency and version metadata

Actual RPM query results:

hipblaslt
  VERSION=1.5.0.1001
  RELEASE=c61b57624b6_dirty.el8
  Requires: rocm-core, tensilelite-host >= 1.5.0

tensilelite-host
  VERSION=1.5.0.1001
  RELEASE=c61b57624b6_dirty.el8
  Provides:
    tensilelite-host = 1.5.0.1001-c61b57624b6_dirty.el8
    tensilelite-host(x86-64) = 1.5.0.1001-c61b57624b6_dirty.el8

hipsparselt
  VERSION=0.2.9.1001
  RELEASE=c61b57624b6_dirty.el8
  Requires: rocm-core, tensilelite-host >= 1.5.0

Generated Debian metadata uses the equivalent native syntax:

hipblaslt:  Depends: rocm-core, tensilelite-host (>= 1.5.0)
hipsparselt: Depends: rocm-core, tensilelite-host (>= 1.5.0)
TensileLite Debian revision: c61b57624b6~dirty

Install manifest

The nested and standalone TensileLite RPM payload manifests are identical. The manifest below lists each distinct validated package layout once.

hipblaslt runtime (9 entries)
/opt
/opt/rocm
/opt/rocm/lib64
/opt/rocm/lib64/libhipblaslt.so.1
/opt/rocm/lib64/libhipblaslt.so.1.5.1001
/opt/rocm/share
/opt/rocm/share/doc
/opt/rocm/share/doc/hipblaslt
/opt/rocm/share/doc/hipblaslt/LICENSE.md
hipblaslt-devel (28 entries)
/opt
/opt/rocm
/opt/rocm/include
/opt/rocm/include/hipblaslt
/opt/rocm/include/hipblaslt-export.h
/opt/rocm/include/hipblaslt-version.h
/opt/rocm/include/hipblaslt/hipblaslt-export.h
/opt/rocm/include/hipblaslt/hipblaslt-ext-op.h
/opt/rocm/include/hipblaslt/hipblaslt-ext.hpp
/opt/rocm/include/hipblaslt/hipblaslt-opt-in-features.h
/opt/rocm/include/hipblaslt/hipblaslt-types.h
/opt/rocm/include/hipblaslt/hipblaslt-version.h
/opt/rocm/include/hipblaslt/hipblaslt.h
/opt/rocm/include/hipblaslt/hipblaslt_bfloat6.h
/opt/rocm/include/hipblaslt/hipblaslt_e5m3.h
/opt/rocm/include/hipblaslt/hipblaslt_e8.h
/opt/rocm/include/hipblaslt/hipblaslt_float4.h
/opt/rocm/include/hipblaslt/hipblaslt_float6.h
/opt/rocm/include/hipblaslt/hipblaslt_float8.h
/opt/rocm/lib64
/opt/rocm/lib64/cmake
/opt/rocm/lib64/cmake/hipblaslt
/opt/rocm/lib64/cmake/hipblaslt/hipblaslt-config-version.cmake
/opt/rocm/lib64/cmake/hipblaslt/hipblaslt-config.cmake
/opt/rocm/lib64/cmake/hipblaslt/hipblaslt-package-config.cmake
/opt/rocm/lib64/cmake/hipblaslt/hipblaslt-targets-release.cmake
/opt/rocm/lib64/cmake/hipblaslt/hipblaslt-targets.cmake
/opt/rocm/lib64/libhipblaslt.so
tensilelite-host runtime (10 entries)
/opt
/opt/rocm
/opt/rocm/lib64
/opt/rocm/lib64/libtensilelite-host.so
/opt/rocm/lib64/libtensilelite-host.so.1
/opt/rocm/lib64/libtensilelite-host.so.1.0.1001
/opt/rocm/share
/opt/rocm/share/doc
/opt/rocm/share/doc/tensilelite-host
/opt/rocm/share/doc/tensilelite-host/LICENSE.md
tensilelite-host-devel (115 entries)
/opt
/opt/rocm
/opt/rocm/include
/opt/rocm/include/Tensile
/opt/rocm/include/Tensile/AMDGPU.hpp
/opt/rocm/include/Tensile/AMDGPUPredicates.hpp
/opt/rocm/include/Tensile/AMDGPU_Detail.hpp
/opt/rocm/include/Tensile/Activation.hpp
/opt/rocm/include/Tensile/CachingLibrary.hpp
/opt/rocm/include/Tensile/Comparison.hpp
/opt/rocm/include/Tensile/ContractionLibrary.hpp
/opt/rocm/include/Tensile/ContractionProblem.hpp
/opt/rocm/include/Tensile/ContractionProblemPredicates.hpp
/opt/rocm/include/Tensile/ContractionProblemProperties.hpp
/opt/rocm/include/Tensile/ContractionProblem_Detail.hpp
/opt/rocm/include/Tensile/ContractionProblem_fwd.hpp
/opt/rocm/include/Tensile/ContractionSolution.hpp
/opt/rocm/include/Tensile/ContractionSolution_fwd.hpp
/opt/rocm/include/Tensile/ContractionTaskPredicates.hpp
/opt/rocm/include/Tensile/Contractions.hpp
/opt/rocm/include/Tensile/DataTypes.hpp
/opt/rocm/include/Tensile/DataTypes_BFloat16.hpp
/opt/rocm/include/Tensile/DataTypes_BFloat6.hpp
/opt/rocm/include/Tensile/DataTypes_E5M3.hpp
/opt/rocm/include/Tensile/DataTypes_E8.hpp
/opt/rocm/include/Tensile/DataTypes_Float4.hpp
/opt/rocm/include/Tensile/DataTypes_Float6.hpp
/opt/rocm/include/Tensile/DataTypes_Float8_BFloat8.hpp
/opt/rocm/include/Tensile/DataTypes_Half.hpp
/opt/rocm/include/Tensile/DataTypes_Int8.hpp
/opt/rocm/include/Tensile/DataTypes_Int8x4.hpp
/opt/rocm/include/Tensile/DataTypes_XFloat32.hpp
/opt/rocm/include/Tensile/Debug.hpp
/opt/rocm/include/Tensile/Distance.hpp
/opt/rocm/include/Tensile/DistinctType.hpp
/opt/rocm/include/Tensile/EmbeddedLibrary.hpp
/opt/rocm/include/Tensile/ExactLogicLibrary.hpp
/opt/rocm/include/Tensile/FreeSizeLibrary.hpp
/opt/rocm/include/Tensile/FusedA2AKernArg.hpp
/opt/rocm/include/Tensile/GranularitySelectionLibrary.hpp
/opt/rocm/include/Tensile/KernelArguments.hpp
/opt/rocm/include/Tensile/KernelLanguageTypes.hpp
/opt/rocm/include/Tensile/MLFeatures.hpp
/opt/rocm/include/Tensile/MLPClassification.hpp
/opt/rocm/include/Tensile/MLPClassificationLibrary.hpp
/opt/rocm/include/Tensile/MapLibrary.hpp
/opt/rocm/include/Tensile/MasterSolutionLibrary.hpp
/opt/rocm/include/Tensile/MatchingLibrary.hpp
/opt/rocm/include/Tensile/PerformanceMetricTypes.hpp
/opt/rocm/include/Tensile/PlaceholderLibrary.hpp
/opt/rocm/include/Tensile/PredicateDebugger.hpp
/opt/rocm/include/Tensile/Predicates.hpp
/opt/rocm/include/Tensile/PredictionLibrary.hpp
/opt/rocm/include/Tensile/ProblemKey.hpp
/opt/rocm/include/Tensile/Properties.hpp
/opt/rocm/include/Tensile/PropertyMatching.hpp
/opt/rocm/include/Tensile/ScalarValueTypes.hpp
/opt/rocm/include/Tensile/Serialization
/opt/rocm/include/Tensile/Serialization.hpp
/opt/rocm/include/Tensile/Serialization/Base.hpp
/opt/rocm/include/Tensile/Serialization/Containers.hpp
/opt/rocm/include/Tensile/Serialization/ContractionPredicates.hpp
/opt/rocm/include/Tensile/Serialization/ContractionSolution.hpp
/opt/rocm/include/Tensile/Serialization/ExactLogicLibrary.hpp
/opt/rocm/include/Tensile/Serialization/FreeSizeLibrary.hpp
/opt/rocm/include/Tensile/Serialization/GranularitySelectionLibrary.hpp
/opt/rocm/include/Tensile/Serialization/HasTraits.hpp
/opt/rocm/include/Tensile/Serialization/MLFeatures.hpp
/opt/rocm/include/Tensile/Serialization/MLPClassificationLibrary.hpp
/opt/rocm/include/Tensile/Serialization/MapLibrary.hpp
/opt/rocm/include/Tensile/Serialization/MatchingLibrary.hpp
/opt/rocm/include/Tensile/Serialization/PlaceholderLibrary.hpp
/opt/rocm/include/Tensile/Serialization/Predicates.hpp
/opt/rocm/include/Tensile/Serialization/PredictionLibrary.hpp
/opt/rocm/include/Tensile/Serialization/Properties.hpp
/opt/rocm/include/Tensile/Serialization/SolutionLibrary.hpp
/opt/rocm/include/Tensile/SingleSolutionLibrary.hpp
/opt/rocm/include/Tensile/Singleton.hpp
/opt/rocm/include/Tensile/SolutionBlobCache.hpp
/opt/rocm/include/Tensile/SolutionLibrary.hpp
/opt/rocm/include/Tensile/SolutionLibrary_fwd.hpp
/opt/rocm/include/Tensile/Task.hpp
/opt/rocm/include/Tensile/Tensile.hpp
/opt/rocm/include/Tensile/Tensile_fwd.hpp
/opt/rocm/include/Tensile/TensorDescriptor.hpp
/opt/rocm/include/Tensile/TensorDescriptor_Detail.hpp
/opt/rocm/include/Tensile/TensorDescriptor_fwd.hpp
/opt/rocm/include/Tensile/TensorOps.hpp
/opt/rocm/include/Tensile/TensorOps_fwd.hpp
/opt/rocm/include/Tensile/Utils.hpp
/opt/rocm/include/Tensile/UtilsOrigami.hpp
/opt/rocm/include/Tensile/geom.hpp
/opt/rocm/include/Tensile/hip
/opt/rocm/include/Tensile/hip/HipHardware.hpp
/opt/rocm/include/Tensile/hip/HipSolutionAdapter.hpp
/opt/rocm/include/Tensile/hip/HipUtils.hpp
/opt/rocm/include/Tensile/msgpack
/opt/rocm/include/Tensile/msgpack/MessagePack.hpp
/opt/rocm/include/rocisa
/opt/rocm/include/rocisa/include
/opt/rocm/include/rocisa/include/enum.hpp
/opt/rocm/include/tensilelitehost
/opt/rocm/include/tensilelitehost/export.h
/opt/rocm/lib64
/opt/rocm/lib64/cmake
/opt/rocm/lib64/cmake/tensilelite
/opt/rocm/lib64/cmake/tensilelite/hipblaslt_codegen.cmake
/opt/rocm/lib64/cmake/tensilelite/tensilelite-config-version.cmake
/opt/rocm/lib64/cmake/tensilelite/tensilelite-config.cmake
/opt/rocm/lib64/cmake/tensilelite/tensilelite-targets-release.cmake
/opt/rocm/lib64/cmake/tensilelite/tensilelite-targets.cmake
/opt/rocm/lib64/hipblaslt
/opt/rocm/lib64/hipblaslt/rocisa
/opt/rocm/lib64/hipblaslt/rocisa/__init__.py
/opt/rocm/lib64/hipblaslt/rocisa/_rocisa.cpython-312-x86_64-linux-gnu.so
origami-static-devel (26 entries)
/opt
/opt/rocm
/opt/rocm/include
/opt/rocm/include/origami
/opt/rocm/include/origami/attention.hpp
/opt/rocm/include/origami/gemm.hpp
/opt/rocm/include/origami/hardware.hpp
/opt/rocm/include/origami/heuristics.hpp
/opt/rocm/include/origami/logger.hpp
/opt/rocm/include/origami/math.hpp
/opt/rocm/include/origami/origami.hpp
/opt/rocm/include/origami/origami_export.h
/opt/rocm/include/origami/simulator
/opt/rocm/include/origami/simulator/tensilelite
/opt/rocm/include/origami/simulator/tensilelite/formocast.hpp
/opt/rocm/include/origami/simulator/tensilelite/formocast_simulator.hpp
/opt/rocm/include/origami/streamk.hpp
/opt/rocm/include/origami/types.hpp
/opt/rocm/lib64
/opt/rocm/lib64/cmake
/opt/rocm/lib64/cmake/origami
/opt/rocm/lib64/cmake/origami/origami-config-version.cmake
/opt/rocm/lib64/cmake/origami/origami-config.cmake
/opt/rocm/lib64/cmake/origami/origami-targets-release.cmake
/opt/rocm/lib64/cmake/origami/origami-targets.cmake
/opt/rocm/lib64/liborigami.a
hipsparselt runtime (10 entries)
/opt
/opt/rocm
/opt/rocm/lib
/opt/rocm/lib/libhipsparselt.so
/opt/rocm/lib/libhipsparselt.so.0
/opt/rocm/lib/libhipsparselt.so.0.2.1001
/opt/rocm/share
/opt/rocm/share/doc
/opt/rocm/share/doc/hipsparselt
/opt/rocm/share/doc/hipsparselt/LICENSE.md
hipsparselt-devel (14 entries)
/opt
/opt/rocm
/opt/rocm/include
/opt/rocm/include/hipsparselt
/opt/rocm/include/hipsparselt/hipsparselt-export.h
/opt/rocm/include/hipsparselt/hipsparselt-version.h
/opt/rocm/include/hipsparselt/hipsparselt.h
/opt/rocm/lib
/opt/rocm/lib/cmake
/opt/rocm/lib/cmake/hipsparselt
/opt/rocm/lib/cmake/hipsparselt/hipsparselt-config-version.cmake
/opt/rocm/lib/cmake/hipsparselt/hipsparselt-config.cmake
/opt/rocm/lib/cmake/hipsparselt/hipsparselt-targets-release.cmake
/opt/rocm/lib/cmake/hipsparselt/hipsparselt-targets.cmake

git diff --check passed. Automated GitHub checks for this unpushed candidate have not run.

@davidd-amd

Copy link
Copy Markdown
Contributor Author

Decision on HEADER_ONLY

We are keeping HEADER_ONLY in this PR as the current rocm-cmake workaround.

Nested TensileLite installs its shared library into a custom component named tensilelite, which is mapped to the tensilelite-host package. Without HEADER_ONLY, rocm_create_package() also adds its automatic runtime component and gives it the same tensilelite-host package name:

CPACK_COMPONENTS_ALL = runtime;tensilelite-devel;tensilelite;origami-devel
CPACK_RPM_RUNTIME_PACKAGE_NAME = tensilelite-host
CPACK_RPM_TENSILELITE_PACKAGE_NAME = tensilelite-host

The automatic runtime component is empty because the library belongs to the custom tensilelite component. Both components generate the same RPM filename, so the empty package can overwrite the package containing the shared library.

Passing HEADER_ONLY suppresses only that automatic runtime component. The custom tensilelite component still packages:

libtensilelite-host.so
libtensilelite-host.so.1
libtensilelite-host.so.1.0.1001

The option name is misleading: this is not a header-only package. We chose the existing workaround for this PR and documented why it is required.

I filed ROCm/rocm-cmake#305 to add a properly named option for projects whose runtime payload is already owned by custom components.

@talumbau
talumbau merged commit 5758e0d into ROCm:develop Oct 16, 2026
185 of 189 checks passed
assistant-librarian Bot pushed a commit to ROCm/mxDataGenerator that referenced this pull request Oct 16, 2026
build(hipblaslt): package TensileLite independently
 (AIHPBLAS-4434) (#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.
@assistant-librarian

Copy link
Copy Markdown
Contributor

TheRock Submodule Bump Activity

Newest first

talumbau added a commit that referenced this pull request Oct 28, 2026
## Why

`HIPSPARSELT_ENABLE_THEROCK` selects the path where hipSPARSELt consumes
a staged hipBLASLt package via `find_package` and links the shared
`libtensilelite-host.so`, instead of pulling hipBLASLt in with
`add_subdirectory` and recompiling TensileLite into `libhipsparselt.so`.

The option defaults `OFF` and there is currently **no way to turn it on
from outside the source tree**:

- `install-host.sh` builds `cmake_common_options` from a closed set of
flags — no `$@`, no `--cmake-args` passthrough
- `tasks.py build()` has a fixed keyword list with no corresponding
entry

So any packaging build always takes the duplicating path. On a 7.0.2
drop build that means `libhipsparselt.so` carries 8,787 hidden
TensileLite symbols and 5,774 `ContractionProblemGemm` strings, with no
`DT_NEEDED` on `libtensilelite-host.so.1`.

## What this unblocks

This is the switch that lets the hipBLASLt/hipSPARSELt drop pipeline
pick up the TensileLite deduplication from #12888. Measured on gfx942:

| | current drop build | with `--therock` |
|---|---|---|
| `libhipsparselt.so` | 7.43 MB | 0.92 MB |
| TensileLite symbols inside it | 8,787 | 127 |
| `DT_NEEDED` on tensilelite | none | `libtensilelite-host.so.1` |

It also activates the hipSPARSELt packaging work already merged in
#12888. That dependency is gated on

```cmake
if(HIPSPARSELT_ENABLE_HIP AND (HIPSPARSELT_ENABLE_THEROCK OR NOT BUILD_SHARED_LIBS))
```

which is false in the current drop build, so no `tensilelite-host`
dependency is emitted at all today — the shipped `hipsparselt` RPM
requires only `rocm-core`. Without this PR, #12888's hipSPARSELt half
never runs in the RPM path.

## What it changes

Adds a `--therock` flag to `install-host.sh` and a matching `therock=`
keyword to `tasks.py build()`, so a CI driver can select the shared
path. 21 lines, purely plumbing.

**Additive and opt-in. No defaults change** — the `add_subdirectory`
path remains the default for standalone builds and is unaffected.

## Ordering

Should land **after #12373**. Enabling `THEROCK=ON` without those fixes
produces a hipSPARSELt whose clients fail to link (`dlange_`,
`_gfortran_*`) and whose `hipsparselt-test` cannot find `libomp.so`,
because `THEROCK=ON` also forces TheRock's `cblas` target — which
outside TheRock is netlib CBLAS with no LAPACK. #12373 separates those
two concerns.

The companion rocJenkins change that actually passes the flag is held
until this merges.

## TheRock impact: none

TheRock configures CMake directly via `therock_cmake_subproject_declare`
and does not use `install-host.sh` or `tasks.py`.

Refs AIHPBLAS-3522, AIHPBLAS-4434.

Co-authored-by: Claude <noreply@anthropic.com>
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