-
Notifications
You must be signed in to change notification settings - Fork 755
fix eb5 logprob #8071
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 eb5 logprob #8071
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,6 +20,7 @@ | |
|
|
||
| import numpy as np | ||
| import paddle | ||
| from utils import MockForwardMeta | ||
|
|
||
| from fastdeploy.config import ( | ||
| CacheConfig, | ||
|
|
@@ -104,7 +105,7 @@ def __init__(self, vocab_size=128, hidden_size=128): | |
| self.hidden_size = hidden_size | ||
| self.weight = paddle.rand([hidden_size, vocab_size], dtype="float32") | ||
|
|
||
| def compute_logits(self, x): | ||
| def compute_logits(self, x, forward_meta=None): | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 建议 这个 这没有守住本 PR 的关键回归点:prompt logprobs 分支必须把 建议修复方式:让替身记录或断言收到的对象,例如 |
||
| return paddle.matmul(x.astype("float32"), self.weight) | ||
|
|
||
|
|
||
|
|
@@ -175,6 +176,7 @@ def setup_model_runner(self): | |
| model_runner.model = FakeModel(cfg.model_config.vocab_size, cfg.model_config.hidden_size) | ||
|
|
||
| model_runner.in_progress_prompt_logprobs = {} | ||
| model_runner.forward_meta = MockForwardMeta() | ||
|
|
||
| return model_runner | ||
|
|
||
|
|
||
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.
🟡 建议 这个修复只覆盖 GPU runner,但同名 prompt logprobs 路径仍在
xpu_model_runner.py:274、metax_model_runner.py:2818调用compute_logits(prompt_hidden_states)。本文件属于通用 GPU runner,repo checklist A6 要求这类变更检查其他硬件 runner。XPU/Metax 也维护
prompt_logprobs_reqs并在输出阶段调用_get_prompt_logprobs_list,如果对应模型的compute_logits需要forward_meta,这些路径会继续复现本 PR 修复的问题。建议修复方式:同步把 XPU/Metax 的 prompt logprobs 分支改为传入
self.forward_meta,或在 PR 中明确这些硬件不支持该模型/能力并补充保护。