Skip to content

Commit

Permalink
Added logic to find sbgemm in BLAS library (#133)
Browse files Browse the repository at this point in the history
  • Loading branch information
Aman-Surkar authored Jun 25, 2024
1 parent cb8d070 commit f0a070a
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
From c3246c9d7b3d9173d8419decd8a07ac25322b412 Mon Sep 17 00:00:00 2001
From: Aman Surkar <[email protected]>
Date: Mon, 24 Jun 2024 10:58:18 +0000
Subject: [PATCH] Fix logic to find sbgemm in BLAS library

---
cmake/Modules/FindBLAS.cmake | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/cmake/Modules/FindBLAS.cmake b/cmake/Modules/FindBLAS.cmake
index 4d5007c625..5ca6c94988 100644
--- a/cmake/Modules/FindBLAS.cmake
+++ b/cmake/Modules/FindBLAS.cmake
@@ -385,16 +385,6 @@ IF (BLAS_LIBRARIES)
cmake_pop_check_state()
ENDIF(BLAS_LIBRARIES)

-# Blas has bfloat16 support?
-IF(BLAS_LIBRARIES)
- SET(CMAKE_REQUIRED_LIBRARIES ${BLAS_LIBRARIES})
- check_function_exists("sbgemm_" BLAS_HAS_SBGEMM)
- set(CMAKE_REQUIRED_LIBRARIES)
- IF(BLAS_HAS_SBGEMM)
- add_compile_options(-DBLAS_HAS_SBGEMM)
- ENDIF(BLAS_HAS_SBGEMM)
-ENDIF(BLAS_LIBRARIES)
-
# epilogue

if(BLAS_LIBRARIES)
@@ -416,3 +406,13 @@ ENDIF(NOT BLAS_FIND_QUIETLY)

# Do nothing is BLAS was found before
ENDIF(NOT BLAS_FOUND)
+
+# Blas has bfloat16 support?
+IF(BLAS_LIBRARIES)
+ SET(CMAKE_REQUIRED_LIBRARIES ${BLAS_LIBRARIES})
+ check_function_exists("sbgemm_" BLAS_HAS_SBGEMM)
+ set(CMAKE_REQUIRED_LIBRARIES)
+ IF(BLAS_HAS_SBGEMM)
+ add_compile_options(-DBLAS_HAS_SBGEMM)
+ ENDIF(BLAS_HAS_SBGEMM)
+ENDIF(BLAS_LIBRARIES)
--
2.40.1

1 change: 1 addition & 0 deletions pytorch-2.1.2/recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ source:
- 0310-PR100149.patch #[ppc_arch == "p10"]
- 0311-PR104956.patch # [ppc64le]
- 0312-Disabled-Wno-error-flag-for-p10.patch #[ppc_arch == "p10"]
- 0001-Fix-logic-to-find-sbgemm-in-BLAS-library.patch #[ppc_arch == "p10"]

requirements:
build:
Expand Down

0 comments on commit f0a070a

Please sign in to comment.