-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: binary search for best context length avoiding oom (#705)
**Reason for Change**: fix: binary search for best context length avoiding oom **Issue Fixed**: `find_max_available_seq_len` runs to oom when running on the V100 16GB gpu with 128K context. **Notes for Reviewers**: In the worst case, it costs about 1minutes to find the best length (running with phi3 medium model and 128k search space). We set the context length to a safe value to avoid oom. If the serving server receives a request which token length is longer than `max_model_len`, server will reject this request. example error message: `This model's maximum context length is 2 tokens. However, you requested 19 tokens (9 in the messages, 10 in the completion). Please reduce the length of the messages or completion.` --------- Signed-off-by: jerryzhuang <[email protected]>
- Loading branch information
Showing
4 changed files
with
104 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters