Skip to content
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

[V1][Pixtral-HF] Add custom slice_encoder_output for Pixtral #13080

Open
wants to merge 34 commits into
base: main
Choose a base branch
from

Conversation

lk-chen
Copy link
Contributor

@lk-chen lk-chen commented Feb 11, 2025

Prepare for #11409

This PR allows model to override _gather_encoder_outputs logic. Models like Pixtral need to take special tokens (break/end token) into consideration while gathering soft tokens.

See this comment for more context.

Test

Tested by running

VLLM_USE_V1=1 python examples/offline_inference/vision_language.py --model pixtral_hf --num-prompts=2

with #11409 patched, results are the same as V0.


cc @WoosukKwon @comaniac @ywang96

Linkun Chen and others added 30 commits November 18, 2024 05:52
* confirm that `offline_inference_vision_language.py` and `benchmark_throughput.py` runs
* FIXME: the placeholders in output, however, is empty
 - will fix in next commit

Signed-off-by: Linkun Chen <[email protected]>
* add test for pixtral
* fix a typo

Signed-off-by: Linkun Chen <[email protected]>
Signed-off-by: Woosuk Kwon <[email protected]>
Signed-off-by: Linkun Chen <[email protected]>
Signed-off-by: youkaichao <[email protected]>
Signed-off-by: Linkun Chen <[email protected]>
Signed-off-by: Kunshang Ji <[email protected]>
Signed-off-by: Linkun Chen <[email protected]>
Signed-off-by: Cyrus Leung <[email protected]>
Signed-off-by: Linkun Chen <[email protected]>
Signed-off-by: Linkun Chen <[email protected]>
Signed-off-by: Linkun Chen <[email protected]>
Signed-off-by: Linkun Chen <[email protected]>
… optional argument

also require it to be passed as kwargs, to avoid breaking existing code.

Signed-off-by: Linkun Chen <[email protected]>
… optional argument

also require it to be passed as kwargs, to avoid breaking existing code.

Signed-off-by: Linkun Chen <[email protected]>
… optional argument

also require it to be passed as kwargs, to avoid breaking existing code.

Signed-off-by: Linkun Chen <[email protected]>
mypy is not smart enough to validate kwargs

Signed-off-by: Linkun Chen <[email protected]>
mypy is not smart enough to validate kwargs

Signed-off-by: Linkun Chen <[email protected]>
Signed-off-by: Linkun Chen <[email protected]>
Copy link

👋 Hi! Thank you for contributing to the vLLM project.

💬 Join our developer Slack at https://slack.vllm.ai to discuss your PR in #pr-reviews, coordinate on features in #feat- channels, or join special interest groups in #sig- channels.

Just a reminder: PRs would not trigger full CI run by default. Instead, it would only run fastcheck CI which starts running only a small and essential subset of CI tests to quickly catch errors. You can run other CI tests on top of those by going to your fastcheck build on Buildkite UI (linked in the PR checks section) and unblock them. If you do not have permission to unblock, ping simon-mo or khluu to add you in our Buildkite org.

Once the PR is approved and ready to go, your PR reviewer(s) can run CI to test the changes comprehensively before merging.

To run CI, PR reviewers can either: Add ready label to the PR or enable auto-merge.

🚀

@mergify mergify bot added the v1 label Feb 11, 2025
Prepare for vllm-project#11409

For pixtral model, we need to insert placeholders in the middle of
encoder output, to fit into whole soft embedding. This case makes
slicing operation tricky. This PR raises assertion if something's
off.

Signed-off-by: Linkun Chen <[email protected]>
@ywang96 ywang96 self-assigned this Feb 12, 2025
@DarkLight1337
Copy link
Member

DarkLight1337 commented Feb 12, 2025

For your reference, I have added a mapping from encoder outputs to embeddings in the outputs of Molmo multi-modal processor (#12966, see feat_is_patch and embed_is_patch) so that there is no need to define a custom hook inside the model. Do you think it's feasible to do the same for this model?

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.