Skip to content

Commit

Permalink
toolchain: bump OpenBLAS to 0.3.6, disable AVX512
Browse files Browse the repository at this point in the history
fixes #409
  • Loading branch information
dev-zero committed Aug 6, 2019
1 parent cfeaaad commit 235a516
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 18 deletions.
7 changes: 5 additions & 2 deletions tools/toolchain/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,11 @@ RUN ./scripts/install_cmake.sh && rm -rf ./build
COPY ./scripts/install_gcc.sh ./scripts/
RUN ./scripts/install_gcc.sh && rm -rf ./build

COPY ./scripts/get_openblas_arch.sh \
./scripts/setup_buildtools.sh ./scripts/
COPY \
./scripts/get_openblas_arch.sh \
./scripts/setup_buildtools.sh \
./scripts/openblas-0.3.6-disable-avx512.patch \
./scripts/
RUN ./scripts/setup_buildtools.sh && rm -rf ./build

COPY ./scripts/install_mpich.sh ./scripts/
Expand Down
4 changes: 2 additions & 2 deletions tools/toolchain/scripts/get_openblas_arch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
SCRIPT_DIR="$(cd "$(dirname "$SCRIPT_NAME")" && pwd -P)"


openblas_ver="0.3.5" # Keep in sync with install_openblas.sh.
openblas_sha256="0950c14bd77c90a6427e26210d6dab422271bc86f9fc69126725833ecdaa0e85"
openblas_ver="0.3.6" # Keep in sync with install_openblas.sh.
openblas_sha256="e64c8fe083832ffbc1459ab6c72f71d53afd3b36e8497c922a15a06b72e9002f"
source "${SCRIPT_DIR}"/common_vars.sh
source "${SCRIPT_DIR}"/tool_kit.sh
source "${SCRIPT_DIR}"/signal_trap.sh
Expand Down
20 changes: 6 additions & 14 deletions tools/toolchain/scripts/install_openblas.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
[ "${BASH_SOURCE[0]}" ] && SCRIPT_NAME="${BASH_SOURCE[0]}" || SCRIPT_NAME=$0
SCRIPT_DIR="$(cd "$(dirname "$SCRIPT_NAME")" && pwd -P)"

openblas_ver="0.3.5" # Keep in sync with get_openblas_arch.sh.
openblas_sha256="0950c14bd77c90a6427e26210d6dab422271bc86f9fc69126725833ecdaa0e85"
openblas_ver="0.3.6" # Keep in sync with get_openblas_arch.sh.
openblas_sha256="e64c8fe083832ffbc1459ab6c72f71d53afd3b36e8497c922a15a06b72e9002f"
source "${SCRIPT_DIR}"/common_vars.sh
source "${SCRIPT_DIR}"/tool_kit.sh
source "${SCRIPT_DIR}"/signal_trap.sh
Expand All @@ -15,7 +15,9 @@ source "${INSTALLDIR}"/toolchain.env
OPENBLAS_CFLAGS=''
OPENBLAS_LDFLAGS=''
OPENBLAS_LIBS=''
PATCHES=()
PATCHES=(
"openblas-0.3.6-disable-avx512.patch"
)
! [ -d "${BUILDDIR}" ] && mkdir -p "${BUILDDIR}"
cd "${BUILDDIR}"

Expand All @@ -35,23 +37,13 @@ case "$with_openblas" in
-o OpenBLAS-${openblas_ver}.tar.gz
fi

for patch in "${PATCHES[@]}" ; do
fname="${patch##*/}"
if [ -f "${fname}" ] ; then
echo "${fname} is found"
else
# parallel build patch
download_pkg ${DOWNLOADER_FLAGS} "${patch}"
fi
done

echo "Installing from scratch into ${pkg_install_dir}"
[ -d OpenBLAS-${openblas_ver} ] && rm -rf OpenBLAS-${openblas_ver}
tar -zxf OpenBLAS-${openblas_ver}.tar.gz
cd OpenBLAS-${openblas_ver}

for patch in "${PATCHES[@]}" ; do
patch -p1 < ../"${patch##*/}"
patch -p1 < "${SCRIPT_DIR}/${patch}"
done

# First attempt to make openblas using auto detected
Expand Down
14 changes: 14 additions & 0 deletions tools/toolchain/scripts/openblas-0.3.6-disable-avx512.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
diff -u b/kernel/x86_64/KERNEL.SKYLAKEX b/kernel/x86_64/KERNEL.SKYLAKEX
--- b/kernel/x86_64/KERNEL.SKYLAKEX
+++ b/kernel/x86_64/KERNEL.SKYLAKEX
@@ -9,8 +9,8 @@

#DGEMMKERNEL = dgemm_kernel_4x8_skylakex.c

-DGEMMINCOPY = dgemm_ncopy_8_skylakex.c
-DGEMMITCOPY = dgemm_tcopy_8_skylakex.c
+#DGEMMINCOPY = dgemm_ncopy_8_skylakex.c
+#DGEMMITCOPY = dgemm_tcopy_8_skylakex.c
DGEMMONCOPY = dgemm_ncopy_8_skylakex.c
DGEMMOTCOPY = dgemm_tcopy_8_skylakex.c

0 comments on commit 235a516

Please sign in to comment.