Open
Conversation
This will be called by vLLM integration too.
This is to prepare for the VLM support.
Contributor
There was a problem hiding this comment.
Pull request overview
Adds initial vision-language model (VLM) support to the Optimum Neuron vLLM integration by introducing a multimodal runner path and extending the vLLM service test client/tests to exercise image-conditioned generation.
Changes:
- Add a VLM-specific vLLM runner that extracts
pixel_valuesfrom vLLM multimodal features and passes them into Neuron models during prefill. - Introduce an
OptimumNeuronModelForImageTextToTextwrapper for vLLM model loading and forward/prefill APIs. - Extend vLLM service fixtures/client and add a new service test for generation with images.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/vllm/service/test_vllm_service_generate.py | Refactors service fixture creation and adds a VLM image generation service test. |
| tests/fixtures/llm/vllm_service.py | Extends the OpenAI-compatible test client with image-capable chat sampling helpers. |
| optimum/neuron/vllm/runner.py | Adds a VLM runner variant and refactors token generation helpers for reuse. |
| optimum/neuron/vllm/model_loader.py | Adds a VLM model wrapper and introduces a task mapping entry for image-text-to-text. |
| optimum/neuron/models/inference/backend/modules/decoder/vlm_decoder.py | Exposes a reusable prepare_vlm_prefill() for chunked prefill image feature preparation. |
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
A custom runner and a model loader class are added to handle vision-language models (VLMs) served through vLLM.
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.
What does this PR do?
Enable support for VLMs in vLLM, and add a test to show functionality.