You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Inference works as expected if all layers are on CPU or all layers are on GPU.
Environment and Context
Please provide detailed information about your computer setup. This is important in case the issue is not reproducible except for under certain specific conditions.
Physical (or virtual) hardware you are using, e.g. for Linux:
$ lscpu
AMD EPYC 7713 CPU, NVIDIA A100 GPU
Operating System, e.g. for Linux:
Rocky Linux
SDK version, e.g. for Linux:
$ python3 --version
$ make --version
$ g++ --version
Python 3.12.5
GNU Make 4.3
g++ (GCC) 11.3.1 20220421 (Red Hat 11.3.1-2)
Failure Information (for bugs)
This is caused by a bug in llama.cpp that was corrected in a recent commit. The submodule for llama.cpp is pinned to an older commit and does not include the more recent bug fix. I tried building llama-cpp-python with llama.cpp updated to the bug-fix commit, but that resulted in an immediate segmentation fault, so there seem to have been other changes to llama.cpp that are not immediately compatible. I haven't had a chance to explore further.
Please help provide information about the failure if this is a bug. If it is not a bug, please remove the rest of this template.
Steps to Reproduce
Please provide detailed steps for reproducing the issue. We are not sitting in front of your screen, so the more detail the better.
Note: Many issues seem to be regarding functional or performance issues / differences with llama.cpp. In these cases we need to confirm that you're comparing against the version of llama.cpp that was built with your python package, and which parameters you're passing to the context.
Run llama.cpp's ./main with the same arguments you previously passed to llama-cpp-python and see if you can reproduce the issue. If you can, log an issue with llama.cpp
Failure Logs
Please include any relevant log snippets or files. If it works under one configuration but not under another, please provide logs for both configurations and their corresponding outputs so it is easy to see where behavior changes.
Also, please try to avoid using screenshots if at all possible. Instead, copy/paste the console output and use Github's markdown to cleanly format your logs for easy readability.
Prerequisites
Please answer the following questions for yourself before submitting an issue.
Expected Behavior
Please provide a detailed written description of what you were trying to do, and what you expected
llama-cpp-python
to do.Running a quantized Llama 4 model (e.g., https://huggingface.co/unsloth/Llama-4-Scout-17B-16E-Instruct-GGUF?show_file_info=Llama-4-Scout-17B-16E-Instruct-UD-IQ1_S.gguf) with some layers on GPU and others offloaded to CPU should be possible.
Current Behavior
Please provide a detailed written description of what
llama-cpp-python
did, instead.Attempting to offload 1 or more layers to CPU results in
before any tokens are generated.
Inference works as expected if all layers are on CPU or all layers are on GPU.
Environment and Context
Please provide detailed information about your computer setup. This is important in case the issue is not reproducible except for under certain specific conditions.
$ lscpu
AMD EPYC 7713 CPU, NVIDIA A100 GPU
Rocky Linux
Python 3.12.5
GNU Make 4.3
g++ (GCC) 11.3.1 20220421 (Red Hat 11.3.1-2)
Failure Information (for bugs)
This is caused by a bug in llama.cpp that was corrected in a recent commit. The submodule for llama.cpp is pinned to an older commit and does not include the more recent bug fix. I tried building llama-cpp-python with llama.cpp updated to the bug-fix commit, but that resulted in an immediate segmentation fault, so there seem to have been other changes to llama.cpp that are not immediately compatible. I haven't had a chance to explore further.
Please help provide information about the failure if this is a bug. If it is not a bug, please remove the rest of this template.
Steps to Reproduce
Please provide detailed steps for reproducing the issue. We are not sitting in front of your screen, so the more detail the better.
Note: Many issues seem to be regarding functional or performance issues / differences with
llama.cpp
. In these cases we need to confirm that you're comparing against the version ofllama.cpp
that was built with your python package, and which parameters you're passing to the context.Try the following:
git clone https://github.com/abetlen/llama-cpp-python
cd llama-cpp-python
rm -rf _skbuild/
# delete any old buildspython -m pip install .
cd ./vendor/llama.cpp
cmake
llama.cpp./main
with the same arguments you previously passed to llama-cpp-python and see if you can reproduce the issue. If you can, log an issue with llama.cppFailure Logs
Please include any relevant log snippets or files. If it works under one configuration but not under another, please provide logs for both configurations and their corresponding outputs so it is easy to see where behavior changes.
Also, please try to avoid using screenshots if at all possible. Instead, copy/paste the console output and use Github's markdown to cleanly format your logs for easy readability.
Example environment info:
The text was updated successfully, but these errors were encountered: