This repository has been archived by the owner on Feb 3, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature: nvBLAS and OpenBLAS plugin (#539)
* add openblas plugin, update gpu docker images with netlib-lgpl * update images and plugins * add nvblas plugin * revert gpu docker image change, add -Pnetlib-lgpl to base images * change configuraitons to functions, add pugins to cluster.yaml
- Loading branch information
Showing
17 changed files
with
164 additions
and
43 deletions.
There are no files selected for viewing
This file contains 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 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 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 |
---|---|---|
@@ -0,0 +1 @@ | ||
from .configuration import * |
This file contains 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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import os | ||
from aztk.models.plugins.plugin_configuration import PluginConfiguration, PluginPort, PluginTargetRole | ||
from aztk.models.plugins.plugin_file import PluginFile | ||
from aztk.utils import constants | ||
|
||
dir_path = os.path.dirname(os.path.realpath(__file__)) | ||
|
||
|
||
def NvBLASPlugin(): | ||
return PluginConfiguration( | ||
name="nvblas", | ||
ports=[], | ||
target_role=PluginTargetRole.All, | ||
execute="nvblas.sh", | ||
files=[ | ||
PluginFile("nvblas.sh", os.path.join(dir_path, "nvblas.sh")), | ||
] | ||
) |
This file contains 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 |
---|---|---|
@@ -0,0 +1,65 @@ | ||
#!/bin/bash | ||
|
||
apt-get update && | ||
apt-get install -y libblas-dev liblapack-dev && | ||
update-alternatives --config libblas.so.3 | ||
update-alternatives --config liblapack.so.3 | ||
|
||
export NVBLAS_CONFIG_FILE=/usr/local/cuda/lib64/nvblas.conf | ||
echo "export NVBLAS_CONFIG_FILE=/usr/local/cuda/lib64/nvblas.conf" >> ~/.bashrc | ||
|
||
echo '# This is the configuration file to use NVBLAS Library | ||
# Setup the environment variable NVBLAS_CONFIG_FILE to specify your own config file. | ||
# By default, if NVBLAS_CONFIG_FILE is not defined, | ||
# NVBLAS Library will try to open the file "nvblas.conf" in its current directory | ||
# Example : NVBLAS_CONFIG_FILE /home/cuda_user/my_nvblas.conf | ||
# The config file should have restricted write permissions accesses | ||
# Specify which output log file (default is stderr) | ||
NVBLAS_LOGFILE /root/nvblas.log | ||
# Enable trace log of every intercepted BLAS calls | ||
NVBLAS_TRACE_LOG_ENABLED | ||
#Put here the CPU BLAS fallback Library of your choice | ||
#It is strongly advised to use full path to describe the location of the CPU Library | ||
NVBLAS_CPU_BLAS_LIB /usr/lib/libblas.so | ||
# List of GPU devices Id to participate to the computation | ||
# Use ALL if you want all your GPUs to contribute | ||
# Use ALL0, if you want all your GPUs of the same type as device 0 to contribute | ||
# However, NVBLAS consider that all GPU have the same performance and PCI bandwidth | ||
# By default if no GPU are listed, only device 0 will be used | ||
#NVBLAS_GPU_LIST 0 2 4 | ||
#NVBLAS_GPU_LIST ALL | ||
NVBLAS_GPU_LIST ALL0 | ||
# Tile Dimension | ||
NVBLAS_TILE_DIM 2048 | ||
# Autopin Memory | ||
NVBLAS_AUTOPIN_MEM_ENABLED | ||
#List of BLAS routines that are prevented from running on GPU (use for debugging purpose | ||
# The current list of BLAS routines supported by NVBLAS are | ||
# GEMM, SYRK, HERK, TRSM, TRMM, SYMM, HEMM, SYR2K, HER2K | ||
#NVBLAS_GPU_DISABLED_SGEMM | ||
#NVBLAS_GPU_DISABLED_DGEMM | ||
#NVBLAS_GPU_DISABLED_CGEMM | ||
#NVBLAS_GPU_DISABLED_ZGEMM | ||
# Computation can be optionally hybridized between CPU and GPU | ||
# By default, GPU-supported BLAS routines are ran fully on GPU | ||
# The option NVBLAS_CPU_RATIO_<BLAS_ROUTINE> give the ratio [0,1] | ||
# of the amount of computation that should be done on CPU | ||
# CAUTION : this option should be used wisely because it can actually | ||
# significantly reduced the overall performance if too much work is given to CPU | ||
#NVBLAS_CPU_RATIO_CGEMM 0.07' > $NVBLAS_CONFIG_FILE | ||
|
||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/libblas:/usr/local/cuda/lib64 | ||
echo "export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/libblas:/usr/local/cuda/lib64" >> ~/.bashrc | ||
export LD_PRELOAD=/usr/local/cuda/lib64/libnvblas.so | ||
echo "export LD_PRELOAD=/usr/local/cuda/lib64/libnvblas.so" >> ~/.bashrc |
This file contains 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 |
---|---|---|
@@ -0,0 +1 @@ | ||
from .configuration import * |
This file contains 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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import os | ||
from aztk.models.plugins.plugin_configuration import PluginConfiguration, PluginPort, PluginTargetRole | ||
from aztk.models.plugins.plugin_file import PluginFile | ||
from aztk.utils import constants | ||
|
||
dir_path = os.path.dirname(os.path.realpath(__file__)) | ||
|
||
|
||
def OpenBLASPlugin(): | ||
return PluginConfiguration( | ||
name="openblas", | ||
ports=[], | ||
target_role=PluginTargetRole.All, | ||
execute="openblas.sh", | ||
files=[ | ||
PluginFile("openblas.sh", os.path.join(dir_path, "openblas.sh")), | ||
], | ||
) |
This file contains 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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/bash | ||
apt-get update && | ||
apt-get install -y libopenblas-base && | ||
update-alternatives --config libblas.so.3 |
This file contains 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 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 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 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 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 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 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 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 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