Building and installing hipBLASLt#
This topic describes how to build and install hipBLASLt on Linux systems.
Prerequisites#
To install hipBLASLt, your system must include these components:
A ROCm-enabled platform. For more information, see the ROCm documentation.
A compatible version of hipBLAS.
Installing prebuilt packages#
Download the prebuilt packages from the native package manager for your distribution. For more information, see the ROCm quick start installation guide.
sudo apt update && sudo apt install hipblaslt
Building hipBLASLt using invoke#
hipBLASLt provides an invoke-based task runner for building and installing hipBLASLt and its dependencies. This supports Linux and Windows (ROCm 7.0+).
Note
To build ROCm 6.4 and older, use the hipBLASLt repository at ROCm/hipBLASLt. Select the documentation associated with the release you want to build.
Setting up the environment#
Create a virtual environment and install the Python build dependencies:
python3 -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -r requirements.txt
Building the library dependencies and library#
Here are some typical examples showing how to build the library:
Command |
Description |
|---|---|
|
Help information. |
|
Install system dependencies and build the library. |
|
Build the library. Assumes dependencies are already installed. |
|
Build the library and install the hipBLASLt package. |
Building the library, client, and all dependencies#
The client contains the executables listed in the table below.
Executable Name |
Description |
|---|---|
|
Runs GoogleTest tests to test the library |
|
Executable to benchmark or test individual functions |
Here are some common ways to build the dependencies, library, and client:
Command |
Description |
|---|---|
|
Help information. |
|
Install system dependencies and build the library and client. |
|
Build the library and client. Assumes dependencies are already installed. |
|
Build everything and install the hipBLASLt package. |
Static library#
To build a static library, use the --static option.
This produces a non-standard static library build. This means it has an additional runtime dependency
consisting of the entire hipblaslt/ subdirectory, which is located in the /opt/rocm/lib folder.
You can move this folder, but you must set the environment variable HIPBLASLT_TENSILE_LIBPATH
to the new location.
Dependencies#
Python dependencies are listed in requirements.txt and installed via pip install -r requirements.txt.
System dependencies (such as compilers and NUMA) can be installed by passing --install-deps to inv build.
Manual build for all supported platforms#
This section provides information on how to configure CMake and build manually using individual commands.
Building the library manually#
Before building hipBLASLt manually, ensure the following dependencies are installed on your system:
The hipBLAS-common header files.
The ROC-tracer (ROC-TX) library (this is typically pre-installed).
Building hipBLASLt#
To build hipBLASLt, run these commands:
mkdir -p [HIPBLASLT_BUILD_DIR]/release
cd [HIPBLASLT_BUILD_DIR]/release
# Default install location is in /opt/rocm, define -DCMAKE_INSTALL_PREFIX=<path> to specify other
# Default build config is 'Release', define -DCMAKE_BUILD_TYPE=<config> to specify other
CXX=/opt/rocm/bin/amdclang++ ccmake [HIPBLASLT_SOURCE]
make -j$(nproc)
sudo make install # sudo required if installing into system directory such as /opt/rocm
Building the library, tests, benchmarks, and samples manually#
The repository contains source code for clients that serve as samples, tests, and benchmarks.
You can find this code in the clients subdirectory.
Dependencies for the hipBLASLt clients#
The hipBLASLt samples have no external dependencies, but the unit test and benchmarking applications do. These clients introduce the following dependencies:
LAPACK, which adds a dependency on a Fortran compiler
Building the hipBLASLt clients#
GoogleTest and LAPACK are not easy to install. Many Linux distributions don’t provide a GoogleTest package
with precompiled libraries and the LAPACK packages don’t have the necessary CMake configuration files
to allow the cmake command to configure links with the cblas library. hipBLASLt provides an optional CMake script that builds
the above dependencies from source. You can provide your own builds for
these dependencies and help cmake find them by setting the CMAKE_PREFIX_PATH definition.
Follow this sequence of steps to build the dependencies and install them to the default CMake directory /usr/local.
Build the dependencies from source (optional).
mkdir -p [HIPBLASLT_BUILD_DIR]/release/deps cd [HIPBLASLT_BUILD_DIR]/release/deps ccmake -DBUILD_BOOST=OFF [HIPBLASLT_SOURCE]/deps # assuming boost is installed through package manager as above make -j$(nproc) install
After the dependencies are available on the system, configure the clients to build. This requires adding a few extra flags to the library CMake configuration script. If the dependencies are not installed in the system default directories, like
/usr/local, pass theCMAKE_PREFIX_PATHtocmaketo help CMake find them.-DCMAKE_PREFIX_PATH="<semicolon separated paths>" # Default install location is in /opt/rocm, use -DCMAKE_INSTALL_PREFIX=<path> to specify other CXX=/opt/rocm/bin/amdclang++ ccmake -DBUILD_CLIENTS_TESTS=ON -DBUILD_CLIENTS_BENCHMARKS=ON [HIPBLASLT_SOURCE] make -j$(nproc) sudo make install # sudo required if installing into system directory such as /opt/rocm