-
Notifications
You must be signed in to change notification settings - Fork 3.8k
[WIP][EPD][VLM] support video input(qwen-series) #15475
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
base: main
Are you sure you want to change the base?
Conversation
Summary of ChangesHello @ZhengWG, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the system's multimodal capabilities by integrating native video input support for Qwen-series models. It involves a comprehensive refactoring of how multimodal data, including both images and videos, is handled from ingestion and encoding to processing and tokenization. Key changes include a new data structure for managing diverse multimodal embeddings, a dynamic load-balancing strategy for distributing multimodal items across encoders, and updates to the core processing logic to seamlessly incorporate video data alongside existing image functionality. This generalization allows for more flexible and powerful multimodal interactions. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request adds support for video input for qwen-series models, which is a significant feature enhancement. The changes are extensive, touching upon data structures for multimodal data, the encoding server, I/O structures, and multimodal processors to handle video inputs alongside images.
The refactoring to introduce MultiModalEmbeddingData and generalize data handling for different modalities is well-executed. The logic for assigning multimodal items to encoders and processing them seems correct.
I have found two issues:
- A critical bug in
python/sglang/srt/multimodal/processors/qwen_vl.pywhere theModalityenum is used without being imported, which would cause a runtime error. - A medium-severity bug in
python/sglang/srt/disaggregation/encode_receiver.pydue to a syntax error in a__repr__method.
I've provided code suggestions to fix both issues. After addressing these points, the pull request should be in good shape.
| from sglang.srt.environ import envs | ||
| from sglang.srt.layers.rotary_embedding import MRotaryEmbedding | ||
| from sglang.srt.managers.schedule_batch import Modality, MultimodalDataItem | ||
| from sglang.srt.managers.schedule_batch import MultimodalDataItem |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| return mm_data | ||
|
|
||
| def __repr__(self): | ||
| return f"MultiModalEmbeddingData(req_id={self.req_id}, num_parts={self.num_parts}, part_idx={self.part_idx}, modality={self.modality}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The __repr__ method is missing a closing parenthesis, which will cause a SyntaxError if this method is called during debugging.
| return f"MultiModalEmbeddingData(req_id={self.req_id}, num_parts={self.num_parts}, part_idx={self.part_idx}, modality={self.modality}" | |
| return f"MultiModalEmbeddingData(req_id={self.req_id}, num_parts={self.num_parts}, part_idx={self.part_idx}, modality={self.modality})" |
Motivation
This PR adds video input support for Qwen-series models as a follow-up to #12263 , addressing the requirements outlined in #15118
Modifications
MultiModalEmbeddingDataAccuracy Tests
Launch scripts:
Test scripts:
Benchmarking and Profiling
Checklist