Skip to content

Commit ea60007

Browse files
committed
Revert "feature : add blis and other BLAS implementation support (#1502)"
This reverts commit 07e9ace.
1 parent 07e9ace commit ea60007

File tree

4 files changed

+25
-104
lines changed

4 files changed

+25
-104
lines changed

BLIS.md

-67
This file was deleted.

CMakeLists.txt

+23-16
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,7 @@ endif()
6565

6666
# 3rd party libs
6767
option(LLAMA_ACCELERATE "llama: enable Accelerate framework" ON)
68-
option(LLAMA_BLAS "llama: use BLAS" OFF)
69-
option(LLAMA_BLAS_VENDOR "llama: BLA_VENDOR from https://cmake.org/cmake/help/latest/module/FindBLAS.html#blas-lapack-vendors" Generic)
68+
option(LLAMA_OPENBLAS "llama: use OpenBLAS" OFF)
7069
option(LLAMA_CUBLAS "llama: use cuBLAS" OFF)
7170
option(LLAMA_CLBLAST "llama: use CLBlast" OFF)
7271

@@ -146,28 +145,36 @@ if (APPLE AND LLAMA_ACCELERATE)
146145
endif()
147146
endif()
148147

149-
if (LLAMA_BLAS)
148+
if (LLAMA_OPENBLAS)
150149
if (LLAMA_STATIC)
151150
set(BLA_STATIC ON)
152151
endif()
153-
if ($(CMAKE_VERSION) VERSION_GREATER_EQUAL 3.22)
154-
set(BLA_SIZEOF_INTEGER 8)
155-
endif()
156-
set(BLA_VENDOR ${LLAMA_BLAS_VENDOR})
152+
153+
set(BLA_VENDOR OpenBLAS)
157154
find_package(BLAS)
158155
if (BLAS_FOUND)
159-
message(STATUS "BLAS found, Libraries: ${BLAS_LIBRARIES}")
156+
message(STATUS "OpenBLAS found")
160157

161-
add_compile_options(${BLAS_LINKER_FLAGS})
162158
add_compile_definitions(GGML_USE_OPENBLAS)
163-
set(LLAMA_EXTRA_LIBS ${LLAMA_EXTRA_LIBS} ${BLAS_LIBRARIES})
164-
165-
message("${BLAS_LIBRARIES}")
166-
include_directories(${BLAS_INCLUDE_DIRS})
159+
add_link_options(${BLAS_LIBRARIES})
160+
set(LLAMA_EXTRA_LIBS ${LLAMA_EXTRA_LIBS} openblas)
161+
162+
# find header file
163+
set(OPENBLAS_INCLUDE_SEARCH_PATHS
164+
/usr/include
165+
/usr/include/openblas
166+
/usr/include/openblas-base
167+
/usr/local/include
168+
/usr/local/include/openblas
169+
/usr/local/include/openblas-base
170+
/opt/OpenBLAS/include
171+
$ENV{OpenBLAS_HOME}
172+
$ENV{OpenBLAS_HOME}/include
173+
)
174+
find_path(OPENBLAS_INC NAMES cblas.h PATHS ${OPENBLAS_INCLUDE_SEARCH_PATHS})
175+
add_compile_options(-I${OPENBLAS_INC})
167176
else()
168-
message(WARNING "BLAS not found, please refer to "
169-
"https://cmake.org/cmake/help/latest/module/FindBLAS.html#blas-lapack-vendors"
170-
" to set correct LLAMA_BLAS_VENDOR")
177+
message(WARNING "OpenBLAS not found")
171178
endif()
172179
endif()
173180

Makefile

-4
Original file line numberDiff line numberDiff line change
@@ -122,10 +122,6 @@ ifdef LLAMA_OPENBLAS
122122
LDFLAGS += -lopenblas
123123
endif
124124
endif
125-
ifdef LLAMA_BLIS
126-
CFLAGS += -DGGML_USE_OPENBLAS -I/usr/local/include/blis -I/usr/include/blis
127-
LDFLAGS += -lblis -L/usr/local/lib
128-
endif
129125
ifdef LLAMA_CUBLAS
130126
CFLAGS += -DGGML_USE_CUBLAS -I/usr/local/cuda/include -I/opt/cuda/include -I$(CUDA_PATH)/targets/x86_64-linux/include
131127
CXXFLAGS += -DGGML_USE_CUBLAS -I/usr/local/cuda/include -I/opt/cuda/include -I$(CUDA_PATH)/targets/x86_64-linux/include

README.md

+2-17
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ The main goal of `llama.cpp` is to run the LLaMA model using 4-bit integer quant
5656
- Mixed F16 / F32 precision
5757
- 4-bit, 5-bit and 8-bit integer quantization support
5858
- Runs on the CPU
59-
- Supports OpenBLAS/Apple BLAS/ARM Performance Lib/ATLAS/BLIS/Intel MKL/NVHPC/ACML/SCSL/SGIMATH and [more](https://cmake.org/cmake/help/latest/module/FindBLAS.html#blas-lapack-vendors) in BLAS
59+
- OpenBLAS support
6060
- cuBLAS and CLBlast support
6161

6262
The original implementation of `llama.cpp` was [hacked in an evening](https://github.com/ggerganov/llama.cpp/issues/33#issuecomment-1465108022).
@@ -274,25 +274,10 @@ Building the program with BLAS support may lead to some performance improvements
274274
```bash
275275
mkdir build
276276
cd build
277-
cmake .. -DLLAMA_BLAS=ON -DLLAMA_BLAS_VENDOR=OpenBLAS
277+
cmake .. -DLLAMA_OPENBLAS=ON
278278
cmake --build . --config Release
279279
```
280280

281-
- BLIS
282-
283-
Check [BLIS.md](BLIS.md) for more information.
284-
285-
- Intel MKL
286-
287-
By default, `LLAMA_BLAS_VENDOR` is set to `Generic`, so if you already sourced intel environment script and assign `-DLLAMA_BLAS=ON` in cmake, the mkl version of Blas will automatically been selected. You may also specify it by:
288-
289-
```bash
290-
mkdir build
291-
cd build
292-
cmake .. -DLLAMA_BLAS=ON -DLLAMA_BLAS_VENDOR=Intel10_64lp -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icpx
293-
cmake --build . -config Release
294-
```
295-
296281
- cuBLAS
297282

298283
This provides BLAS acceleration using the CUDA cores of your Nvidia GPU. Make sure to have the CUDA toolkit installed. You can download it from your Linux distro's package manager or from here: [CUDA Toolkit](https://developer.nvidia.com/cuda-downloads).

0 commit comments

Comments
 (0)