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

Check whether the input request is too long #113

Closed
zhuohan123 opened this issue May 20, 2023 · 4 comments
Closed

Check whether the input request is too long #113

zhuohan123 opened this issue May 20, 2023 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@zhuohan123
Copy link
Collaborator

No description provided.

@WoosukKwon WoosukKwon added the bug Something isn't working label May 28, 2023
@WoosukKwon
Copy link
Collaborator

Without the fix, cacheflow can suddenly hang without any notice. Let's fix this.

@zhuohan123
Copy link
Collaborator Author

@LiuXiaoxuanPKU

@zhuohan123
Copy link
Collaborator Author

zhuohan123 commented Jun 27, 2023

There are two limits for the sequence length, and we should take whichever is smaller:

  1. Model limits: For example, for OPT-13B, the learned position embedding can support only config.max_position_embeddings positions.
  2. vLLM limit: Specifically, an input cannot be longer than max_num_batched_tokens.

The real limit should be limit = min(model limit, vllm limit).

Also, for a request:

  1. If len(prompt) > limit, we should directly reject the request or return nothing.
  2. If len(prompt) + len(generated) > limit, we should stop the generation and return the partial results with the finish reason to be SequenceStatus.FINISHED_LENGTH_CAPPED.

In addition, we should not directly let the server fail when there is one request that is too long. We should return a proper error message or partial result.

@hmellor
Copy link
Collaborator

hmellor commented Mar 8, 2024

Closing as this should now be fixed.

@hmellor hmellor closed this as completed Apr 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants