Repository navigation
Ship libtensilelite-host.so in its own tensilelite-host package #12372
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
talumbau
wants to merge
3
commits into
develop
Choose a base branch
from
tja/tlh-r2-tensilelite-pkg
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+100
−6
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -899,6 +899,86 @@ if(HIPBLASLT_ENABLE_CLIENT AND HIPBLASLT_ENABLE_SAMPLES) | |
| rocm_package_setup_client_component(samples) | ||
| endif() | ||
|
|
||
| # libtensilelite-host.so ships as its own package (tensilelite-host) instead of | ||
| # inside hipblaslt's runtime component, so hipSPARSELt can depend on the one | ||
| # ~6.5 MB shared library without pulling hipblaslt's ~1.6 GB of Tensile kernel | ||
| # binaries. See AIHPBLAS-4434. | ||
| # | ||
| # Guard on the target TYPE rather than BUILD_SHARED_LIBS: at this scope | ||
| # BUILD_SHARED_LIBS holds HIPBLASLT_BUILD_SHARED_LIBS, which describes | ||
| # libhipblaslt, not tensilelite-host. The two are set independently | ||
| # (TENSILELITE_BUILD_SHARED_LIBS vs HIPBLASLT_BUILD_SHARED_LIBS), so only the | ||
| # target's own TYPE says whether there is a .so to package. | ||
| if(TARGET tensilelite-host) | ||
| get_target_property(_tensilelite_host_type tensilelite-host TYPE) | ||
| if(_tensilelite_host_type STREQUAL "SHARED_LIBRARY") | ||
| rocm_package_setup_component(tensilelite | ||
| LIBRARY_NAME tensilelite | ||
| PACKAGE_NAME host | ||
| ) | ||
|
|
||
| # rocm-cmake's packaging defaults set CPACK_RPM_PACKAGE_AUTOREQPROV to | ||
| # Off for every ROCm library, so no package currently Provides or | ||
| # Requires a soname. Re-enable rpmbuild's ELF scanning for this one | ||
| # component: tensilelite-host then Provides | ||
| # libtensilelite-host.so.1()(64bit), derived from the binary rather | ||
| # than hand-written, so the capability tracks SOVERSION automatically. | ||
| # This is scoped to the component and does not change any other | ||
| # package's dependency surface. | ||
| set(CPACK_RPM_TENSILELITE_PACKAGE_AUTOREQPROV "ON") | ||
|
|
||
| # CPack uses CPACK_RPM_<COMPONENT>_PACKAGE_REQUIRES *instead of* the | ||
| # global CPACK_RPM_PACKAGE_REQUIRES when the component-scoped variable | ||
| # is defined (CPackRPM.cmake:1098-1106). Defining a runtime-scoped | ||
| # dependency therefore drops every global one -- hipblaslt's runtime | ||
| # package silently lost "roctracer >= 1.0.0" and "rocm-core". | ||
| # | ||
| # Carry the global list into the component before adding anything, and | ||
| # add rocm-core explicitly because rocm_package_add_rocm_core_dependency | ||
| # appends it to the global list from inside rocm_create_package, which | ||
| # runs after this point. | ||
| if(CPACK_RPM_PACKAGE_REQUIRES) | ||
| rocm_package_add_rpm_dependencies(COMPONENT runtime | ||
| DEPENDS "${CPACK_RPM_PACKAGE_REQUIRES}") | ||
| endif() | ||
| if(ROCM_DEP_ROCMCORE) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Where is |
||
| if(ENABLE_ASAN_PACKAGING) | ||
| rocm_package_add_rpm_dependencies(COMPONENT runtime DEPENDS "rocm-core-asan") | ||
| else() | ||
| rocm_package_add_rpm_dependencies(COMPONENT runtime DEPENDS "rocm-core") | ||
| endif() | ||
| endif() | ||
|
|
||
| # hipBLASLt's own libhipblaslt.so carries DT_NEEDED on this soname, so | ||
| # the runtime package must require it. Stated as the soname capability | ||
| # rather than a package name: the dynamic linker enforces the same | ||
| # string, and a SOVERSION bump updates both sides together. | ||
| rocm_package_add_rpm_dependencies(COMPONENT runtime | ||
| DEPENDS "libtensilelite-host.so.1()(64bit)") | ||
|
Comment on lines
+956
to
+957
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are we hardcoding a |
||
|
|
||
| # Same component-shadows-global rule applies on the Debian side. | ||
| if(CPACK_DEBIAN_PACKAGE_DEPENDS) | ||
| rocm_package_add_deb_dependencies(COMPONENT runtime | ||
| DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}") | ||
| endif() | ||
| if(ROCM_DEP_ROCMCORE) | ||
| if(ENABLE_ASAN_PACKAGING) | ||
| rocm_package_add_deb_dependencies(COMPONENT runtime DEPENDS "rocm-core-asan") | ||
| else() | ||
| rocm_package_add_deb_dependencies(COMPONENT runtime DEPENDS "rocm-core") | ||
| endif() | ||
| endif() | ||
|
|
||
| # Debian gets no soname dependency here, so name the package. No | ||
| # version constraint: tensilelite-host is versioned with hipBLASLt only | ||
| # until it has a version of its own, and an exact pin would record that | ||
| # coupling in package metadata. The SOVERSION is the ABI contract. | ||
| rocm_package_add_deb_dependencies(COMPONENT runtime | ||
| DEPENDS "tensilelite-host") | ||
| endif() | ||
| unset(_tensilelite_host_type) | ||
| endif() | ||
|
|
||
| if(ROCM_LIBS_SUPERBUILD OR NOT HIPBLASLT_IS_SUBPROJECT) | ||
| set(HIPBLASLT_CONFIG_DIR "\${CPACK_PACKAGING_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}" CACHE PATH "Path placed into ldconfig file") | ||
| rocm_create_package( | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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.