You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A BLAS implementation on top of AMD's Radeon Open Compute [ROCm][] runtime and toolchains. rocBLAS is implemented in
3
-
the [HIP][] programming language and optimized for AMD's latest discrete GPUs.
2
+
A BLAS implementation on top of AMD's Radeon Open Compute [ROCm][] runtime and toolchains. rocBLAS is implemented in the [HIP][] programming language and optimized for AMD's latest discrete GPUs.
4
3
5
-
## rocBLAS Wiki
6
-
The [wiki][] has helpful information about building the rocBLAS library, samples and tests.
4
+
## Installing pre-built packages
5
+
Download pre-built packages either from [ROCm's package servers](https://rocm.github.io/install.html#installing-from-amd-rocm-repositories) or by clicking the github releases tab and manually downloading, which could be newer. Release notes are available for each release on the releases tab.
6
+
*`sudo apt update && sudo apt install rocblas`
7
+
8
+
## Quickstart rocBLAS build
7
9
8
-
## Building rocBLAS
9
10
#### Bash helper build script (Ubuntu only)
10
11
The root of this repository has a helper bash script `install.sh` to build and install rocBLAS on Ubuntu with a single command. It does not take a lot of options and hard-codes configuration that can be specified through invoking cmake directly, but it's a great way to get started quickly and can serve as an example of how to build/install. A few commands in the script need sudo access, so it may prompt you for a password.
11
12
*`./install -h` -- shows help
12
-
*`./install -id` -- common install flags
13
-
14
-
### Manual build (all supported platforms)
15
-
The build infrastructure for rocBLAS is based on [Cmake](https://cmake.org/) v3.5. This is the version of cmake available on ROCm supported platforms. Examples of installing cmake:
16
-
* Ubuntu: `sudo apt install cmake-qt-gui`
17
-
* Fedora: `sudo dnf install cmake-gui`
18
-
19
-
### Library
20
-
The rocBLAS library has one dependency named [Tensile](https://github.com/ROCmSoftwarePlatform/Tensile), which supplies the high-performance implementation of xGEMM. Tensile is downloaded by cmake during library configuration and automatically configured as part of the build, so no further action is required by the user to set it up. Tensile is predominately written in python2.7 (not python3), so it does bring python dependencies which can easily be installed with distro package managers. The rocBLAS library contains both host and device code, so the HCC compiler must be specified during cmake configuration to properly initialize build tools. Example steps to build rocBLAS:
# Default install location is in /opt/rocm, define -DCMAKE_INSTALL_PREFIX=<path> to specify other
31
-
# Default build config is 'Release', define -DCMAKE_BUILD_TYPE=<config> to specify other
32
-
CXX=/opt/rocm/bin/hcc ccmake [ROCBLAS_SOURCE]
33
-
make -j$(nproc)
34
-
sudo make install # sudo required if installing into system directory such as /opt/rocm
35
-
```
13
+
*`./install -id` -- build library, build dependencies and install (-d flag only needs to be passed once on a system)
36
14
37
-
### rocBLAS clients
38
-
The repository contains source for clients that serve as samples, tests and benchmarks. Clients source can be found in the clients subdir.
15
+
##Manual build (all supported platforms)
16
+
If you use a distro other than Ubuntu, or would like more control over the build process, the [rocblas build wiki](https://github.com/RadeonOpenCompute/rocBLAS/wiki/Build) has helpful information on how to configure cmake and manually build.
39
17
40
-
### Dependencies (only necessary for rocBLAS clients)
41
-
The rocBLAS samples have no external dependencies, but our unit test and benchmarking applications do. These clients introduce the following dependencies:
Unfortunately, googletest and lapack are not as easy to install. Many distros do not provide a googletest package with pre-compiled libraries, and the lapack packages do not have the necessary cmake config files for cmake to configure linking the cblas library. rocBLAS provide a cmake script that builds the above dependencies from source. This is an optional step; users can provide their own builds of these dependencies and help cmake find them by setting the CMAKE_PREFIX_PATH definition. The following is a sequence of steps to build dependencies and install them to the cmake default /usr/local.
53
-
54
-
#### (optional, one time only)
55
-
```bash
56
-
mkdir -p [ROCBLAS_BUILD_DIR]/release/deps
57
-
cd [ROCBLAS_BUILD_DIR]/release/deps
58
-
ccmake -DBUILD_BOOST=OFF [ROCBLAS_SOURCE]/deps # assuming boost is installed through package manager as above
59
-
make -j$(nproc) install
60
-
```
61
-
62
-
Once dependencies are available on the system, it is possible to configure the clients to build. This requires a few extra cmake flags to the library cmake configure script. If the dependencies are not installed into system defaults (like /usr/local ), you should pass the CMAKE_PREFIX_PATH to cmake to help find them.
sudo make install # sudo required if installing into system directory such as /opt/rocm
69
-
```
70
-
71
-
#### CUDA build errata
72
-
rocBLAS is written with HiP kernels, so it should build and run on CUDA platforms. However, currently the cmake infrastructure is broken
73
-
with a CUDA backend. However, a BLAS marshalling library that presents a common interface for both ROCm and CUDA backends can be found with [hipBLAS](https://github.com/ROCmSoftwarePlatform/hipBLAS).
74
-
75
-
## Migrating libraries to ROCm from OpenCL
76
-
[clBLAS][] demonstrated significant performance benefits of data parallel (GPU) computation when applied to solving dense
77
-
linear algebra problems, but OpenCL primarily remains in the domain of expert programmers. The ROCm model introduces a
78
-
single source paradigm for integrating device and host code together in a single source file, thereby simplifying the
79
-
entire development process for heterogeneous computing. Compilers will get smarter, catching errors at compile/build time
80
-
and native profilers/debuggers will better integrate into the development process. As AMD simplifies the
81
-
programming model with ROCm (using HCC and HIP), it is the intent of this library to expose that simplified programming
82
-
model to end users.
83
-
84
-
## rocBLAS interface
85
-
In general, the rocBLAS interface is compatible with Legacy [Netlib BLAS][] and the cuBLAS-v2 API, with
86
-
the explicit exception that Legacy BLAS does not have handle. The cuBLAS' cublasHandle_t is replaced
21
+
## rocBLAS interface examples
22
+
In general, the rocBLAS interface is compatible with CPU oriented [Netlib BLAS][] and the cuBLAS-v2 API, with
23
+
the explicit exception that traditional BLAS interfaces do not accept handles. The cuBLAS' cublasHandle_t is replaced
87
24
with rocblas_handle everywhere. Thus, porting a CUDA application which originally calls the cuBLAS API
88
25
to a HIP application calling rocBLAS API should be relatively straightforward. For example, the rocBLAS
0 commit comments