GithubHelp home page GithubHelp logo

rocm / hipblas Goto Github PK

View Code? Open in Web Editor NEW
106.0 37.0 71.0 10.98 MB

ROCm BLAS marshalling library

Home Page: https://rocm.docs.amd.com/projects/hipBLAS/en/latest/index.html

License: Other

CMake 0.46% C 0.03% C++ 82.88% Shell 0.21% Groovy 0.12% Fortran 14.46% Python 1.78% Asymptote 0.06%
blas cuda rocm hip

hipblas's Introduction

hipBLAS

hipBLAS is a Basic Linear Algebra Subprograms (BLAS) marshalling library with multiple supported backends. It sits between your application and a 'worker' BLAS library, where it marshals inputs to the backend library and marshals results to your application. hipBLAS exports an interface that doesn't require the client to change, regardless of the chosen backend. Currently, hipBLAS supports rocBLAS and cuBLAS backends.

To use hipBLAS, you must first install rocBLAS, rocSPARSE, and rocSOLVER or cuBLAS.

Documentation

Documentation for hipBLAS is available at https://rocm.docs.amd.com/projects/hipBLAS/en/latest/.

To build our documentation locally, use the following code:

cd docs

pip3 install -r sphinx/requirements.txt

python3 -m sphinx -T -E -b html -d _build/doctrees -D language=en . _build/html

Alternatively, build with CMake:

cmake -DBUILD_DOCS=ON ...

Build and install

  1. Download the hipBLAS source code (clone this repository):

        git clone https://github.com/ROCmSoftwarePlatform/hipBLAS.git
        hipBLAS requires specific versions of rocBLAS and rocSOLVER. Refer to
        [CMakeLists.txt](https://github.com/ROCmSoftwarePlatform/hipBLAS/blob/develop/library/CMakeLists.txt)
        for details.
    
  2. Build hipBLAS and install it into /opt/rocm/hipblas:

        cd hipblas
        ./install.sh -i

Interface examples

The hipBLAS interface is compatible with rocBLAS and cuBLAS-v2 APIs. Porting a CUDA application that originally calls the cuBLAS API to an application that calls the hipBLAS API is relatively straightforward. For example, the hipBLAS SGEMV interface is:

GEMV API

hipblasStatus_t
hipblasSgemv( hipblasHandle_t handle,
              hipblasOperation_t trans,
              int m, int n, const float *alpha,
              const float *A, int lda,
              const float *x, int incx, const float *beta,
              float *y, int incy );

Batched and strided GEMM API

hipBLAS GEMM can process matrices in batches with regular strides by using the strided-batched version of the API:

hipblasStatus_t
hipblasSgemmStridedBatched( hipblasHandle_t handle,
              hipblasOperation_t transa, hipblasOperation_t transb,
              int m, int n, int k, const float *alpha,
              const float *A, int lda, long long bsa,
              const float *B, int ldb, long long bsb, const float *beta,
              float *C, int ldc, long long bsc,
              int batchCount);

hipBLAS assumes matrix A and vectors x, y are allocated in GPU memory space filled with data. You are responsible for copying data to and from the host and device memory.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.