Repository navigation
[Bugfix][Pooling] Preserve cache_salt for chunked embeddings - #47696
Merged
Merged
Conversation
Contributor
|
This pull request has merge conflicts that must be resolved before it can be |
1 task done
Signed-off-by: Ting Sun <suntcrick@gmail.com>
Signed-off-by: Ting Sun <suntcrick@gmail.com>
Contributor
Author
|
@noooop @DarkLight1337 PTAL? |
Signed-off-by: Ting Sun <suntcrick@gmail.com>
noooop
enabled auto-merge (squash)
October 8, 2026 06:08
Contributor
|
/ci run |
|
✅ Triggered Buildkite CI #93526 for commit |
Contributor
CI selector (shadow): 5 test steps (8 jobs) instead of 39 (55 jobs)Shadow mode: this changes nothing about what CI runs. It shows what the evidence-based selector would pick for this PR, next to today's rules. How it works. Feedback welcome: reply here if it would skip a step this change needs, or runs something unrelated.
Selector would run (5)
Would skip (today's rules run them) (36)
Would add (today's rules do not run them) (2)
AMD mirrors: would skip (35)
AMD mirrors: would add (2)
1 changed files · base |
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.
Purpose
Chunked embedding preprocessing dropped request-level
cache_saltwhen it rebuilt long inputs into per-chunk token prompts. With prefix caching enabled, a second/v1/embeddingsrequest using a different salt could still reuse the first request's cached chunks.This preserves the original salt when creating chunked embedding engine inputs. Unsalted requests keep the existing behavior.
Test Plan
Run a real
/v1/embeddingsserver with prefix caching and long-text chunked processing, then send the same 8102-token embedding input withcache_salt=tenant-a,cache_salt=tenant-b, andcache_salt=tenant-bagain. The second request must not report prefix-cache hits; the third request should report hits as the same-salt positive control.Run scoped diff and ruff checks for the changed file.
Test Result
On upstream main, the second request used a different salt but still reported 7856 prefix-cache hits. With this patch, that second request reports 0 hits and the same-salt repeat still reports 7856 hits. Reverting the patch brings the 7856-hit failure back.
server repro command and client script
The output below was captured on upstream main
394edc81082c04cb38e3455fc0c03d62ba403b72with one RTX 4090 24 GB GPU. I used a local snapshot ofQwen/Qwen3-Embedding-0.6B; the command below uses the public model id.Server command used from a clean checkout:
VLLM_USE_FLASHINFER_SAMPLER=0 \ VLLM_WORKER_MULTIPROC_METHOD=spawn \ python -m vllm.entrypoints.openai.api_server \ --host 127.0.0.1 \ --port 8025 \ --model Qwen/Qwen3-Embedding-0.6B \ --served-model-name qwen3-embed \ --runner pooling \ --dtype bfloat16 \ --enforce-eager \ --enable-prefix-caching \ --max-model-len 512 \ --gpu-memory-utilization 0.45 \ --pooler-config '{"pooling_type":"LAST","use_activation":true,"enable_chunked_processing":true,"max_embed_len":10000}'Client script:
before, after, and revert output
Upstream main:
With this patch:
After reverting this patch:
Scoped checks:
AI assistance was used to prepare this PR.
cc @noooop