[qwen] Add VideoChatFlashQwenModel text-decoder builder - #371
Merged
Conversation
Agent-Logs-Url: https://github.com/xadupre/mbext/sessions/60fa1191-8bd3-435b-8e09-b2dbb6074563 Co-authored-by: xadupre <22452781+xadupre@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Import changes and add fast unit test
Add VideoChatFlashQwenModel text-decoder builder
May 25, 2026
📂 Impacted Files3 file(s) changed in this pull request: 🔵 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #371 +/- ##
==========================================
+ Coverage 78.82% 78.86% +0.03%
==========================================
Files 27 27
Lines 8058 8071 +13
==========================================
+ Hits 6352 6365 +13
Misses 1706 1706
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Imports the Python text-decoder builder additions from onnxruntime-genai PR #2147 (file hash
11d14636…cfcb50→src/python/py/models/builder.py) so mbext can export the text component ofVideoChatFlashQwenForCausalLM(OpenGVLab/VideoChat-Flash, Qwen2.5-7B backbone).Changes
modelbuilder/builders/qwen.py— newVideoChatFlashQwenModel(QwenModel):self.model_type = "VideoChat_Flash_QwenForCausalLM"so the base class derives the genai_config typevideochat_flash_qwen.load_weightsto callQwen2ForCausalLM.from_pretraineddirectly, bypassing the upstream VCFAutoConfigwhich pulls inav/cv2/decord/imageio.modelbuilder/builder.py— dispatch case forVideoChatFlashQwenForCausalLMthat forcesextra_options["exclude_embeds"] = True(decoder consumesinputs_embedsfrom the embedding-merger that fuses InternVideo2 visual tokens).tests/fast/test_random_videochat_flash_qwen.py— fast offline test (fp32/fp16/int4 CPU + fp16 CUDA) following thetest_random_gemma3_conditional.pypattern:architecturesin the savedconfig.jsontoVideoChatFlashQwenForCausalLM(sinceQwen2ForCausalLM.save_pretrainedwould otherwise overwrite it) to exercise the new dispatch.inputs_embeds(notinput_ids) and runs the prefill/decode discrepancy check withembed_fn=model.model.embed_tokens.The VLM vision encoder and embedding-merger remain out of scope, matching upstream Phase 1.
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
https://api.github.com/repos/microsoft/onnxruntime-genai/pulls/2147/usr/bin/curl curl -sL -H Accept: application/vnd.github.v3.diff REDACTED -o /tmp/pr2147.diff(http block)If you need me to access, download, or install something from one of these locations, you can either: