Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Llama2 70b support #522

Merged
merged 1 commit into from
Jul 24, 2023
Merged

Llama2 70b support #522

merged 1 commit into from
Jul 24, 2023

Conversation

bretello
Copy link
Contributor

Add support for llama2 70b (uses n_gqa parameter)

See #488 (comment) and ggerganov/llama.cpp#2276

@bretello
Copy link
Contributor Author

From my limited testing, it seems that the GPU is not being used when providing n_gpu_layers=1, even when compiled with metal. I tried running other models (yet) but I'm probably going to work on these in the coming days.

@oobabooga
Copy link
Contributor

I have made a test and was able to get 70b working with GPU acceleration by compiling it like this (probably half of it is redundant):

pip uninstall llama-cpp-python
git clone 'https://github.com/bretello/llama-cpp-python' -b llama2-70b-support
cd llama-cpp-python/
git submodule update --init --recursive
cd vendor/llama.cpp/
make LLAMA_CUBLAS=1 -j8
cd ..
CMAKE_ARGS="-DLLAMA_CUBLAS=on" FORCE_CMAKE=1 pip install . --no-cache-dir

@oobabooga
Copy link
Contributor

oobabooga commented Jul 24, 2023

Maybe rms_norm_eps is also necessary?

ggerganov/llama.cpp#2374

It seems like it currently needs to be manually set to 1e-5 for llama-2 (the default is 1e-6).

@bretello
Copy link
Contributor Author

@oobabooga Rebased on main (v0.1.76), now that's also included.

@abetlen
Copy link
Owner

abetlen commented Jul 24, 2023

@bretello thanks for rebasing, I'll merge this in and publish a new release since I don't think it can work without setting that param during initialisation.

@abetlen abetlen merged commit e4431a6 into abetlen:main Jul 24, 2023
15 checks passed
@bretello bretello deleted the llama2-70b-support branch July 24, 2023 18:05
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.

3 participants