WIP don't change the LAPACK link #26
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
name: test-mkl-ubuntu-latest | |
on: | |
push: | |
branches: | |
- intel-mkl-action | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ${{ matrix.config.os }} | |
env: | |
C_INCLUDE_PATH: "$C_INCLUDE_PATH:/opt/OpenBLAS/include" | |
CPATH: "$CPATH:/opt/OpenBLAS/include" | |
LIBRARY_PATH: "$LIBRARY_PATH:/opt/OpenBLAS/lib" | |
LD_LIBRARY_PATH: "$LD_LIBRARY_PATH:/opt/OpenBLAS/lib" | |
OPENBLAS_DIR: "/opt/OpenBLAS" | |
USE_THREAD: 1 | |
NUM_THREADS: 64 | |
DYNAMIC_ARCH: 0 | |
NO_WARMUP: 1 | |
BUILD_RELAPACK: 0 | |
COMMON_OPT: "-O2 -march=native" | |
CFLAGS: "-O2 -march=native" | |
FCOMMON_OPT: "-O2 -march=native" | |
FCFLAGS: "-O2 -march=native" | |
strategy: | |
fail-fast: false | |
matrix: | |
config: | |
- {os: ubuntu-latest, r: 'release'} | |
steps: | |
- name: Print CPU info | |
shell: bash | |
run: | | |
lscpu | |
# - name: add oneAPI to apt | |
# shell: bash | |
# run: | | |
# cd /tmp | |
# wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | |
# sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | |
# rm GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | |
# sudo add-apt-repository "deb https://apt.repos.intel.com/oneapi all main" | |
- name: Restore cached OpenBlas | |
id: cache-openblas | |
uses: actions/cache/restore@v4 | |
with: | |
path: ${{ env.OPENBLAS_DIR }} | |
key: ${{ runner.os }}-openblas | |
# - name: Install oneAPI | |
- name: Clone and install latest OpenBLAS | |
if: steps.cache-openblas.outputs.cache-hit != 'true' | |
shell: bash | |
run: | | |
git clone https://github.com/xianyi/OpenBLAS.git | |
cd OpenBLAS | |
git checkout v0.3.26 | |
sudo mkdir $OPENBLAS_DIR | |
make -j DYNAMIC_ARCH=0 CC=gcc FC=gfortran HOSTCC=gcc BINARY=64 INTERFACE=64 LIBNAMESUFFIX=threaded | |
sudo make PREFIX=$OPENBLAS_DIR LIBNAMESUFFIX=threaded install | |
- name: Cache OpenBLAS | |
uses: actions/cache/save@v4 | |
with: | |
path: ${{ env.OPENBLAS_DIR }} | |
key: ${{ steps.cache-openblas.outputs.cache-primary-key }} | |
- uses: r-lib/actions/setup-r@v2 | |
with: | |
r-version: ${{ matrix.config.r }} | |
http-user-agent: ${{ matrix.config.http-user-agent }} | |
use-public-rspm: true | |
- uses: r-lib/actions/setup-r-dependencies@v2 | |
with: | |
packages: | | |
any::microbenchmark | |
- name: Check R sessionInfo | |
shell: Rscript {0} | |
run: | | |
sessionInfo() | |
# - name: check R performance | |
# shell: Rscript {0} | |
# run: | | |
# library(microbenchmark) | |
# microbenchmark( | |
# rnorm(1000000), | |
# times = 10000 | |
# ) | |
# - name: install oneAPI MKL library | |
# shell: bash | |
# run: | | |
# sudo apt install intel-mkl libmkl-dev | |
# - name: Update Alternatives | |
# shell: bash | |
# run: | | |
# sudo update-alternatives --install /usr/lib/x86_64-linux-gnu/libblas64.so libblas64.so-x86_64-linux-gnu /usr/lib/x86_64-linux-gnu/libmkl_rt.so 150 | |
# sudo update-alternatives --install /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3 libblas64.so.3-x86_64-linux-gnu /usr/lib/x86_64-linux-gnu/libmkl_rt.so 150 | |
# # sudo update-alternatives --install /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.20.so liblapack64.so.3-x86_64-linux-gnu /usr/lib/x86_64-linux-gnu/libmkl_rt.so 150 | |
- name: Update Alternatives | |
shell: bash | |
run: | | |
# sudo ls -al /opt/OpenBLAS/lib | |
# sudo ls -al /opt/OpenBLAS/include | |
sudo update-alternatives --force --install /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3 libopenblas_threaded-linux-gnu /opt/OpenBLAS/lib/libopenblas_threaded.so 150 | |
# sudo update-alternatives --force --install /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.20.so liblapack_threaded-linux-gnu /opt/OpenBLAS/lib/libopenblas_threaded.so.0 150 | |
# sudo update-alternatives --install /usr/lib/x86_64-linux-gnu/libblas64.so libblas64.so-x86_64-linux-gnu /opt/OpenBLAS/lib/libopenblas_threaded_zenp-r0.3.26.so 150 | |
# sudo update-alternatives --install /usr/lib/x86_64-linux-gnu/libblas64.so libblas64.so-x86_64-linux-gnu /usr/lib/x86_64-linux-gnu/libmkl_rt.so 150 | |
# sudo update-alternatives --install /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3 libblas64.so.3-x86_64-linux-gnu /usr/lib/x86_64-linux-gnu/libmkl_rt.so 150 | |
- name: Update Dynamic Linker | |
shell: bash | |
run: | | |
sudo ldconfig | |
- name: Check R sessionInfo | |
shell: Rscript {0} | |
run: | | |
sessionInfo() | |
# - name: check R performance after latest OpenBlas | |
# shell: Rscript {0} | |
# run: | | |
# library(microbenchmark) | |
# microbenchmark( | |
# rnorm(1000000), | |
# times = 10000 | |
# ) | |
# update-alternatives: using /usr/lib/x86_64-linux-gnu/libmkl_rt.so to provide /usr/lib/x86_64-linux-gnu/libblas64.so.3 (libblas64.so.3-x86_64-linux-gnu) in auto mode | |
# update-alternatives: using /usr/lib/x86_64-linux-gnu/libmkl_rt.so to provide /usr/lib/x86_64-linux-gnu/liblapack64.so.3 (liblapack64.so.3-x86_64-linux-gnu) in auto mode | |
# update-alternatives: using /usr/lib/x86_64-linux-gnu/libmkl_rt.so to provide /usr/lib/x86_64-linux-gnu/libblas64.so (libblas64.so-x86_64-linux-gnu) in auto mode | |
# update-alternatives: using /usr/lib/x86_64-linux-gnu/libmkl_rt.so to provide /usr/lib/x86_64-linux-gnu/liblapack64.so (liblapack64.so-x86_64-linux-gnu) in auto mode | |
# Matrix products: default | |
# BLAS: /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3 | |
# LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.20.so; LAPACK version 3.10.0 |