Skip to content

Commit

Permalink
Update instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
mudler committed May 14, 2023
1 parent a32926a commit 904aaeb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
9 changes: 8 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,19 @@ ifneq ($(filter armv8%,$(UNAME_M)),)
# Raspberry Pi 4
CFLAGS += -mfp16-format=ieee -mno-unaligned-access
endif
ifeq ($(BUILD_TYPE),cuda)

ifeq ($(BUILD_TYPE),cublas)
EXTRA_LIBS=
CMAKE_ARGS+="-DLLAMA_CUBLAS=ON"
EXTRA_TARGETS+=llama.cpp/ggml-cuda.o
endif

ifeq ($(BUILD_TYPE),openblas)
EXTRA_LIBS=
CMAKE_ARGS+="-DLLAMA_OPENBLAS=ON"
EXTRA_TARGETS+=
endif

#
# Print build information
#
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,17 @@ LIBRARY_PATH=$PWD C_INCLUDE_PATH=$PWD go run ./examples -m "/model/path/here" -t
To build and run with OpenBLAS, for example:

```
CMAKE_ARGS="-DLLAMA_OPENBLAS=ON" make libbinding.a
LIBRARY_PATH=$PWD C_INCLUDE_PATH=$PWD go run -tags openblas ./examples -m "/model/path/here" -t 14
BUILD_TYPE=openblas make libbinding.a
CGO_LDFLAGS="-lopenblas" LIBRARY_PATH=$PWD C_INCLUDE_PATH=$PWD go run -tags openblas ./examples -m "/model/path/here" -t 14
```

## GPU

To build with CuBLAS:

```
CMAKE_ARGS="-DLLAMA_CUBLAS=ON" make libbinding.a
LIBRARY_PATH=$PWD C_INCLUDE_PATH=$PWD go run -tags cublas ./examples -m "/model/path/here" -t 14
BUILD_TYPE=cublas make libbinding.a
CGO_LDFLAGS="-lcublas -lcudart -L/usr/local/cuda/lib64/" LIBRARY_PATH=$PWD C_INCLUDE_PATH=$PWD go run ./examples -m "/model/path/here" -t 14
```

Enjoy!
Expand Down

0 comments on commit 904aaeb

Please sign in to comment.