Rate This Document
Findability
Accuracy
Completeness
Readability

Enabling BLAS Acceleration

BLAS acceleration is used to accelerate linear algebraic operations. Replace the example paths provided in the following procedure with the actual ones.

  1. Use PuTTY to log in to the server as the root user.
  2. Install OpenBLAS.
    yum install openblas gcc-gfortran
  3. (Optional) If PyTorch has been installed, clear the existing compilation files.
    1. Go to the /path/to/pytorch directory.
      cd /path/to/pytorch
    2. Delete the build directory.
      rm -rf ./build
  4. Install PyTorch by following instructions in Basic Installation.

    You do not need to set the BLAS library environment variable. The BLAS library in the user environment is automatically detected during PyTorch compilation. Take OpenBLAS as an example. If OpenBLAS is downloaded, you can see that OpenBLAS is enabled for PyTorch after the build.

    If the BLAS environment variable is set, the BLAS library is forcibly enabled. If no available BLAS library is found, the compilation fails.

  5. Check whether the BLAS feature is enabled.
    ldd build/lib/libtorch.so | grep blas

    If the following information is displayed, BLAS is enabled.