Skip to content

Commit ad337e1

Browse files
Camylladitew01MousiusRyo-not-riotaoye9
authored
[cherry-pick][release 2.8] Update OpenBLAS commit (pytorch#151547) (pytorch#158243)
* Update OpenBLAS commit (pytorch#151547) Motivation: Update OpenBLAS and change build script to enable SBGEMM kernels . Update pytorch `jammy` builds for aarch64 to use `install_openblas.sh` instead of `conda_install` Link to full [TorchInductor Performance Dashboard AArch64](https://hud.pytorch.org/benchmark/compilers?dashboard=torchinductor&startTime=Fri%2C%2006%20Jun%202025%2009%3A46%3A35%20GMT&stopTime=Fri%2C%2013%20Jun%202025%2009%3A46%3A35%20GMT&granularity=hour&mode=inference&dtype=bfloat16&deviceName=cpu%20(aarch64)&lBranch=adi/update_openblas&lCommit=0218b65bcf61971c1861cfe8bc586168b73aeb5f&rBranch=main&rCommit=9d59b516e9b3026948918e3ff8c2ef55a33d13ad) 1. This shows a promising speedup across most of the HF models in benchmark, specifically giving a significant boost to SDPA layers. 2. Overall torch-bench pass-rate (cpp_wrapper mode) increased `[87%, 65/75 → 96%, 72/75]` <img width="676" alt="Screenshot 2025-06-20 at 17 05 15" src="https://github.com/user-attachments/assets/2ca9c1bc-80c6-464a-8db6-b758f2476582" /> Pull Request resolved: pytorch#151547 Approved by: https://github.com/malfet, https://github.com/snadampal, https://github.com/fadara01 Co-authored-by: Christopher Sidebottom <[email protected]> Co-authored-by: Ryo Suzuki <[email protected]> Co-authored-by: Ye Tao <[email protected]> Co-authored-by: Nikita Shulga <[email protected]> * Update .ci/docker/common/install_conda.sh Co-authored-by: Andrey Talman <[email protected]> * Update .ci/docker/common/install_conda.sh Co-authored-by: Andrey Talman <[email protected]> * Update .ci/docker/common/install_conda.sh Co-authored-by: Andrey Talman <[email protected]> * try reverting conda install --------- Co-authored-by: Aditya Tewari <[email protected]> Co-authored-by: Christopher Sidebottom <[email protected]> Co-authored-by: Ryo Suzuki <[email protected]> Co-authored-by: Ye Tao <[email protected]> Co-authored-by: Nikita Shulga <[email protected]> Co-authored-by: Andrey Talman <[email protected]>
1 parent b30e6ea commit ad337e1

File tree

4 files changed

+15
-4
lines changed

4 files changed

+15
-4
lines changed

.ci/docker/build.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,8 @@ case "$tag" in
333333
GCC_VERSION=11
334334
ACL=yes
335335
VISION=yes
336+
CONDA_CMAKE=yes
337+
OPENBLAS=yes
336338
# snadampal: skipping llvm src build install because the current version
337339
# from pytorch/llvm:9.0.1 is x86 specific
338340
SKIP_LLVM_SRC_BUILD_INSTALL=yes
@@ -342,6 +344,8 @@ case "$tag" in
342344
GCC_VERSION=11
343345
ACL=yes
344346
VISION=yes
347+
CONDA_CMAKE=yes
348+
OPENBLAS=yes
345349
# snadampal: skipping llvm src build install because the current version
346350
# from pytorch/llvm:9.0.1 is x86 specific
347351
SKIP_LLVM_SRC_BUILD_INSTALL=yes
@@ -428,6 +432,7 @@ docker build \
428432
--build-arg "XPU_VERSION=${XPU_VERSION}" \
429433
--build-arg "UNINSTALL_DILL=${UNINSTALL_DILL}" \
430434
--build-arg "ACL=${ACL:-}" \
435+
--build-arg "OPENBLAS=${OPENBLAS:-}" \
431436
--build-arg "SKIP_SCCACHE_INSTALL=${SKIP_SCCACHE_INSTALL:-}" \
432437
--build-arg "SKIP_LLVM_SRC_BUILD_INSTALL=${SKIP_LLVM_SRC_BUILD_INSTALL:-}" \
433438
-f $(dirname ${DOCKERFILE})/Dockerfile \

.ci/docker/common/install_openblas.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,18 @@
44
set -ex
55

66
cd /
7-
git clone https://github.com/OpenMathLib/OpenBLAS.git -b "${OPENBLAS_VERSION:-v0.3.29}" --depth 1 --shallow-submodules
7+
git clone https://github.com/OpenMathLib/OpenBLAS.git -b "${OPENBLAS_VERSION:-v0.3.30}" --depth 1 --shallow-submodules
88

9+
OPENBLAS_CHECKOUT_DIR="OpenBLAS"
910
OPENBLAS_BUILD_FLAGS="
1011
NUM_THREADS=128
1112
USE_OPENMP=1
1213
NO_SHARED=0
1314
DYNAMIC_ARCH=1
1415
TARGET=ARMV8
1516
CFLAGS=-O3
17+
BUILD_BFLOAT16=1
1618
"
1719

18-
OPENBLAS_CHECKOUT_DIR="OpenBLAS"
19-
2020
make -j8 ${OPENBLAS_BUILD_FLAGS} -C ${OPENBLAS_CHECKOUT_DIR}
2121
make -j8 ${OPENBLAS_BUILD_FLAGS} install -C ${OPENBLAS_CHECKOUT_DIR}

.ci/docker/manywheel/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ case ${image} in
4141
GPU_IMAGE=arm64v8/almalinux:8
4242
DOCKER_GPU_BUILD_ARG=" --build-arg DEVTOOLSET_VERSION=13 --build-arg NINJA_VERSION=1.12.1"
4343
MANY_LINUX_VERSION="2_28_aarch64"
44-
OPENBLAS_VERSION="v0.3.29"
44+
OPENBLAS_VERSION="v0.3.30"
4545
;;
4646
manylinuxcxx11-abi-builder:cpu-cxx11-abi)
4747
TARGET=final

.ci/docker/ubuntu/Dockerfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,12 @@ RUN if [ -n "${ACL}" ]; then bash ./install_acl.sh; fi
147147
RUN rm install_acl.sh
148148
ENV INSTALLED_ACL ${ACL}
149149

150+
ARG OPENBLAS
151+
COPY ./common/install_openblas.sh install_openblas.sh
152+
RUN if [ -n "${OPENBLAS}" ]; then bash ./install_openblas.sh; fi
153+
RUN rm install_openblas.sh
154+
ENV INSTALLED_OPENBLAS ${OPENBLAS}
155+
150156
# Install ccache/sccache (do this last, so we get priority in PATH)
151157
ARG SKIP_SCCACHE_INSTALL
152158
COPY ./common/install_cache.sh install_cache.sh

0 commit comments

Comments
 (0)