-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Python servlet appears to hang after small number of sequential requests. #1500
Comments
Update: I was able to confirm over the weekend that this issue is not related to CPU/GPU, nor to the servlet or core functionality. Rather it seems related to this: I was able to confirm that if I run the exact same request, but without an grammar constraint, i.e., |
Just to add a bit more here. The 'hanging' decodes for JSON format responses do eventually return, but the times are exhorbitant. Always using the same example, the 'average' on my machine is about 5s per request. However when it gets 'stuck', this balloons to 34 min.
|
I was able to resolve this finally. The issue was essentially user error on my part. I was providing a grammar like: {
"type": "json_object",
"properties": {
"first_name": {
"type": "string"
},
"birthplace": {
"type": "string"
},
"last_name": {
"type": "string"
}
},
"required": ["first_name", "last_name", "birthplace"]
} but I needed to provide a grammar like: {
"type": "json_object",
"schema": {
"type": "object",
"properties": {
"first_name": {
"type": "string",
"minLength": 2
},
"birthplace": {
"type": "string",
"minLength": 2,
"maxLength": 10
},
"last_name": {
"type": "string",
"minLength": 2
}
},
"required": ["first_name", "last_name", "birthplace"]
}
} particularly, I needed to provide the top-level additional Interesting to note that the parser still tried, and succeeded in producing a convoluted parse of the half-broken object I was providing, and this then worked repeatedly "until it didn't". Maybe it would make sense to try and run a quick validation of the object first before sending it to the parser/converter? Or insist on the "schema" key? |
Closing this with the self-admonishment: be careful! |
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.I have installed the latest source (commit 165b4dc). In order to minimize confusion, I compiled with CPU only support:
I then attempted to build a minimal servlet of my own:
I run this server with:
then I call it via curl with:
where my request looks like:
the first couple of requests work fine and return the expected result. However inevitably, after 3, or 5 or 15 or sometimes 40 requests the servlet will just hang. What am I missing here?
Current Behavior
Please provide a detailed written description of what
llama-cpp-python
did, instead.After 3, 5, 15, 30 requests - different each time, the server will simply stop responding and the final result will hang. I have tried switching the GPU on and off, I have tried immitating the async and run_in_threadpool configuration in the main llama_cpp_python server lib, and using the context reset, and a variety of other things all to no avail. I assume I must need to reset something but I cannot figure it out.
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.
$ uname -a Linux joe-llm 6.5.0-35-generic #35~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue May 7 09:00:52 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
Failure Information (for bugs)
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.
The text was updated successfully, but these errors were encountered: