Skip to content

Conversation

@mudler
Copy link
Member

@mudler mudler commented May 14, 2023

This PR adds GPU support (inference untested, just tried build and run on colab).

OpenBLAS accelleration

To build and run with OpenBLAS, for example:

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:

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

@mudler
Copy link
Member Author

mudler commented May 16, 2023

Ok, tested on colab and seems to work - I'll merge as-is as I don't have the HW to test locally and don't want this to be pending over here. As it is opt-in there is on harm into merging this and iterate over if doesn't work correctly

@mudler mudler marked this pull request as ready for review May 16, 2023 14:22
@mudler mudler merged commit 7a952ea into master May 16, 2023
@mudler mudler deleted the gpu branch May 16, 2023 14:22
@cubuzz
Copy link

cubuzz commented May 16, 2023

I apologize if it's something I'm missing, but trying to build with CuBLAS yields

$ BUILD_TYPE=cublas make libbinding.a

cd build && cp -rf CMakeFiles/ggml.dir/ggml-cuda.cu.o ../llama.cpp/ggml-cuda.o
cp: cannot stat 'CMakeFiles/ggml.dir/ggml-cuda.cu.o': No such file or directory
make: *** [Makefile:162: llama.cpp/ggml-cuda.o] Error 1

Do I need to grab some other dependencies?

=======================================================================

RESOLVED: Somehow llama.cpp wasn't being built. Building it manually, then changing back fixes the issue.

@SilverViper
Copy link

SilverViper commented Jun 5, 2023

I'm trying to build the Flowise example with docker-compose and I have the same error:
cp: cannot stat 'CMakeFiles/ggml.dir/ggml-cuda.cu.o': No such file or directory

Any hint on how I go about building llama.cpp manually? Or to prevent the error?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants