fix(vllm): propagate cache salt in text mode - #11082
Conversation
Signed-off-by: weizhoublue <weizhou.lan@daocloud.io>
|
👋 Hi weizhoublue! Thank you for contributing to ai-dynamo/dynamo. Just a reminder: The 🚀 |
Walkthrough
Changesnvext cache salt in text mode
Estimated code review effort🎯 2 (Simple) | ⏱️ ~5 minutes 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
components/src/dynamo/vllm/tests/test_vllm_unit.py (1)
1236-1236: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winHoist
DecodeWorkerHandlerto module scope.Line 1236 adds a non-optional import inside the test body. Move it to the top-level imports so the dependency stays explicit and consistent with the repo’s Python test rules.
As per coding guidelines, "Keep imports at the top of the file; always flag
importstatements inside function bodies" and as per path instructions, "Keep all imports at the top of each file (avoid imports inside functions/classes)."🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@components/src/dynamo/vllm/tests/test_vllm_unit.py` at line 1236, The test currently imports DecodeWorkerHandler inside the test body, which violates the repo’s import rules. Move the dynamo.vllm.handlers import to the module-level import section in test_vllm_unit.py so all dependencies are explicit at the top of the file, and keep the test logic unchanged.Sources: Coding guidelines, Path instructions
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@components/src/dynamo/vllm/tests/test_vllm_unit.py`:
- Line 1236: The test currently imports DecodeWorkerHandler inside the test
body, which violates the repo’s import rules. Move the dynamo.vllm.handlers
import to the module-level import section in test_vllm_unit.py so all
dependencies are explicit at the top of the file, and keep the test logic
unchanged.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 8cacf4c3-dc08-4ece-b599-40f1be17e081
📒 Files selected for processing (2)
components/src/dynamo/vllm/handlers.pycomponents/src/dynamo/vllm/tests/test_vllm_unit.py
|
Thanks for the contribution @weizhoublue, tagging @biswapanda to help review |
|
/ok to test 2840b7c |
Overview:
propagate cache salt in text mode
Details:
In the --use-vllm-tokenizer scenario, an OpenAI-compatible v1/chat/completions request may carry nvext.cache_salt, but the current text-mode path loses that value before calling vLLM.
The fix extracts nvext.cache_salt from the HTTP request-derived Python request dict and writes it into the prompt object passed to the vLLM engine:
It translates Dynamo’s OpenAI extension field, nvext.cache_salt, into vLLM prompt metadata, cache_salt, so vLLM can apply it when handling KV cache keys.
Where should the reviewer start?
Related Issues
🔗 This PR is linked to an issue:
🚫 This PR is NOT linked to an issue:
Summary by CodeRabbit