Repository navigation
[Bugfix] fix video inference of qwen3vl and qwen3.5 series - #44474
Conversation
There was a problem hiding this comment.
Nice, also saw the error yesterday! Can you add integration tests in qwen3-vl for image and video inference, which will help us track this kind of issues before merging PRs? There are no tests atm because model was released day-0 and we prob forgot to add later
|
@zucchini-nlp Hi, I have added the test for qwen3.5 and fix the previous qwen3vl test(now it can catch this type of error). I also add a slow qwen3.5-0.8b test. All added tests pass locally. 🫡 |
|
run-slow: qwen3_5, qwen3_5_moe, qwen3_vl, qwen3_vl_moe |
|
This comment contains models: ["models/qwen3_5", "models/qwen3_5_moe", "models/qwen3_vl", "models/qwen3_vl_moe"] |
CI ResultsCommit Info
Model CI Report❌ 1 new failed tests from this PR 😭
|
|
run-slow: qwen3_5 |
|
This comment contains models: ["models/qwen3_5"] |
|
SSH-ing into runners isn't possible so I triggered CI again, let's copy from the error message when it fails |
|
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. |
CI ResultsCommit Info
Model CI Report❌ 1 new failed tests from this PR 😭
|
|
[For maintainers] Suggested jobs to run (before merge) run-slow: qwen3_5, qwen3_5_moe, qwen3_vl, qwen3_vl_moe |
zucchini-nlp
left a comment
There was a problem hiding this comment.
Should have approved so it can be auto-merged 🤦🏻
…face#44474) Expand video_grid_thw to per-frame rows before iterating in get_rope_index(). Qwen3.5 uses timestamps to separate video frames (<t1><frame1><t2><frame2>...), creating one mm_token_type_ids segment per frame. grid_iters needs one grid_thw entry per segment. Fix: repeat_interleave(grid_thw, grid_thw[:,0]) then set T=1 per row. Applied to: qwen3_vl, qwen3_5, qwen3_vl_moe, qwen3_5_moe modeling files. The modular_qwen3_vl.py already contains this fix but generated files were not regenerated.
* fix video inference of qwen3vl and qwen3.5 series * fix ci * get_rope_index inhert from qwen2vl * add test for qwen3vl,qwen3.5 * fix ci * use assertListEqual instead * update CI result
What does this PR do?
Fix QwenLM/Qwen3.8#58. In the latest code, Qwen3VL and Qwen3.5 use the same
get_rope_indexfunc of Qwen2VL. But they should be different since Qwen3VL/Qwen3.5 introduce text timestamps.This PR fixs it follow the original impl
transformers/src/transformers/models/qwen3_vl/modular_qwen3_vl.py
Lines 867 to 870 in 753d611
cc @zucchini-nlp 🤗