-
Notifications
You must be signed in to change notification settings - Fork 467
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
Set max concurrent requests #2961
base: main
Are you sure you want to change the base?
Conversation
With this setting:
Without this setting:
|
lmdeploy/serve/openai/api_server.py
Outdated
@@ -1035,6 +1049,12 @@ def serve(model_path: str, | |||
proxy_url (str): The proxy url to register the api_server. | |||
max_log_len (int): Max number of prompt characters or prompt tokens | |||
being printed in log. Default: Unlimited | |||
concurrency_pressure: This refers to the ratio between the maximum |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this default value based on empirical experience?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, just an empirical number.
super().__init__(app) | ||
self.semaphore = asyncio.Semaphore(max_concurrent_requests) | ||
|
||
async def dispatch(self, request: Request, call_next): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does it work? Any reference?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is used in BaseHTTPMiddleware.__call__
lmdeploy/cli/serve.py
Outdated
@@ -139,6 +139,16 @@ def add_parser_api_server(): | |||
type=str, | |||
default=None, | |||
help='The proxy url for api server.') | |||
parser.add_argument( | |||
'--concurrency-pressure', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
--max-concurrency, default None, type int.
Let users decide whether to enable it or an appropriate value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc @lzhangzz
any comments?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
--max-concurrency, default None, type int. Let users decide whether to enable it or an appropriate value.
How about --max-concurrent-requests
in TGI?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure.
No description provided.