Repository navigation
[Frontend] vllm-rs: port prompt hashing and content prefix memoization (Rubin) - #170
Merged
YibaiMeng merged 1 commit intoOct 27, 2026
Conversation
Co-authored-by: Codex <noreply@openai.com> Signed-off-by: Julien Darve <jdarve@NVIDIA.com>
YibaiMeng
merged commit Oct 27, 2026
6c7001e
into
CentML:mlperf-end-multiturn-v1.0-qwen-v2
2 checks passed
This file contains hidden or 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
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.
Summary
Let vllm-rs, the Rust OpenAI-compatible front end, compute each request's prompt prefix-cache block hashes and send them
with the request, as the Python front end already does with
FEH=1(#72) andVLLM_FEH_MEMO=1(#141). Without this,requests from vllm-rs reach EngineCore unhashed and EngineCore hashes every prompt itself. The Dynamo vLLM sidecar
deployment of Qwen3.6 depends on it.
Design
native_frontend_hash_config: algorithmsha256-pickle5-feh1, block size andnone_hash. It is set only when FEH isenabled, prefix caching uses
sha256with pickle protocol 5, and the hash block size equals FEH's block(
vllm/v1/engine/frontend_block_hashing.py,vllm/v1/engine/core.py).rust/src/engine-core-client/src/frontend_hashing.rs) hashes only withVLLM_NATIVE_FEH=1and when everyengine reports the same config. Otherwise it logs why and sends requests unhashed, as before.
A content-keyed memo with 1024-token checkpoints reuses hashes across turns that share a prefix, like
VLLM_FEH_MEMO.Hashing runs on a blocking thread, off the async request path.
vllm/utils/hashing.pygains aSHA256_PICKLE_PROTOCOLconstant. The edits totests/v1/engine/test_frontend_block_hashing.pyand the blank-line moves invllm/v1/engine/core.pyareruff formatting only.
Configuration
VLLM_NATIVE_FEH1enables native hashing when EngineCore advertises a matching config.FEHandVLLM_FEH_MEMOare unchanged.Numerics
Exact by design. The hashes are bit-identical to the Python front end's, which unit tests check against CPython pickle-5
output. Prefix-cache behavior is unchanged.
Testing
cargo test -p vllm-engine-core-client: 120 passed, including 6frontend_hashingtests.pytest tests/v1/engine/test_frontend_block_hashing.py: 18 passed.pre-commit run --files <changed files>: no new findings. Pre-existing on the base: mypy (MainThreadRepinassignments in
core.py, an index atfrontend_block_hashing.py:246) andcheck-root-lazy-imports(vllm.lcd_pdl).c7228a5a, which was validated in ourQwen3.6 serving runs behind Dynamo vLLM sidecars. Results are not shared here.
Not a duplicate
#72 and #141 add this hashing and its memo to the Python front end; this ports the same hashing to vllm-rs. No open
CentML PR touches
rust/src/engine-core-client.Merging
Please merge with a merge commit, not squash or rebase. Our benchmark harness pins this commit ID (
f6c69f1c).AI assistance
AI assistance was used: Codex for the implementation and Claude for preparing this PR. I reviewed every changed line
and the test results above.