-
Notifications
You must be signed in to change notification settings - Fork 243
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
fix returning logits in prefill phase of pytorch engine #1209
Merged
Conversation
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
May resolve the conflicts |
from lmdeploy.pytorch.engine import Engine
import numpy as np
m = Engine('/nvme/shared/llama2/huggingface/llama-2-7b-chat')
g = m.create_instance()
# sequence_start 似乎没效果,每次结果都不一样。
g.decode([[11,12,13,14,15]], sequence_end=False)
|
@irexyc seqence_start 的行为具体是啥?要用新的 session_id 吗?还是说清掉旧的 cache 复用原来的? |
# 第一次调用,session_id=0, 未结束
g.decode([[11,12,13,14,15]], sequence_end=False)
# 第二次调用的时候,session_id=0,之前的请求没有end,并且当前请求sequence_start=True,所以 session_id 冲突了,turbomind 会清空 session_id=0 对应的历史, pytorch 这边似乎没有清空。
g.decode([[11,12,13,14,15]], sequence_end=False) |
修了,现在 |
r1 = m.decode([[11,12,13,14,15]], sequence_end=False)
r2 = m.decode([[16,17,18,19,20]], sequence_start=False)
# r2每次都不一样 |
irexyc
approved these changes
Mar 1, 2024
lvhan028
approved these changes
Mar 4, 2024
lvhan028
changed the title
fix decode
fix returning logits in prefill phase of pytorch engine
Mar 4, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix pytorch engine decode.