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

Why llamaCpp only support batchsize=1 in text generation #283

Closed
neozhang307 opened this issue Oct 8, 2024 · 3 comments
Closed

Why llamaCpp only support batchsize=1 in text generation #283

neozhang307 opened this issue Oct 8, 2024 · 3 comments

Comments

@neozhang307
Copy link

I wonder why there is such a limitation in llamacpp?
if self.config.task == "text-generation":
if input_shapes["batch_size"] != 1:
raise ValueError("Batch size must be 1 for LlamaCpp text generation")

In '/optimum_benchmark/backends/llama_cpp/backend.py'

@IlyasMoutawwakil
Copy link
Member

@baptistecolle

@baptistecolle
Copy link
Collaborator

Hi,

Llama.cpp supports batch inference. However, we use a Python binding (llama-cpp-python) to interact with it, which currently does not support batch inference abetlen/llama-cpp-python#771.

Once this feature is added, we can remove the current restriction and start benchmarking with batches

@neozhang307
Copy link
Author

OK

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

No branches or pull requests

3 participants