Skip to content

Conversation

@ckl117
Copy link
Collaborator

@ckl117 ckl117 commented Oct 23, 2025

Motivation

Support specifying the content returned by logprobes by adding the startup parameter --logprobs-mode, default is raw_logprobs.

Options: raw_logprobs, processed_logprobs, raw_logits, processed_logits

Raw means the values before applying logit processors, like bad words. Processed means the values after applying such processors.

TODO: Speculative decoding support processed logprob.

Modifications

Usage or Command

python -m fastdeploy.entrypoints.openai.api_server \
    --model "/models/ERNIE-4.5-0.3B-Paddle" \
    --tensor-parallel-size 1 \
    --port 8112 \
    --enable-logprob \
    --logprobs-mode raw_logits

Accuracy Tests

Checklist

  • Add at least a tag in the PR title.
    • Tag list: [[FDConfig],[APIServer],[Engine], [Scheduler], [PD Disaggregation], [Executor], [Graph Optimization], [Speculative Decoding], [RL], [Models], [Quantization], [Loader], [OP], [KVCache], [DataProcessor], [BugFix], [Docs], [CI], [Optimization], [Feature], [Benchmark], [Others], [XPU], [HPU], [GCU], [DCU], [Iluvatar], [Metax]]
    • You can add new tags based on the PR content, but the semantics must be clear.
  • Format your code, run pre-commit before commit.
  • Add unit tests. Please write the reason in this PR if no unit tests.
  • Provide accuracy results.
  • If the current PR is submitting to the release branch, make sure the PR has been submitted to the develop branch, then cherry-pick it to the release branch with the [Cherry-Pick] PR tag.

@paddle-bot
Copy link

paddle-bot bot commented Oct 23, 2025

Thanks for your contribution!

@ckl117 ckl117 changed the title 【NewFeature】Support logprobs_mode [Feature] Support logprobs_mode Oct 23, 2025
Comment on lines 626 to 631
model_group.add_argument(
"--logprobs-mode",
type=str,
default=EngineArgs.logprobs_mode,
help="Indicates the content returned in the logprobs.",
)
Copy link
Collaborator

@yuanlehome yuanlehome Oct 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

需要添加参数配置非法拦截报错

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

另外logprobs相关的配置是对齐vllm的不

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已添加非法参数拦截。配置是对齐vllm,只是当前还不支持投机解码场景下根据后处理后的logits计算logprob。

Copy link
Collaborator

@gongshaotian gongshaotian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ckl117 ckl117 merged commit 5c63a08 into PaddlePaddle:develop Oct 27, 2025
27 of 28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants