Skip to content

[Pooling] Honor max_embed_len for chunked embeddings - #55551

Open
taneem-ibrahim wants to merge 1 commit into
vllm-project:mainfrom
taneem-ibrahim:fix/chunked-embedding-max-embed-len
Open

[Pooling] Honor max_embed_len for chunked embeddings#55551
taneem-ibrahim wants to merge 1 commit into
vllm-project:mainfrom
taneem-ibrahim:fix/chunked-embedding-max-embed-len

Conversation

@taneem-ibrahim

Copy link
Copy Markdown
Contributor

Purpose

Chunked embedding requests ignored an explicitly configured max_embed_len because tokenization unconditionally used an unlimited token count. This change honors the configured limit before chunk creation. It only affects explicitly configured limits; max_embed_len=None retains existing unlimited chunked processing. MRV2 execution and valid embedding outputs are unchanged.

Reproducer

Configuration:

max_model_len=4
enable_chunked_processing=true
max_embed_len=8
input_tokens=9

On Main:

{'max_total_tokens': None, 'accepted_tokens': 9}

On this branch:

HTTP 400 BadRequestError

An eight-token boundary request still returns HTTP 200.

Test Plan

46 focused pooling tests passed
5 MRV2 long-text E2E tests passed
MRV2 HTTP probe: 8 tokens → 200; 9 tokens → 400
File-scoped pre-commit passed

AI Assistance

OpenAI Codex (GPT-5) assisted with drafting the change

Signed-off-by: Taneem Ibrahim <taneem.ibrahim@gmail.com>

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

@taneem-ibrahim taneem-ibrahim changed the title [Bugfix][Pooling] Honor max_embed_len for chunked embeddings [Pooling] Honor max_embed_len for chunked embeddings Sep 6, 2026
@mergify mergify Bot added the frontend label Sep 6, 2026
@coderabbitai

coderabbitai Bot commented Sep 6, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Team

Run ID: a6edd130-0812-45db-a288-12894ad47962

📥 Commits

Reviewing files that changed from the base of the PR and between 144e79c and abe148e.

📒 Files selected for processing (1)
  • vllm/entrypoints/pooling/base/protocol.py

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Summary

Summary by CodeRabbit

  • Bug Fixes
    • Chunked embedding requests now enforce the configured maximum embedding length during tokenization, preventing unbounded token processing.

Walkthrough

Chunked pooling tokenization now limits max_total_tokens to pooler_config.max_embed_len instead of leaving the limit unset.

Changes

Pooling tokenization

Layer / File(s) Summary
Apply chunk embedding limit
vllm/entrypoints/pooling/base/protocol.py
The chunked-processing branch sets max_total_tokens to pooler_config.max_embed_len.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Merge Risk: ⚪ Minimal · up to abe14

Chunked embedding requests now reject inputs exceeding an explicitly configured embedding limit while preserving unlimited and non-chunked behavior. No current merge-blocking risk remains.

Suggested reviewers: kernelclint, jperezdealgaba

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description check ✅ Passed The description clearly explains the fix to honor max_embed_len for chunked embedding requests. It also states the behavior for max_embed_len=None and summarizes validation results.
Title check ✅ Passed The title clearly and concisely identifies the main change: honoring max_embed_len for chunked embeddings.
  • Fix all pre-merge checks with AI

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant