Repository navigation
[https://nvbugs/5577178][fix] Score every prompt token when prompt logprobs hit the KV cache #20646
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
base: main
Are you sure you want to change the base?
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 |
|---|---|---|
|
|
@@ -978,6 +978,10 @@ def __init__( | |
| # Router Replay: attach routed_experts to this request's output. | ||
| self.py_return_routed_experts = return_routed_experts | ||
| self.py_return_context_logits = return_context_logits | ||
| # Context logits exist only for tokens the forward pass computes, so | ||
| # the KV cache manager allocates the whole prompt instead of claiming | ||
| # a cached prefix. | ||
| self.skip_prefix_reuse = return_context_logits | ||
|
Contributor
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. 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win Preserve prefix-reuse policy in child requests. When 🤖 Prompt for AI AgentsSource: Path instructions |
||
| self.py_return_generation_logits = return_generation_logits | ||
| self.py_return_logits_device_memory = return_logits_device_memory | ||
| self.py_additional_outputs = additional_outputs | ||
|
|
||
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.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
Repository: NVIDIA/TensorRT-LLM
Length of output: 25672
🏁 Script executed:
Repository: NVIDIA/TensorRT-LLM
Length of output: 25063
Set
mSkipPrefixReusefor native context-logit requests.The native constructors copy
returnContextLogitsintomReturnContextLogits, but leavemSkipPrefixReuseat its defaultfalse. InitializemSkipPrefixReusefrom the corresponding context-logit setting in each native constructor before cache allocation. Otherwise, native requests can reuse cached prefixes and return incomplete prompt scores.🤖 Prompt for AI Agents